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, @Nullable Component display, @Nullable NumberFormat numberFormat)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Component
The field for thedisplay
record component.private final NumberFormat
The field for thenumberFormat
record component.private final String
The field for theobjectiveName
record component.private final String
The field for theowner
record component.private final int
The field for thescore
record component. -
Constructor Summary
ConstructorDescriptionClientboundSetScorePacket
(String owner, String objectiveName, int score, Component display, NumberFormat numberFormat) Creates an instance of aClientboundSetScorePacket
record class.ClientboundSetScorePacket
(FriendlyByteBuf p_179373_) -
Method Summary
Modifier and TypeMethodDescriptiondisplay()
Returns the value of thedisplay
record component.final boolean
Indicates whether some other object is "equal to" this one.void
handle
(ClientGamePacketListener p_133338_) final int
hashCode()
Returns a hash code value for this object.Returns the value of thenumberFormat
record component.Returns the value of theobjectiveName
record component.owner()
Returns the value of theowner
record component.int
score()
Returns the value of thescore
record component.final String
toString()
Returns a string representation of this record class.void
write
(FriendlyByteBuf p_133341_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, nextProtocol
-
Field Details
-
owner
The field for theowner
record component. -
objectiveName
The field for theobjectiveName
record component. -
score
private final int scoreThe field for thescore
record component. -
display
The field for thedisplay
record component. -
numberFormat
The field for thenumberFormat
record component.
-
-
Constructor Details
-
ClientboundSetScorePacket
-
ClientboundSetScorePacket
public ClientboundSetScorePacket(String owner, String objectiveName, int score, @Nullable Component display, @Nullable NumberFormat numberFormat) Creates an instance of aClientboundSetScorePacket
record class.- Parameters:
owner
- the value for theowner
record componentobjectiveName
- the value for theobjectiveName
record componentscore
- the value for thescore
record componentdisplay
- the value for thedisplay
record componentnumberFormat
- the value for thenumberFormat
record component
-
-
Method Details
-
write
- Specified by:
write
in interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handle
in 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 theowner
record component.- Returns:
- the value of the
owner
record component
-
objectiveName
Returns the value of theobjectiveName
record component.- Returns:
- the value of the
objectiveName
record component
-
score
public int score()Returns the value of thescore
record component.- Returns:
- the value of the
score
record component
-
display
Returns the value of thedisplay
record component.- Returns:
- the value of the
display
record component
-
numberFormat
Returns the value of thenumberFormat
record component.- Returns:
- the value of the
numberFormat
record component
-