Record Class ClientboundSetScorePacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundSetScorePacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundSetScorePacket(String owner, String objectiveName, int score, Optional<Component> display, Optional<NumberFormat> numberFormat)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thedisplayrecord component.private final Optional<NumberFormat> The field for thenumberFormatrecord component.private final StringThe field for theobjectiveNamerecord component.private final StringThe field for theownerrecord component.private final intThe field for thescorerecord component.static final StreamCodec<RegistryFriendlyByteBuf, ClientboundSetScorePacket> -
Constructor Summary
ConstructorsConstructorDescriptionClientboundSetScorePacket(String owner, String objectiveName, int score, Optional<Component> display, Optional<NumberFormat> numberFormat) Creates an instance of aClientboundSetScorePacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondisplay()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientGamePacketListener p_133338_) final inthashCode()Returns a hash code value for this object.Returns the value of thenumberFormatrecord component.Returns the value of theobjectiveNamerecord component.owner()Returns the value of theownerrecord component.intscore()Returns the value of thescorerecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
owner
The field for theownerrecord component. -
objectiveName
The field for theobjectiveNamerecord component. -
score
private final int scoreThe field for thescorerecord component. -
display
The field for thedisplayrecord component. -
numberFormat
The field for thenumberFormatrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundSetScorePacket
public ClientboundSetScorePacket(String owner, String objectiveName, int score, Optional<Component> display, Optional<NumberFormat> numberFormat) Creates an instance of aClientboundSetScorePacketrecord class.- Parameters:
owner- the value for theownerrecord componentobjectiveName- the value for theobjectiveNamerecord componentscore- the value for thescorerecord componentdisplay- the value for thedisplayrecord componentnumberFormat- the value for thenumberFormatrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handlein interfacePacket<ClientGamePacketListener>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
objectiveName
Returns the value of theobjectiveNamerecord component.- Returns:
- the value of the
objectiveNamerecord component
-
score
public int score()Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
display
Returns the value of thedisplayrecord component.- Returns:
- the value of the
displayrecord component
-
numberFormat
Returns the value of thenumberFormatrecord component.- Returns:
- the value of the
numberFormatrecord component
-