Record Class AllOf.EntityEffects
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.effects.AllOf.EntityEffects
- All Implemented Interfaces:
EnchantmentEntityEffect, EnchantmentLocationBasedEffect
- Enclosing interface:
AllOf
public static record AllOf.EntityEffects(List<EnchantmentEntityEffect> effects)
extends Record
implements EnchantmentEntityEffect
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<AllOf.EntityEffects> private final List<EnchantmentEntityEffect> The field for theeffectsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEntityEffects(List<EnchantmentEntityEffect> effects) Creates an instance of aEntityEffectsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ServerLevel serverLevel, int enchantmentLevel, EnchantedItemInUse item, Entity entity, Vec3 position) com.mojang.serialization.MapCodec<AllOf.EntityEffects> codec()effects()Returns the value of theeffectsrecord 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.Methods inherited from interface EnchantmentEntityEffect
onChangedBlockMethods inherited from interface EnchantmentLocationBasedEffect
onDeactivated
-
Field Details
-
effects
The field for theeffectsrecord component. -
CODEC
-
-
Constructor Details
-
EntityEffects
Creates an instance of aEntityEffectsrecord class.- Parameters:
effects- the value for theeffectsrecord component
-
-
Method Details
-
apply
public void apply(ServerLevel serverLevel, int enchantmentLevel, EnchantedItemInUse item, Entity entity, Vec3 position) - Specified by:
applyin interfaceEnchantmentEntityEffect
-
codec
- Specified by:
codecin interfaceEnchantmentEntityEffect- Specified by:
codecin interfaceEnchantmentLocationBasedEffect
-
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). -
effects
Returns the value of theeffectsrecord component.- Returns:
- the value of the
effectsrecord component
-