Record Class ContextScoreboardNameProvider
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.score.ContextScoreboardNameProvider
- All Implemented Interfaces:
ScoreboardNameProvider
public record ContextScoreboardNameProvider(LootContext.EntityTarget target)
extends Record
implements ScoreboardNameProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ContextScoreboardNameProvider>static final com.mojang.serialization.Codec<ContextScoreboardNameProvider>private final LootContext.EntityTargetThe field for thetargetrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aContextScoreboardNameProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static ScoreboardNameProviderforTarget(LootContext.EntityTarget p_165808_) Set<LootContextParam<?>>getScoreboardName(LootContext p_165810_) getType()final inthashCode()Returns a hash code value for this object.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
target
The field for thetargetrecord component. -
CODEC
-
INLINE_CODEC
-
-
Constructor Details
-
ContextScoreboardNameProvider
Creates an instance of aContextScoreboardNameProviderrecord class.- Parameters:
target- the value for thetargetrecord component
-
-
Method Details
-
forTarget
-
getType
- Specified by:
getTypein interfaceScoreboardNameProvider
-
getScoreboardName
- Specified by:
getScoreboardNamein interfaceScoreboardNameProvider
-
getReferencedContextParams
- Specified by:
getReferencedContextParamsin interfaceScoreboardNameProvider
-
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). -
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-