Package net.minecraft.world.scores
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
Modifier and TypeFieldDescriptionprivate final Component
The field for thedisplay
record component.private final NumberFormat
The field for thenumberFormatOverride
record component.private final String
The field for theowner
record component.private final int
The field for thevalue
record component. -
Constructor Summary
ConstructorDescriptionPlayerScoreEntry
(String owner, int value, Component display, NumberFormat numberFormatOverride) Creates an instance of aPlayerScoreEntry
record class. -
Method Summary
Modifier and TypeMethodDescriptiondisplay()
Returns the value of thedisplay
record component.final boolean
Indicates whether some other object is "equal to" this one.formatValue
(NumberFormat p_313792_) final int
hashCode()
Returns a hash code value for this object.boolean
isHidden()
Returns the value of thenumberFormatOverride
record component.owner()
Returns the value of theowner
record component.final String
toString()
Returns a string representation of this record class.int
value()
Returns the value of thevalue
record component.
-
Field Details
-
owner
The field for theowner
record component. -
value
private final int valueThe field for thevalue
record component. -
display
The field for thedisplay
record component. -
numberFormatOverride
The field for thenumberFormatOverride
record component.
-
-
Constructor Details
-
PlayerScoreEntry
public PlayerScoreEntry(String owner, int value, @Nullable Component display, @Nullable NumberFormat numberFormatOverride) Creates an instance of aPlayerScoreEntry
record class.- Parameters:
owner
- the value for theowner
record componentvalue
- the value for thevalue
record componentdisplay
- the value for thedisplay
record componentnumberFormatOverride
- the value for thenumberFormatOverride
record component
-
-
Method Details
-
isHidden
public boolean isHidden() -
ownerName
-
formatValue
-
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
-
value
public int value()Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
display
Returns the value of thedisplay
record component.- Returns:
- the value of the
display
record component
-
numberFormatOverride
Returns the value of thenumberFormatOverride
record component.- Returns:
- the value of the
numberFormatOverride
record component
-