Record Class ParticleEffectData

java.lang.Object
java.lang.Record
johnsmith.enchantingoverhauled.api.enchantment.theme.effect.ParticleEffectData
Record Components:
effect - The ParticleType to spawn (e.g., minecraft:soul).
velocity - The base directional velocity vector (x, y, z) applied to the spawned particle.
velocityVariance - A random variance vector (x, y, z) added to the base velocity for scattering.
offset - The base offset vector (x, y, z) from the center of the table, provider, or entity.
offsetVariance - A random variance vector (x, y, z) added to the base offset for scattering the spawn point.

public record ParticleEffectData(net.minecraft.core.particles.ParticleType<?> effect, net.minecraft.world.phys.Vec3 velocity, net.minecraft.world.phys.Vec3 velocityVariance, net.minecraft.world.phys.Vec3 offset, net.minecraft.world.phys.Vec3 offsetVariance) extends Record
A data-driven record defining the specific parameters for spawning a particle effect associated with an EnchantmentTheme.

The spawn rate (iterations and chance) is controlled by the parent EffectData record.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<ParticleEffectData>
    The codec responsible for serializing and deserializing instances of this record from JSON.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ParticleEffectData(net.minecraft.core.particles.ParticleType<?> effect, net.minecraft.world.phys.Vec3 velocity, net.minecraft.world.phys.Vec3 velocityVariance, net.minecraft.world.phys.Vec3 offset, net.minecraft.world.phys.Vec3 offsetVariance)
    Creates an instance of a ParticleEffectData record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.core.particles.ParticleType<?>
    Returns the value of the effect record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    net.minecraft.world.phys.Vec3
    Returns the value of the offset record component.
    net.minecraft.world.phys.Vec3
    Returns the value of the offsetVariance record component.
    final String
    Returns a string representation of this record class.
    net.minecraft.world.phys.Vec3
    Returns the value of the velocity record component.
    net.minecraft.world.phys.Vec3
    Returns the value of the velocityVariance record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<ParticleEffectData> CODEC
      The codec responsible for serializing and deserializing instances of this record from JSON. Uses BuiltInRegistries.PARTICLE_TYPE's name codec to resolve the ParticleType.
  • Constructor Details

    • ParticleEffectData

      public ParticleEffectData(net.minecraft.core.particles.ParticleType<?> effect, net.minecraft.world.phys.Vec3 velocity, net.minecraft.world.phys.Vec3 velocityVariance, net.minecraft.world.phys.Vec3 offset, net.minecraft.world.phys.Vec3 offsetVariance)
      Creates an instance of a ParticleEffectData record class.
      Parameters:
      effect - the value for the effect record component
      velocity - the value for the velocity record component
      velocityVariance - the value for the velocityVariance record component
      offset - the value for the offset record component
      offsetVariance - the value for the offsetVariance record component
  • Method Details

    • 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.
    • effect

      public net.minecraft.core.particles.ParticleType<?> effect()
      Returns the value of the effect record component.
      Returns:
      the value of the effect record component
    • velocity

      public net.minecraft.world.phys.Vec3 velocity()
      Returns the value of the velocity record component.
      Returns:
      the value of the velocity record component
    • velocityVariance

      public net.minecraft.world.phys.Vec3 velocityVariance()
      Returns the value of the velocityVariance record component.
      Returns:
      the value of the velocityVariance record component
    • offset

      public net.minecraft.world.phys.Vec3 offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • offsetVariance

      public net.minecraft.world.phys.Vec3 offsetVariance()
      Returns the value of the offsetVariance record component.
      Returns:
      the value of the offsetVariance record component