Record Class PlayerScoreEntry

java.lang.Object
java.lang.Record
net.minecraft.world.scores.PlayerScoreEntry

public record PlayerScoreEntry(String owner, int value, @Nullable Component display, @Nullable NumberFormat numberFormatOverride) extends Record
  • Field Details

    • owner

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

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

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

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

    • PlayerScoreEntry

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

    • isHidden

      public boolean isHidden()
    • ownerName

      public Component ownerName()
    • formatValue

      public MutableComponent formatValue(NumberFormat p_312365_)
    • 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
    • value

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

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

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