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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<SummonEntityEffect> private final HolderSet
<EntityType<?>> The field for theentityTypes
record component.private final boolean
The field for thejoinTeam
record component. -
Constructor Summary
ConstructorDescriptionSummonEntityEffect
(HolderSet<EntityType<?>> entityTypes, boolean joinTeam) Creates an instance of aSummonEntityEffect
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(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 theentityTypes
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
joinTeam()
Returns the value of thejoinTeam
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect
onChangedBlock
Methods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect
onDeactivated
-
Field Details
-
entityTypes
The field for theentityTypes
record component. -
joinTeam
private final boolean joinTeamThe field for thejoinTeam
record component. -
CODEC
-
-
Constructor Details
-
SummonEntityEffect
Creates an instance of aSummonEntityEffect
record class.- Parameters:
entityTypes
- the value for theentityTypes
record componentjoinTeam
- the value for thejoinTeam
record component
-
-
Method Details
-
apply
public void apply(ServerLevel p_344501_, int p_344802_, EnchantedItemInUse p_342872_, Entity p_342384_, Vec3 p_342075_) - Specified by:
apply
in interfaceEnchantmentEntityEffect
-
codec
- Specified by:
codec
in interfaceEnchantmentEntityEffect
- Specified by:
codec
in 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 theentityTypes
record component.- Returns:
- the value of the
entityTypes
record component
-
joinTeam
public boolean joinTeam()Returns the value of thejoinTeam
record component.- Returns:
- the value of the
joinTeam
record component
-