Package net.minecraft.world.scores
Record Class Scoreboard.PackedScore
java.lang.Object
java.lang.Record
net.minecraft.world.scores.Scoreboard.PackedScore
- Enclosing class:
Scoreboard
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<Scoreboard.PackedScore> private final String
The field for theobjective
record component.private final String
The field for theowner
record component.private final Score
The field for thescore
record component. -
Constructor Summary
ConstructorsConstructorDescriptionPackedScore
(String owner, String objective, Score score) Creates an instance of aPackedScore
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theobjective
record component.owner()
Returns the value of theowner
record component.score()
Returns the value of thescore
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
owner
The field for theowner
record component. -
objective
The field for theobjective
record component. -
score
The field for thescore
record component. -
CODEC
-
-
Constructor Details
-
PackedScore
Creates an instance of aPackedScore
record class.- Parameters:
owner
- the value for theowner
record componentobjective
- the value for theobjective
record componentscore
- the value for thescore
record component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
owner
Returns the value of theowner
record component.- Returns:
- the value of the
owner
record component
-
objective
Returns the value of theobjective
record component.- Returns:
- the value of the
objective
record component
-
score
Returns the value of thescore
record component.- Returns:
- the value of the
score
record component
-