Record Class SummonEntityEffect
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.effects.SummonEntityEffect
- All Implemented Interfaces:
EnchantmentEntityEffect,EnchantmentLocationBasedEffect
public record SummonEntityEffect(HolderSet<EntityType<?>> entityTypes, boolean joinTeam)
extends Record
implements EnchantmentEntityEffect
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SummonEntityEffect> private final HolderSet<EntityType<?>> The field for theentityTypesrecord component.private final booleanThe field for thejoinTeamrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSummonEntityEffect(HolderSet<EntityType<?>> entityTypes, boolean joinTeam) Creates an instance of aSummonEntityEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ServerLevel p_344501_, int p_344802_, EnchantedItemInUse p_342872_, Entity p_342384_, Vec3 p_342075_) com.mojang.serialization.MapCodec<SummonEntityEffect> codec()HolderSet<EntityType<?>> Returns the value of theentityTypesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanjoinTeam()Returns the value of thejoinTeamrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect
onChangedBlockMethods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect
onDeactivated
-
Field Details
-
entityTypes
The field for theentityTypesrecord component. -
joinTeam
private final boolean joinTeamThe field for thejoinTeamrecord component. -
CODEC
-
-
Constructor Details
-
SummonEntityEffect
Creates an instance of aSummonEntityEffectrecord class.- Parameters:
entityTypes- the value for theentityTypesrecord componentjoinTeam- the value for thejoinTeamrecord component
-
-
Method Details
-
apply
public void apply(ServerLevel p_344501_, int p_344802_, EnchantedItemInUse p_342872_, Entity p_342384_, Vec3 p_342075_) - Specified by:
applyin interfaceEnchantmentEntityEffect
-
codec
- Specified by:
codecin interfaceEnchantmentEntityEffect- Specified by:
codecin interfaceEnchantmentLocationBasedEffect
-
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 '=='. -
entityTypes
Returns the value of theentityTypesrecord component.- Returns:
- the value of the
entityTypesrecord component
-
joinTeam
public boolean joinTeam()Returns the value of thejoinTeamrecord component.- Returns:
- the value of the
joinTeamrecord component
-