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
Modifier and TypeClassDescriptionstatic final record
static enum
static final record
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<SpawnParticlesEffect> private final SpawnParticlesEffect.PositionSource
The field for thehorizontalPosition
record component.private final SpawnParticlesEffect.VelocitySource
The field for thehorizontalVelocity
record component.private final ParticleOptions
The field for theparticle
record component.private final FloatProvider
The field for thespeed
record component.private final SpawnParticlesEffect.PositionSource
The field for theverticalPosition
record component.private final SpawnParticlesEffect.VelocitySource
The field for theverticalVelocity
record component. -
Constructor Summary
ConstructorDescriptionSpawnParticlesEffect
(ParticleOptions particle, SpawnParticlesEffect.PositionSource horizontalPosition, SpawnParticlesEffect.PositionSource verticalPosition, SpawnParticlesEffect.VelocitySource horizontalVelocity, SpawnParticlesEffect.VelocitySource verticalVelocity, FloatProvider speed) Creates an instance of aSpawnParticlesEffect
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(ServerLevel p_345529_, int p_346425_, EnchantedItemInUse p_346391_, Entity p_345668_, Vec3 p_344842_) com.mojang.serialization.MapCodec
<SpawnParticlesEffect> codec()
final boolean
Indicates whether some other object is "equal to" this one.fixedVelocity
(FloatProvider p_345397_) final int
hashCode()
Returns a hash code value for this object.Returns the value of thehorizontalPosition
record component.Returns the value of thehorizontalVelocity
record component.movementScaled
(float p_345360_) offsetFromEntityPosition
(float p_345365_) particle()
Returns the value of theparticle
record component.speed()
Returns the value of thespeed
record component.final String
toString()
Returns a string representation of this record class.Returns the value of theverticalPosition
record component.Returns the value of theverticalVelocity
record component.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
-
particle
The field for theparticle
record component. -
horizontalPosition
The field for thehorizontalPosition
record component. -
verticalPosition
The field for theverticalPosition
record component. -
horizontalVelocity
The field for thehorizontalVelocity
record component. -
verticalVelocity
The field for theverticalVelocity
record component. -
speed
The field for thespeed
record 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 aSpawnParticlesEffect
record class.- Parameters:
particle
- the value for theparticle
record componenthorizontalPosition
- the value for thehorizontalPosition
record componentverticalPosition
- the value for theverticalPosition
record componenthorizontalVelocity
- the value for thehorizontalVelocity
record componentverticalVelocity
- the value for theverticalVelocity
record componentspeed
- the value for thespeed
record 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:
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
particle
Returns the value of theparticle
record component.- Returns:
- the value of the
particle
record component
-
horizontalPosition
Returns the value of thehorizontalPosition
record component.- Returns:
- the value of the
horizontalPosition
record component
-
verticalPosition
Returns the value of theverticalPosition
record component.- Returns:
- the value of the
verticalPosition
record component
-
horizontalVelocity
Returns the value of thehorizontalVelocity
record component.- Returns:
- the value of the
horizontalVelocity
record component
-
verticalVelocity
Returns the value of theverticalVelocity
record component.- Returns:
- the value of the
verticalVelocity
record component
-
speed
Returns the value of thespeed
record component.- Returns:
- the value of the
speed
record component
-