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 Details

    • owner

      private final String owner
      The field for the owner record component.
    • objectiveName

      private final String objectiveName
      The field for the objectiveName record component.
    • score

      private final int score
      The field for the score record component.
    • display

      @Nullable private final Component display
      The field for the display record component.
    • numberFormat

      @Nullable private final NumberFormat numberFormat
      The field for the numberFormat record component.
  • Constructor Details

    • ClientboundSetScorePacket

      public ClientboundSetScorePacket(FriendlyByteBuf p_179373_)
    • ClientboundSetScorePacket

      public ClientboundSetScorePacket(String owner, String objectiveName, int score, @Nullable Component display, @Nullable NumberFormat numberFormat)
      Creates an instance of a ClientboundSetScorePacket record class.
      Parameters:
      owner - the value for the owner record component
      objectiveName - the value for the objectiveName record component
      score - the value for the score record component
      display - the value for the display record component
      numberFormat - the value for the numberFormat record component
  • Method Details

    • write

      public void write(FriendlyByteBuf p_133341_)
      Specified by:
      write in interface Packet<ClientGamePacketListener>
    • handle

      public void handle(ClientGamePacketListener p_133338_)
      Specified by:
      handle in interface Packet<ClientGamePacketListener>
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • owner

      public String owner()
      Returns the value of the owner record component.
      Returns:
      the value of the owner record component
    • objectiveName

      public String objectiveName()
      Returns the value of the objectiveName record component.
      Returns:
      the value of the objectiveName record component
    • score

      public int score()
      Returns the value of the score record component.
      Returns:
      the value of the score record component
    • display

      @Nullable public Component display()
      Returns the value of the display record component.
      Returns:
      the value of the display record component
    • numberFormat

      @Nullable public NumberFormat numberFormat()
      Returns the value of the numberFormat record component.
      Returns:
      the value of the numberFormat record component