Record Class ApplyEntityImpulse
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.effects.ApplyEntityImpulse
- All Implemented Interfaces:
EnchantmentEntityEffect,EnchantmentLocationBasedEffect
public record ApplyEntityImpulse(Vec3 direction, Vec3 coordinateScale, LevelBasedValue magnitude)
extends Record
implements EnchantmentEntityEffect
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ApplyEntityImpulse> private final Vec3The field for thecoordinateScalerecord component.private final Vec3The field for thedirectionrecord component.private final LevelBasedValueThe field for themagnituderecord component.private static final int -
Constructor Summary
ConstructorsConstructorDescriptionApplyEntityImpulse(Vec3 direction, Vec3 coordinateScale, LevelBasedValue magnitude) Creates an instance of aApplyEntityImpulserecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ServerLevel p_454879_, int p_454857_, EnchantedItemInUse p_455030_, Entity p_455129_, Vec3 p_455690_) com.mojang.serialization.MapCodec<ApplyEntityImpulse> codec()Returns the value of thecoordinateScalerecord component.Returns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themagnituderecord 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
-
direction
The field for thedirectionrecord component. -
coordinateScale
The field for thecoordinateScalerecord component. -
magnitude
The field for themagnituderecord component. -
CODEC
-
POST_IMPULSE_CONTEXT_RESET_GRACE_TIME_TICKS
private static final int POST_IMPULSE_CONTEXT_RESET_GRACE_TIME_TICKS- See Also:
-
-
Constructor Details
-
ApplyEntityImpulse
Creates an instance of aApplyEntityImpulserecord class.- Parameters:
direction- the value for thedirectionrecord componentcoordinateScale- the value for thecoordinateScalerecord componentmagnitude- the value for themagnituderecord component
-
-
Method Details
-
apply
public void apply(ServerLevel p_454879_, int p_454857_, EnchantedItemInUse p_455030_, Entity p_455129_, Vec3 p_455690_) - 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. All components in this record class are compared withObjects::equals(Object,Object). -
direction
Returns the value of thedirectionrecord component.- Returns:
- the value of the
directionrecord component
-
coordinateScale
Returns the value of thecoordinateScalerecord component.- Returns:
- the value of the
coordinateScalerecord component
-
magnitude
Returns the value of themagnituderecord component.- Returns:
- the value of the
magnituderecord component
-