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
  • Field Details

  • Constructor Details

  • Method Details

    • offsetFromEntityPosition

      public static SpawnParticlesEffect.PositionSource offsetFromEntityPosition(float p_344734_)
    • inBoundingBox

      public static SpawnParticlesEffect.PositionSource inBoundingBox()
    • movementScaled

      public static SpawnParticlesEffect.VelocitySource movementScaled(float p_342848_)
    • fixedVelocity

      public static SpawnParticlesEffect.VelocitySource fixedVelocity(FloatProvider p_344992_)
    • apply

      public void apply(ServerLevel p_344629_, int p_343825_, EnchantedItemInUse p_342850_, Entity p_342334_, Vec3 p_344096_)
      Specified by:
      apply in interface EnchantmentEntityEffect
    • codec

      public com.mojang.serialization.MapCodec<SpawnParticlesEffect> codec()
      Specified by:
      codec in interface EnchantmentEntityEffect
      Specified by:
      codec in interface EnchantmentLocationBasedEffect
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • particle

      public ParticleOptions particle()
      Returns the value of the particle record component.
      Returns:
      the value of the particle record component
    • horizontalPosition

      public SpawnParticlesEffect.PositionSource horizontalPosition()
      Returns the value of the horizontalPosition record component.
      Returns:
      the value of the horizontalPosition record component
    • verticalPosition

      public SpawnParticlesEffect.PositionSource verticalPosition()
      Returns the value of the verticalPosition record component.
      Returns:
      the value of the verticalPosition record component
    • horizontalVelocity

      public SpawnParticlesEffect.VelocitySource horizontalVelocity()
      Returns the value of the horizontalVelocity record component.
      Returns:
      the value of the horizontalVelocity record component
    • verticalVelocity

      public SpawnParticlesEffect.VelocitySource verticalVelocity()
      Returns the value of the verticalVelocity record component.
      Returns:
      the value of the verticalVelocity record component
    • speed

      public FloatProvider speed()
      Returns the value of the speed record component.
      Returns:
      the value of the speed record component