Record Class BurstEntityVisualEffect

java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.spellfield.effect.visual.BurstEntityVisualEffect
Record Components:
particle - The ParticleOptions defining the particle type to emit.
count - The LevelBasedValue base number of particles emitted per entity before topological scaling.
speed - The LevelBasedValue base particle speed before topological scaling.
All Implemented Interfaces:
SpellFieldEffect, SpellFieldEntityEffect

public record BurstEntityVisualEffect(net.minecraft.core.particles.ParticleOptions particle, net.minecraft.world.item.enchantment.LevelBasedValue count, net.minecraft.world.item.enchantment.LevelBasedValue speed) extends Record implements SpellFieldEntityEffect
A visual SpellFieldEntityEffect that emits a burst of particles centered at the vertical midpoint of each targeted entity within a spell field volume, scaling both particle count and speed by the entity's local topological multiplier.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<BurstEntityVisualEffect>
    MapCodec for serializing and deserializing BurstEntityVisualEffect instances from JSON.
    static final String
    JSON field key for the base particle count.
    static final String
    Registry path identifier for this spell field entity effect.
    Supplies the JSON property keys holding LevelBasedValue definitions for data transformation.
    static final String
    JSON field key for the particle options definition.
    static final String
    JSON field key for the base particle speed.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BurstEntityVisualEffect(net.minecraft.core.particles.ParticleOptions particle, net.minecraft.world.item.enchantment.LevelBasedValue count, net.minecraft.world.item.enchantment.LevelBasedValue speed)
    Creates an instance of a BurstEntityVisualEffect record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(net.minecraft.server.level.ServerLevel level, int enchantmentLevel, net.minecraft.world.item.enchantment.EnchantedItemInUse context, net.minecraft.world.entity.Entity spatialReference, net.minecraft.world.phys.Vec3 epicenter, net.minecraft.world.entity.Entity victim, float scalar)
    Broadcasts a particle burst around the chest height ($\text{pos} + (0, \text{height}/2, 0)$) of victim with a $(0.25, 0.5, 0.25)$ spatial spread.
    com.mojang.serialization.MapCodec<? extends SpellFieldEntityEffect>
    Retrieves the MapCodec responsible for serializing and deserializing this effect.
    net.minecraft.world.item.enchantment.LevelBasedValue
    Returns the value of the count 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.core.particles.ParticleOptions
    Returns the value of the particle record component.
    net.minecraft.world.item.enchantment.LevelBasedValue
    Returns the value of the speed record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • BurstEntityVisualEffect

      public BurstEntityVisualEffect(net.minecraft.core.particles.ParticleOptions particle, net.minecraft.world.item.enchantment.LevelBasedValue count, net.minecraft.world.item.enchantment.LevelBasedValue speed)
      Creates an instance of a BurstEntityVisualEffect record class.
      Parameters:
      particle - the value for the particle record component
      count - the value for the count record component
      speed - the value for the speed record component
  • Method Details

    • apply

      public void apply(net.minecraft.server.level.ServerLevel level, int enchantmentLevel, net.minecraft.world.item.enchantment.EnchantedItemInUse context, net.minecraft.world.entity.Entity spatialReference, net.minecraft.world.phys.Vec3 epicenter, net.minecraft.world.entity.Entity victim, float scalar)
      Broadcasts a particle burst around the chest height ($\text{pos} + (0, \text{height}/2, 0)$) of victim with a $(0.25, 0.5, 0.25)$ spatial spread.
      Specified by:
      apply in interface SpellFieldEntityEffect
      Parameters:
      level - The executing server level.
      enchantmentLevel - The active level of the spell field enchantment.
      context - The item usage context triggering the spell field.
      spatialReference - The anchor entity or focal point of the spell field.
      epicenter - The exact spatial origin vector of the spell field.
      victim - The target entity intersecting the spell field.
      scalar - The active topological multiplier for victim.
    • codec

      public com.mojang.serialization.MapCodec<? extends SpellFieldEntityEffect> codec()
      Description copied from interface: SpellFieldEffect
      Retrieves the MapCodec responsible for serializing and deserializing this effect.
      Specified by:
      codec in interface SpellFieldEffect
      Returns:
      The registered MapCodec instance.
    • 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 net.minecraft.core.particles.ParticleOptions particle()
      Returns the value of the particle record component.
      Returns:
      the value of the particle record component
    • count

      public net.minecraft.world.item.enchantment.LevelBasedValue count()
      Returns the value of the count record component.
      Returns:
      the value of the count record component
    • speed

      public net.minecraft.world.item.enchantment.LevelBasedValue speed()
      Returns the value of the speed record component.
      Returns:
      the value of the speed record component