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 Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable ComponentThe field for thedisplayrecord component.private final @Nullable NumberFormatThe field for thenumberFormatOverriderecord component.private final StringThe field for theownerrecord component.private final intThe field for thevaluerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPlayerScoreEntry(String owner, int value, @Nullable Component display, @Nullable NumberFormat numberFormatOverride) Creates an instance of aPlayerScoreEntryrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Componentdisplay()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.formatValue(NumberFormat _default) final inthashCode()Returns a hash code value for this object.booleanisHidden()@Nullable NumberFormatReturns the value of thenumberFormatOverriderecord component.owner()Returns the value of theownerrecord component.final StringtoString()Returns a string representation of this record class.intvalue()Returns the value of thevaluerecord component.
-
Field Details
-
owner
The field for theownerrecord component. -
value
private final int valueThe field for thevaluerecord component. -
display
The field for thedisplayrecord component. -
numberFormatOverride
The field for thenumberFormatOverriderecord component.
-
-
Constructor Details
-
PlayerScoreEntry
public PlayerScoreEntry(String owner, int value, @Nullable Component display, @Nullable NumberFormat numberFormatOverride) Creates an instance of aPlayerScoreEntryrecord class.- Parameters:
owner- the value for theownerrecord componentvalue- the value for thevaluerecord componentdisplay- the value for thedisplayrecord componentnumberFormatOverride- the value for thenumberFormatOverriderecord component
-
-
Method Details
-
isHidden
public boolean isHidden() -
ownerName
-
formatValue
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
value
public int value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
display
Returns the value of thedisplayrecord component.- Returns:
- the value of the
displayrecord component
-
numberFormatOverride
Returns the value of thenumberFormatOverriderecord component.- Returns:
- the value of the
numberFormatOverriderecord component
-