Record Class SpawnParticlesEffect
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.effects.SpawnParticlesEffect
- All Implemented Interfaces:
EnchantmentEntityEffect,EnchantmentLocationBasedEffect
public record SpawnParticlesEffect(ParticleOptions particle, SpawnParticlesEffect.PositionSource horizontalPosition, SpawnParticlesEffect.PositionSource verticalPosition, SpawnParticlesEffect.VelocitySource horizontalVelocity, SpawnParticlesEffect.VelocitySource verticalVelocity, FloatProvider speed)
extends Record
implements EnchantmentEntityEffect
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic enumstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SpawnParticlesEffect> private final SpawnParticlesEffect.PositionSourceThe field for thehorizontalPositionrecord component.private final SpawnParticlesEffect.VelocitySourceThe field for thehorizontalVelocityrecord component.private final ParticleOptionsThe field for theparticlerecord component.private final FloatProviderThe field for thespeedrecord component.private final SpawnParticlesEffect.PositionSourceThe field for theverticalPositionrecord component.private final SpawnParticlesEffect.VelocitySourceThe field for theverticalVelocityrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSpawnParticlesEffect(ParticleOptions particle, SpawnParticlesEffect.PositionSource horizontalPosition, SpawnParticlesEffect.PositionSource verticalPosition, SpawnParticlesEffect.VelocitySource horizontalVelocity, SpawnParticlesEffect.VelocitySource verticalVelocity, FloatProvider speed) Creates an instance of aSpawnParticlesEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ServerLevel p_345529_, int p_346425_, EnchantedItemInUse p_346391_, Entity p_345668_, Vec3 p_344842_) com.mojang.serialization.MapCodec<SpawnParticlesEffect> codec()final booleanIndicates whether some other object is "equal to" this one.fixedVelocity(FloatProvider p_345397_) final inthashCode()Returns a hash code value for this object.Returns the value of thehorizontalPositionrecord component.Returns the value of thehorizontalVelocityrecord component.movementScaled(float p_345360_) offsetFromEntityPosition(float p_345365_) particle()Returns the value of theparticlerecord component.speed()Returns the value of thespeedrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theverticalPositionrecord component.Returns the value of theverticalVelocityrecord component.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
-
particle
The field for theparticlerecord component. -
horizontalPosition
The field for thehorizontalPositionrecord component. -
verticalPosition
The field for theverticalPositionrecord component. -
horizontalVelocity
The field for thehorizontalVelocityrecord component. -
verticalVelocity
The field for theverticalVelocityrecord component. -
speed
The field for thespeedrecord component. -
CODEC
-
-
Constructor Details
-
SpawnParticlesEffect
public SpawnParticlesEffect(ParticleOptions particle, SpawnParticlesEffect.PositionSource horizontalPosition, SpawnParticlesEffect.PositionSource verticalPosition, SpawnParticlesEffect.VelocitySource horizontalVelocity, SpawnParticlesEffect.VelocitySource verticalVelocity, FloatProvider speed) Creates an instance of aSpawnParticlesEffectrecord class.- Parameters:
particle- the value for theparticlerecord componenthorizontalPosition- the value for thehorizontalPositionrecord componentverticalPosition- the value for theverticalPositionrecord componenthorizontalVelocity- the value for thehorizontalVelocityrecord componentverticalVelocity- the value for theverticalVelocityrecord componentspeed- the value for thespeedrecord component
-
-
Method Details
-
offsetFromEntityPosition
-
inBoundingBox
-
movementScaled
-
fixedVelocity
-
apply
public void apply(ServerLevel p_345529_, int p_346425_, EnchantedItemInUse p_346391_, Entity p_345668_, Vec3 p_344842_) - 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). -
particle
Returns the value of theparticlerecord component.- Returns:
- the value of the
particlerecord component
-
horizontalPosition
Returns the value of thehorizontalPositionrecord component.- Returns:
- the value of the
horizontalPositionrecord component
-
verticalPosition
Returns the value of theverticalPositionrecord component.- Returns:
- the value of the
verticalPositionrecord component
-
horizontalVelocity
Returns the value of thehorizontalVelocityrecord component.- Returns:
- the value of the
horizontalVelocityrecord component
-
verticalVelocity
Returns the value of theverticalVelocityrecord component.- Returns:
- the value of the
verticalVelocityrecord component
-
speed
Returns the value of thespeedrecord component.- Returns:
- the value of the
speedrecord component
-