Record Class ClickEvent.Custom
java.lang.Object
java.lang.Record
net.minecraft.network.chat.ClickEvent.Custom
- All Implemented Interfaces:
ClickEvent
- Enclosing interface:
ClickEvent
public static record ClickEvent.Custom(Identifier id, Optional<Tag> payload)
extends Record
implements ClickEvent
-
Nested Class Summary
Nested classes/interfaces inherited from interface ClickEvent
ClickEvent.Action, ClickEvent.ChangePage, ClickEvent.CopyToClipboard, ClickEvent.Custom, ClickEvent.OpenFile, ClickEvent.OpenUrl, ClickEvent.RunCommand, ClickEvent.ShowDialog, ClickEvent.SuggestCommand -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ClickEvent.Custom> private final IdentifierThe field for theidrecord component.The field for thepayloadrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCustom(Identifier id, Optional<Tag> payload) Creates an instance of aCustomrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.payload()Returns the value of thepayloadrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
id
The field for theidrecord component. -
payload
-
CODEC
-
-
Constructor Details
-
Custom
Creates an instance of aCustomrecord class.- Parameters:
id- the value for theidrecord componentpayload- the value for thepayloadrecord component
-
-
Method Details
-
action
- Specified by:
actionin interfaceClickEvent
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
payload
-