Record Class BurstEntityVisualEffect
java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.spellfield.effect.visual.BurstEntityVisualEffect
- Record Components:
particle- TheParticleOptionsdefining the particle type to emit.count- TheLevelBasedValuebase number of particles emitted per entity before topological scaling.speed- TheLevelBasedValuebase 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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<BurstEntityVisualEffect> MapCodec for serializing and deserializingBurstEntityVisualEffectinstances from JSON.static final StringJSON field key for the base particle count.static final StringRegistry path identifier for this spell field entity effect.static final LevelBasedKeyProviderSupplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation.static final StringJSON field key for the particle options definition.static final StringJSON field key for the base particle speed. -
Constructor Summary
ConstructorsConstructorDescriptionBurstEntityVisualEffect(net.minecraft.core.particles.ParticleOptions particle, net.minecraft.world.item.enchantment.LevelBasedValue count, net.minecraft.world.item.enchantment.LevelBasedValue speed) Creates an instance of aBurstEntityVisualEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(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)$) ofvictimwith a $(0.25, 0.5, 0.25)$ spatial spread.com.mojang.serialization.MapCodec<? extends SpellFieldEntityEffect> codec()Retrieves theMapCodecresponsible for serializing and deserializing this effect.net.minecraft.world.item.enchantment.LevelBasedValuecount()Returns the value of thecountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.core.particles.ParticleOptionsparticle()Returns the value of theparticlerecord component.net.minecraft.world.item.enchantment.LevelBasedValuespeed()Returns the value of thespeedrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
PARTICLE
JSON field key for the particle options definition.- See Also:
-
COUNT
JSON field key for the base particle count.- See Also:
-
SPEED
JSON field key for the base particle speed.- See Also:
-
KEY
Registry path identifier for this spell field entity effect.- See Also:
-
KEY_PROVIDER
Supplies the JSON property keys holdingLevelBasedValuedefinitions for data transformation. -
CODEC
MapCodec for serializing and deserializingBurstEntityVisualEffectinstances from JSON.
-
-
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 aBurstEntityVisualEffectrecord class.
-
-
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)$) ofvictimwith a $(0.25, 0.5, 0.25)$ spatial spread.- Specified by:
applyin interfaceSpellFieldEntityEffect- 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 forvictim.
-
codec
Description copied from interface:SpellFieldEffectRetrieves theMapCodecresponsible for serializing and deserializing this effect.- Specified by:
codecin interfaceSpellFieldEffect- Returns:
- The registered
MapCodecinstance.
-
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
public net.minecraft.core.particles.ParticleOptions particle()Returns the value of theparticlerecord component.- Returns:
- the value of the
particlerecord component
-
count
public net.minecraft.world.item.enchantment.LevelBasedValue count()Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
speed
public net.minecraft.world.item.enchantment.LevelBasedValue speed()Returns the value of thespeedrecord component.- Returns:
- the value of the
speedrecord component
-