Record Class SetStewEffectFunction.EffectEntry
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.functions.SetStewEffectFunction.EffectEntry
- All Implemented Interfaces:
LootContextUser, Validatable
- Enclosing class:
SetStewEffectFunction
private static record SetStewEffectFunction.EffectEntry(Holder<MobEffect> effect, NumberProvider duration)
extends Record
implements LootContextUser
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SetStewEffectFunction.EffectEntry> private final NumberProviderThe field for thedurationrecord component.The field for theeffectrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateEffectEntry(Holder<MobEffect> effect, NumberProvider duration) Creates an instance of aEffectEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionduration()Returns the value of thedurationrecord component.effect()Returns the value of theeffectrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.voidvalidate(ValidationContext context) Validate that this object is used correctly according to the given ValidationContext.Methods inherited from interface LootContextUser
getReferencedContextParams
-
Field Details
-
effect
-
duration
The field for thedurationrecord component. -
CODEC
-
-
Constructor Details
-
EffectEntry
Creates an instance of aEffectEntryrecord class.- Parameters:
effect- the value for theeffectrecord componentduration- the value for thedurationrecord component
-
-
Method Details
-
validate
Description copied from interface:LootContextUserValidate that this object is used correctly according to the given ValidationContext.- Specified by:
validatein interfaceLootContextUser- Specified by:
validatein interfaceValidatable
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
effect
-
duration
Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-