Skip to content

Spell Field

JohnSmith474 edited this page Sep 22, 2026 · 2 revisions

The following JSON schemas define the Spell Field API. All scalar values utilize LevelBasedValue unless otherwise specified.

Core Component Schema

spell_field

Defines the root evaluation pipeline for nested spatial effects.

Key Type Required Default Description
volumes List<SpellFieldVolume> Yes - Array of spatial volumes defining the geometric bounds.
entity_effects List<SpellFieldEntityEffect> No [] Array of effects executed against entities within the active volumes.
block_effects List<SpellFieldBlockEffect> No [] Array of effects executed against blocks within the active volumes.
volume_effects List<SpellFieldVolumeEffect> No [] Array of effects executed globally per evaluated volume.
visual_effects List<SpellFieldVisualEffect> No [] Array of visual and particle effects rendered across the volume.
Codec
public static final MapCodec<SpellFieldComponent> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        SpellFieldVolume.CODEC.listOf().fieldOf(VOLUMES).forGetter(SpellFieldComponent::volumes),
        EnchantmentCoreRegistries.getSpellFieldEntityEffectCodec().listOf().optionalFieldOf(ENTITY_EFFECTS, List.of()).forGetter(SpellFieldComponent::entityEffects),
        EnchantmentCoreRegistries.getSpellFieldBlockEffectCodec().listOf().optionalFieldOf(BLOCK_EFFECTS, List.of()).forGetter(SpellFieldComponent::blockEffects),
        EnchantmentCoreRegistries.getSpellFieldVolumeEffectCodec().listOf().optionalFieldOf(VOLUME_EFFECTS, List.of()).forGetter(SpellFieldComponent::volumeEffects),
        EnchantmentCoreRegistries.getSpellFieldVisualEffectCodec().listOf().optionalFieldOf(VISUAL_EFFECTS, List.of()).forGetter(SpellFieldComponent::visualEffects)
).apply(instance, SpellFieldComponent::new));
Template
{
  "effect": {
    "type": "enchantment_core:spell_field",
    "volumes": [],
    "entity_effects": [],
    "block_effects": [],
    "volume_effects": [],
    "visual_effects": []
  }
}

SpellFieldVolume

Defines an individual spatial boundary and its topology rules.

Property Type Required Default Description
shape SpellFieldShape No - Geometric shape defining the hard volume bounds.
offset SpatialVector No (0,0,0) Offset vector shifting the volume epicenter relative to the caster.
topology FieldTopology No - Mathematical topology defining multiplier falloffs and active boundaries.
Codec
public static final Codec<SpellFieldVolume> CODEC = RecordCodecBuilder.create(instance -> instance.group(
        EnchantmentCoreRegistries.getSpellFieldShapeCodec().optionalFieldOf(SHAPE).forGetter(SpellFieldVolume::shape),
        SpatialVector.CODEC.optionalFieldOf(OFFSET).forGetter(SpellFieldVolume::offset),
        FieldTopology.CODEC.optionalFieldOf(TOPOLOGY).forGetter(SpellFieldVolume::topology)
).apply(instance, SpellFieldVolume::new));
Template
{
  "shape": {},
  "offset": {},
  "topology": {}
}

FieldTopology

Calculates field strength multipliers based on distance metrics from the origin.

Property Type Required Default Description
origin_range LevelBasedValue Yes - Maximum distance evaluated from the epicenter.
axial_range LevelBasedValue No - Maximum distance evaluated along the designated axis.
radial_range LevelBasedValue No - Maximum distance evaluated perpendicular to the designated axis.
origin_offset SpatialVector No (0,0,0) Local translation shifting the topological center.
axis SpatialVector No - Directional vector establishing the topology orientation.
origin_scaling DistanceScalingFunction No constant Modifier calculating strength drop-off from the origin point.
axial_scaling DistanceScalingFunction No constant Modifier calculating strength drop-off along the axis.
radial_scaling DistanceScalingFunction No constant Modifier calculating strength drop-off radially from the axis.
metric DistanceMetric No euclidean Mathematical algorithm evaluating the spatial distances.
Codec
public static final Codec<FieldTopology> CODEC = RecordCodecBuilder.create(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(ORIGIN_RANGE).forGetter(FieldTopology::originRange),
        LevelBasedValue.CODEC.optionalFieldOf(AXIAL_RANGE).forGetter(FieldTopology::axialRange),
        LevelBasedValue.CODEC.optionalFieldOf(RADIAL_RANGE).forGetter(FieldTopology::radialRange),
        SpatialVector.CODEC.optionalFieldOf(ORIGIN_OFFSET).forGetter(FieldTopology::originOffset),
        SpatialVector.CODEC.optionalFieldOf(AXIS).forGetter(FieldTopology::axis),
        EnchantmentCoreRegistries.getDistanceScalingFunctionCodec().optionalFieldOf(ORIGIN_SCALING, ConstantScalingFunction.NONE).forGetter(FieldTopology::originScaling),
        EnchantmentCoreRegistries.getDistanceScalingFunctionCodec().optionalFieldOf(AXIAL_SCALING, ConstantScalingFunction.NONE).forGetter(FieldTopology::axialScaling),
        EnchantmentCoreRegistries.getDistanceScalingFunctionCodec().optionalFieldOf(RADIAL_SCALING, ConstantScalingFunction.NONE).forGetter(FieldTopology::radialScaling),
        DistanceMetric.CODEC.optionalFieldOf(METRIC, DistanceMetric.EUCLIDEAN).forGetter(FieldTopology::metric)
).apply(instance, FieldTopology::new));
Template
{
  "origin_range": 1.0,
  "axial_range": 1.0,
  "radial_range": 1.0,
  "origin_offset": {},
  "axis": {},
  "origin_scaling": {},
  "axial_scaling": {},
  "radial_scaling": {},
  "metric": "euclidean"
}

Common Objects

SpatialVector

Represents a composite spatial translation offset integrating both absolute global coordinates and dynamic local coordinates.

Property Type Required Default Description
x LevelBasedValue No 0.0 Absolute Cartesian offset along the X-axis.
y LevelBasedValue No 0.0 Absolute Cartesian offset along the Y-axis.
z LevelBasedValue No 0.0 Absolute Cartesian offset along the Z-axis.
forward LevelBasedValue No 0.0 Entity-relative longitudinal offset aligned with the caster's line of sight.
up LevelBasedValue No 0.0 Entity-relative vertical offset aligned with the caster's up vector.
right LevelBasedValue No 0.0 Entity-relative lateral offset aligned with the caster's horizontal plane.
Codec
public static final Codec<SpatialVector> CODEC = RecordCodecBuilder.create(instance -> instance.group(
        LevelBasedValue.CODEC.optionalFieldOf(X, LevelBasedValue.constant(0.0F)).forGetter(SpatialVector::x),
        LevelBasedValue.CODEC.optionalFieldOf(Y, LevelBasedValue.constant(0.0F)).forGetter(SpatialVector::y),
        LevelBasedValue.CODEC.optionalFieldOf(Z, LevelBasedValue.constant(0.0F)).forGetter(SpatialVector::z),
        LevelBasedValue.CODEC.optionalFieldOf(FORWARD, LevelBasedValue.constant(0.0F)).forGetter(SpatialVector::forward),
        LevelBasedValue.CODEC.optionalFieldOf(UP, LevelBasedValue.constant(0.0F)).forGetter(SpatialVector::up),
        LevelBasedValue.CODEC.optionalFieldOf(RIGHT, LevelBasedValue.constant(0.0F)).forGetter(SpatialVector::right)
).apply(instance, SpatialVector::new));
Template
{
  "x": 0.0,
  "y": 0.0,
  "z": 0.0,
  "forward": 0.0,
  "up": 0.0,
  "right": 0.0
}

TopologyEvaluator

Validates block modifications against topological probability scalars.

Property Type Required Default Description
threshold LevelBasedValue No - Hard threshold requirement. Defaults to probabilistic RNG if absent.
Codec
public static final Codec<TopologyEvaluator> CODEC = RecordCodecBuilder.create(instance -> instance.group(
        LevelBasedValue.CODEC.optionalFieldOf(THRESHOLD).forGetter(TopologyEvaluator::threshold)
).apply(instance, TopologyEvaluator::new));
Template
{
  "threshold": 1.0
}

ProbabilityDistribution

Provides random coordinate sampling within defined volumes.

Property Type Required Default Description
sampling_attempts Integer No 20 Maximum iterations executed to find a valid coordinate within the topology.
Codec
public static final Codec<ProbabilityDistribution> CODEC = RecordCodecBuilder.create(instance -> instance.group(
        Codec.INT.optionalFieldOf(SAMPLING_ATTEMPTS, 20).forGetter(ProbabilityDistribution::samplingAttempts)
).apply(instance, ProbabilityDistribution::new));
Template
{
  "sampling_attempts": 20
}

PotionPayload

Defines a specific mob effect application.

Property Type Required Default Description
effect Holder<MobEffect> Yes - Registry identifier for the potion effect.
duration_ticks LevelBasedValue Yes - Lifespan of the applied effect.
amplifier LevelBasedValue Yes - Strength level of the applied effect.
Codec
public static final Codec<PotionPayload> CODEC = RecordCodecBuilder.create(instance -> instance.group(
        BuiltInRegistries.MOB_EFFECT.holderByNameCodec().fieldOf(EFFECT).forGetter(PotionPayload::effect),
        LevelBasedValue.CODEC.fieldOf(DURATION_TICKS).forGetter(PotionPayload::durationTicks),
        LevelBasedValue.CODEC.fieldOf(AMPLIFIER).forGetter(PotionPayload::amplifier)
).apply(instance, PotionPayload::new));
Template
{
  "effect": "minecraft:poison",
  "duration_ticks": 100.0,
  "amplifier": 0.0
}

Enumerations

DistanceMetric

Defines the mathematical algorithm utilized to calculate spatial distance constraints within a topology.

Value Description
euclidean Standard linear distance calculation (L2 norm).
manhattan Grid-based distance calculation summing the absolute differences of Cartesian coordinates (L1 norm).

FieldAxis

Defines spatial alignment vectors and corresponding impulse calculation vectors based on entity reference frames.

Value Description
vertical Aligns with the entity's local vertical orientation (up vector)
longitudinal Aligns with the entity's direct line of sight (forward vector).
lateral Aligns with the entity's horizontal lateral plane (right vector).
radial Aligns with the vector extending outward from the evaluation epicenter toward the target.
azimuthal Defines a vector tangent to the radius on the horizontal plane (orbital motion).
nutational Defines a vector tangent to the radius on the longitudinal plane (pitching orbit).
torsional Defines a vector tangent to the radius on the lateral plane (rolling orbit).

RotationDirection

Defines the rotational path behavior for orbital motion mechanics.

Value Description
clockwise Forces a strictly clockwise trajectory.
counter_clockwise Forces a strictly counter-clockwise trajectory.
any Allows dynamic assignment of rotation direction.

Distance Scaling Functions

constant

Returns a fixed multiplier regardless of distance.

Property Type Required Default Description
value Float No 1.0 Absolute multiplier applied to the topology strength.
Codec
public static final MapCodec<ConstantScalingFunction> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        Codec.FLOAT.optionalFieldOf(VALUE, 1.0F).forGetter(ConstantScalingFunction::value)
).apply(instance, ConstantScalingFunction::new));
Template
{
  "type": "enchantment_core:constant",
  "value": 1.0
}

linear

Returns a multiplier dropping linearly toward zero at the edge.

Requires no properties.

Codec
public static final MapCodec<LinearScalingFunction> CODEC = MapCodec.unit(new LinearScalingFunction());
Template
{
  "type": "enchantment_core:linear"
}

polynomial

Returns a multiplier scaled by a polynomial curve.

Property Type Required Default Description
degree Float No 1.0 Exponent applied to the normalized distance fraction.
Codec
public static final MapCodec<PolynomialScalingFunction> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        Codec.FLOAT.optionalFieldOf(DEGREE, 1.0f).forGetter(PolynomialScalingFunction::degree)
).apply(instance, PolynomialScalingFunction::new));
Template
{
  "type": "enchantment_core:polynomial",
  "degree": 1.0
}

exponential

Returns an exponentially decaying multiplier.

Property Type Required Default Description
decay_rate Float Yes - Coefficient controlling the exponential decay curve steepness.
Codec
public static final MapCodec<ExponentialScalingFunction> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        Codec.FLOAT.fieldOf(DECAY_RATE).forGetter(ExponentialScalingFunction::decayRate)
).apply(instance, ExponentialScalingFunction::new));
Template
{
  "type": "enchantment_core:exponential",
  "decay_rate": 2.0
}

logarithmic

Returns a logarithmic falloff multiplier.

Property Type Required Default Description
steepness Float No 1.0 Multiplier controlling the logarithmic curve compression.
Codec
public static final MapCodec<LogarithmicScalingFunction> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        Codec.FLOAT.optionalFieldOf(STEEPNESS, 1.0F).forGetter(LogarithmicScalingFunction::steepness)
).apply(instance, LogarithmicScalingFunction::new));
Template
{
  "type": "enchantment_core:logarithmic",
  "steepness": 1.0
}

sigmoid

Returns an S-curve multiplier crossing 50% power at the defined midpoint.

Property Type Required Default Description
steepness Float No 1.0 Multiplier controlling the gradient slope of the S-curve.
midpoint_ratio Float No 1.0 Fractional coordinate (0.0 to 1.0) defining the 50% power intersection point.
Codec
public static final MapCodec<SigmoidScalingFunction> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        Codec.FLOAT.optionalFieldOf(STEEPNESS, 1.0f).forGetter(SigmoidScalingFunction::steepness),
        Codec.FLOAT.optionalFieldOf(MIDPOINT_RATIO, 1.0f).forGetter(SigmoidScalingFunction::midpointRatio)
).apply(instance, SigmoidScalingFunction::new));
Template
{
  "type": "enchantment_core:sigmoid",
  "steepness": 1.0,
  "midpoint_ratio": 1.0
}

Spell Field Shapes

cube

Uniform box expanding equally in all axes.

Property Type Required Default Description
radius LevelBasedValue Yes - Extends the bounding box boundaries uniformly in all standard directions.
Codec
public static final MapCodec<CubeShape> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(RADIUS).forGetter(CubeShape::radius)
).apply(instance, CubeShape::new));
Template
{
  "type": "enchantment_core:cube",
  "radius": 5.0
}

cuboid

Box defining explicit bounds per axis.

Property Type Required Default Description
x_radius LevelBasedValue Yes - Extends the bounding box boundaries along the X-axis.
y_radius LevelBasedValue Yes - Extends the bounding box boundaries along the Y-axis.
z_radius LevelBasedValue Yes - Extends the bounding box boundaries along the Z-axis.
Codec
public static final MapCodec<CuboidShape> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(X_RADIUS).forGetter(CuboidShape::xRadius),
        LevelBasedValue.CODEC.fieldOf(Y_RADIUS).forGetter(CuboidShape::yRadius),
        LevelBasedValue.CODEC.fieldOf(Z_RADIUS).forGetter(CuboidShape::zRadius)
).apply(instance, CuboidShape::new));
Template
{
  "type": "enchantment_core:cuboid",
  "x_radius": 3.0,
  "y_radius": 2.0,
  "z_radius": 3.0
}

deep_cuboid

Box projecting forward along the caster's look direction.

Property Type Required Default Description
height_width_radius LevelBasedValue Yes - Extends boundaries perpendicular to the look vector.
depth_radius LevelBasedValue Yes - Extends boundaries parallel to the look vector.
Codec
public static final MapCodec<DeepCuboidShape> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(HEIGHT_WIDTH_RADIUS).forGetter(DeepCuboidShape::heightWidthRadius),
        LevelBasedValue.CODEC.fieldOf(DEPTH_RADIUS).forGetter(DeepCuboidShape::depthRadius)
).apply(instance, DeepCuboidShape::new));
Template
{
  "type": "enchantment_core:deep_cuboid",
  "height_width_radius": 2.0,
  "depth_radius": 5.0
}

wide_cuboid

Box extending laterally based on the caster's horizontal facing.

Property Type Required Default Description
height_depth_radius LevelBasedValue Yes - Extends boundaries vertically and parallel to the horizontal look vector.
width_radius LevelBasedValue Yes - Extends boundaries perpendicular to the horizontal look vector.
Codec
public static final MapCodec<WideCuboidShape> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(HEIGHT_DEPTH_RADIUS).forGetter(WideCuboidShape::heightDepthRadius),
        LevelBasedValue.CODEC.fieldOf(WIDTH_RADIUS).forGetter(WideCuboidShape::widthRadius)
).apply(instance, WideCuboidShape::new));
Template
{
  "type": "enchantment_core:wide_cuboid",
  "height_depth_radius": 2.0,
  "width_radius": 5.0
}

Block Effects

break_block

Destroys the targeted block.

Property Type Required Default Description
drop_resources Boolean No true Determines whether the broken block drops its item entity equivalent.
evaluator TopologyEvaluator No PROBABILISTIC Validates execution against topological probability scalars.
Codec
public static final MapCodec<BreakBlockEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        Codec.BOOL.optionalFieldOf(DROP_RESOURCES, true).forGetter(BreakBlockEffect::dropResources),
        TopologyEvaluator.CODEC.optionalFieldOf(EVALUATOR, TopologyEvaluator.PROBABILISTIC).forGetter(BreakBlockEffect::evaluator)
).apply(instance, BreakBlockEffect::new));
Template
{
  "type": "enchantment_core:break_block",
  "drop_resources": true,
  "evaluator": {}
}

ignite_block

Spawns a fire block at the target location.

Property Type Required Default Description
evaluator TopologyEvaluator No PROBABILISTIC Validates execution against topological probability scalars.
Codec
public static final MapCodec<IgniteBlockEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        TopologyEvaluator.CODEC.optionalFieldOf(EVALUATOR, TopologyEvaluator.PROBABILISTIC).forGetter(IgniteBlockEffect::evaluator)
).apply(instance, IgniteBlockEffect::new));
Template
{
  "type": "enchantment_core:ignite_block",
  "evaluator": {}
}

place_block

Places a block permanently.

Property Type Required Default Description
block Block Yes - The registry identifier of the block to place.
require_air Boolean No true Prevents placement if the target block state cannot be replaced.
evaluator TopologyEvaluator No PROBABILISTIC Validates execution against topological probability scalars.
Codec
public static final MapCodec<PlaceBlockEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        BuiltInRegistries.BLOCK.byNameCodec().fieldOf(BLOCK).forGetter(PlaceBlockEffect::block),
        Codec.BOOL.optionalFieldOf(REQUIRE_AIR, true).forGetter(PlaceBlockEffect::requireAir),
        TopologyEvaluator.CODEC.optionalFieldOf(EVALUATOR, TopologyEvaluator.PROBABILISTIC).forGetter(PlaceBlockEffect::evaluator)
).apply(instance, PlaceBlockEffect::new));
Template
{
  "type": "enchantment_core:place_block",
  "block": "minecraft:stone",
  "require_air": true,
  "evaluator": {}
}

place_temporary_block

Places a block that degrades back to its original state.

Property Type Required Default Description
block Block Yes - The registry identifier of the temporary block.
lifetime LevelBasedValue No 20.0 Duration in ticks the block remains stable before decay begins.
decay_duration LevelBasedValue No 20.0 Duration in ticks over which the block decays.
require_air Boolean No true Prevents placement if the target block state cannot be replaced.
restore_previous Boolean No true Restores the exact prior block state upon expiry instead of air.
evaluator TopologyEvaluator No PROBABILISTIC Validates execution against topological probability scalars.
Codec
public static final MapCodec<PlaceTemporaryBlockEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        BuiltInRegistries.BLOCK.byNameCodec().fieldOf(BLOCK).forGetter(PlaceTemporaryBlockEffect::block),
        LevelBasedValue.CODEC.optionalFieldOf(LIFETIME, LevelBasedValue.constant(20)).forGetter(PlaceTemporaryBlockEffect::lifetime),
        LevelBasedValue.CODEC.optionalFieldOf(DECAY_DURATION, LevelBasedValue.constant(20)).forGetter(PlaceTemporaryBlockEffect::decayDuration),
        Codec.BOOL.optionalFieldOf(REQUIRE_AIR, true).forGetter(PlaceTemporaryBlockEffect::requireAir),
        Codec.BOOL.optionalFieldOf(RESTORE_PREVIOUS, true).forGetter(PlaceTemporaryBlockEffect::restorePrevious),
        TopologyEvaluator.CODEC.optionalFieldOf(EVALUATOR, TopologyEvaluator.PROBABILISTIC).forGetter(PlaceTemporaryBlockEffect::evaluator)
).apply(instance, PlaceTemporaryBlockEffect::new));
Template
{
  "type": "enchantment_core:place_temporary_block",
  "block": "minecraft:stone",
  "lifetime": 20.0,
  "decay_duration": 20.0,
  "require_air": true,
  "restore_previous": true,
  "evaluator": {}
}

temporary_transmute_block

Converts specific blocks temporarily.

Property Type Required Default Description
target_blocks HolderSet<Block> No - Restricts the effect to specific block identifiers or tags.
replacement_block Block Yes - The registry identifier of the transmuted state.
lifetime LevelBasedValue No 20.0 Duration in ticks the transmuted block remains stable.
decay_duration LevelBasedValue No 20.0 Duration in ticks over which the block reverts to its original state.
evaluator TopologyEvaluator No PROBABILISTIC Validates execution against topological probability scalars.
Codec
public static final MapCodec<TemporaryTransmuteBlockEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        RegistryCodecs.homogeneousList(Registries.BLOCK).optionalFieldOf(TARGET_BLOCKS).forGetter(TemporaryTransmuteBlockEffect::targetBlocks),
        BuiltInRegistries.BLOCK.byNameCodec().fieldOf(REPLACEMENT_BLOCK).forGetter(TemporaryTransmuteBlockEffect::replacementBlock),
        LevelBasedValue.CODEC.optionalFieldOf(LIFETIME, LevelBasedValue.constant(20)).forGetter(TemporaryTransmuteBlockEffect::lifetime),
        LevelBasedValue.CODEC.optionalFieldOf(DECAY_DURATION, LevelBasedValue.constant(20)).forGetter(TemporaryTransmuteBlockEffect::decayDuration),
        TopologyEvaluator.CODEC.optionalFieldOf(EVALUATOR, TopologyEvaluator.PROBABILISTIC).forGetter(TemporaryTransmuteBlockEffect::evaluator)
).apply(instance, TemporaryTransmuteBlockEffect::new));
Template
{
  "type": "enchantment_core:temporary_transmute_block",
  "target_blocks": "minecraft:dirt",
  "replacement_block": "minecraft:stone",
  "lifetime": 20.0,
  "decay_duration": 20.0,
  "evaluator": {}
}

transmute_block

Converts specific blocks permanently.

Property Type Required Default Description
target_blocks HolderSet<Block> No - Restricts the effect to specific block identifiers or tags.
replacement_block Block Yes - The registry identifier of the transmuted state.
evaluator TopologyEvaluator No PROBABILISTIC Validates execution against topological probability scalars.
Codec
public static final MapCodec<TransmuteBlockEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        RegistryCodecs.homogeneousList(Registries.BLOCK).optionalFieldOf(TARGET_BLOCKS).forGetter(TransmuteBlockEffect::targetBlocks),
        BuiltInRegistries.BLOCK.byNameCodec().fieldOf(REPLACEMENT_BLOCK).forGetter(TransmuteBlockEffect::replacementBlock),
        TopologyEvaluator.CODEC.optionalFieldOf(EVALUATOR, TopologyEvaluator.PROBABILISTIC).forGetter(TransmuteBlockEffect::evaluator)
).apply(instance, TransmuteBlockEffect::new));
Template
{
  "type": "enchantment_core:transmute_block",
  "target_blocks": "minecraft:dirt",
  "replacement_block": "minecraft:stone",
  "evaluator": {}
}

burst_block

Spawns particles centered on the block.

Property Type Required Default Description
particle ParticleOptions Yes - The visual particle type to spawn.
count LevelBasedValue Yes - The quantity of particles spawned per burst.
speed LevelBasedValue Yes - The velocity multiplier applied to the spawned particles.
evaluator TopologyEvaluator No PROBABILISTIC Validates execution against topological probability scalars.
Codec
public static final MapCodec<BurstBlockVisualEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        ParticleTypes.CODEC.fieldOf(PARTICLE).forGetter(BurstBlockVisualEffect::particle),
        LevelBasedValue.CODEC.fieldOf(COUNT).forGetter(BurstBlockVisualEffect::count),
        LevelBasedValue.CODEC.fieldOf(SPEED).forGetter(BurstBlockVisualEffect::speed),
        TopologyEvaluator.CODEC.optionalFieldOf(EVALUATOR, TopologyEvaluator.PROBABILISTIC).forGetter(BurstBlockVisualEffect::evaluator)
).apply(instance, BurstBlockVisualEffect::new));
Template
{
  "type": "enchantment_core:burst_block",
  "particle": "minecraft:flame",
  "count": 10.0,
  "speed": 0.5,
  "evaluator": {}
}

play_sound_block

Triggers an audio event at the block coordinates.

Property Type Required Default Description
sound Holder<SoundEvent> Yes - The registry identifier for the audio event.
source SoundSource No players The audio channel routing the sound.
volume LevelBasedValue No 1.0 The amplitude multiplier of the played sound.
pitch LevelBasedValue No 1.0 The pitch modification applied to the audio event.
Codec
public static final MapCodec<PlaySoundBlockEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        BuiltInRegistries.SOUND_EVENT.holderByNameCodec().fieldOf(SOUND).forGetter(PlaySoundBlockEffect::sound),
        SOURCE_CODEC.optionalFieldOf(SOURCE, SoundSource.PLAYERS).forGetter(PlaySoundBlockEffect::source),
        LevelBasedValue.CODEC.optionalFieldOf(VOLUME, LevelBasedValue.constant(1.0F)).forGetter(PlaySoundBlockEffect::volume),
        LevelBasedValue.CODEC.optionalFieldOf(PITCH, LevelBasedValue.constant(1.0F)).forGetter(PlaySoundBlockEffect::pitch)
).apply(instance, PlaySoundBlockEffect::new));
Template
{
  "type": "enchantment_core:play_sound_block",
  "sound": "minecraft:block.stone.break",
  "source": "players",
  "volume": 1.0,
  "pitch": 1.0
}

Entity Effects

absolute_stasis

Nullifies delta movement and suspends fall damage.

Property Type Required Default Description
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<AbsoluteStasisEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        ContextAwarePredicate.CODEC.optionalFieldOf("entity_filter").forGetter(AbsoluteStasisEffect::entityFilter)
).apply(instance, AbsoluteStasisEffect::new));
Template
{
  "type": "enchantment_core:absolute_stasis",
  "entity_filter": {}
}

air_supply

Directly adds or subtracts oxygen ticks.

Property Type Required Default Description
amount LevelBasedValue Yes - Total oxygen ticks added or removed from the entity.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<AirSupplyEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(AMOUNT).forGetter(AirSupplyEffect::amount),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(AirSupplyEffect::entityFilter)
).apply(instance, AirSupplyEffect::new));
Template
{
  "type": "enchantment_core:air_supply",
  "amount": 10.0,
  "entity_filter": {}
}

apply_potion

Afflicts the entity with defined mob effects.

Property Type Required Default Description
potion_effects List<PotionPayload> Yes - Array defining the registry identifiers, durations, and amplifiers of effects.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<ApplyPotionEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        PotionPayload.CODEC.listOf().fieldOf(POTION_EFFECTS).forGetter(ApplyPotionEffect::potionEffects),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(ApplyPotionEffect::entityFilter)
).apply(instance, ApplyPotionEffect::new));
Template
{
  "type": "enchantment_core:apply_potion",
  "potion_effects": [],
  "entity_filter": {}
}

clear_effects

Subtracts duration from all active mob effects.

Property Type Required Default Description
duration_reduction LevelBasedValue Yes - Absolute tick value removed from the duration of all active effects.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<ClearEffectsEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(DURATION_REDUCTION).forGetter(ClearEffectsEffect::durationReduction),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(ClearEffectsEffect::entityFilter)
).apply(instance, ClearEffectsEffect::new));
Template
{
  "type": "enchantment_core:clear_effects",
  "duration_reduction": 100.0,
  "entity_filter": {}
}

damage_entity

Inflicts absolute damage via a specific damage type.

Property Type Required Default Description
damage_type ResourceKey Yes - The registry identifier of the specific damage type to apply.
amount LevelBasedValue Yes - Total absolute damage points inflicted.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<DamageEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        ResourceKey.codec(Registries.DAMAGE_TYPE).fieldOf(DAMAGE_TYPE).forGetter(DamageEffect::damageType),
        LevelBasedValue.CODEC.fieldOf(AMOUNT).forGetter(DamageEffect::amount),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(DamageEffect::entityFilter)
).apply(instance, DamageEffect::new));
Template
{
  "type": "enchantment_core:damage_entity",
  "damage_type": "minecraft:magic",
  "amount": 5.0,
  "entity_filter": {}
}

disarm

Forces the entity to drop equipped gear.

Property Type Required Default Description
drop_chance LevelBasedValue Yes - Probability threshold of a successful item drop.
slots List<EquipmentSlot> Yes - Array of valid equipment slots targeted for removal.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<DisarmEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(DROP_CHANCE).forGetter(DisarmEffect::dropChance),
        SLOT_CODEC.listOf().fieldOf(SLOTS).forGetter(DisarmEffect::slots),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(DisarmEffect::entityFilter)
).apply(instance, DisarmEffect::new));
Template
{
  "type": "enchantment_core:disarm",
  "drop_chance": 0.5,
  "slots": ["mainhand"],
  "entity_filter": {}
}

extinguish

Subtracts duration from active fire ticks.

Property Type Required Default Description
tick_reduction LevelBasedValue Yes - Absolute ticks removed from the entity's active fire timer.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<ExtinguishEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(TICK_REDUCTION).forGetter(ExtinguishEffect::tickReduction),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(ExtinguishEffect::entityFilter)
).apply(instance, ExtinguishEffect::new));
Template
{
  "type": "enchantment_core:extinguish",
  "tick_reduction": 100.0,
  "entity_filter": {}
}

heal

Restores raw health points.

Property Type Required Default Description
amount LevelBasedValue Yes - Total absolute health points restored.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<HealEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(AMOUNT).forGetter(HealEffect::amount),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(HealEffect::entityFilter)
).apply(instance, HealEffect::new));
Template
{
  "type": "enchantment_core:heal",
  "amount": 5.0,
  "entity_filter": {}
}

ignite

Inflicts fire for a specific duration.

Property Type Required Default Description
duration_seconds LevelBasedValue Yes - Sets the target entity on fire for the specified time in seconds.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<IgniteEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(DURATION_SECONDS).forGetter(IgniteEffect::durationSeconds),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(IgniteEffect::entityFilter)
).apply(instance, IgniteEffect::new));
Template
{
  "type": "enchantment_core:ignite",
  "duration_seconds": 5.0,
  "entity_filter": {}
}

impulse

Applies kinetic velocity along a designated axis.

Property Type Required Default Description
strength LevelBasedValue Yes - Velocity magnitude applied to the entity's delta movement.
direction FieldAxis No radial Vector logic determining the impulse heading relative to the epicenter.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<ImpulseEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(STRENGTH).forGetter(ImpulseEffect::strength),
        FieldAxis.CODEC.optionalFieldOf(DIRECTION).forGetter(ImpulseEffect::direction),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(ImpulseEffect::entityFilter)
).apply(instance, ImpulseEffect::new));
Template
{
  "type": "enchantment_core:impulse",
  "strength": 1.0,
  "direction": "radial",
  "entity_filter": {}
}

orbit

Locks the entity into a structured gravitational orbit.

Property Type Required Default Description
attraction_strength LevelBasedValue Yes - Force vector pulling the entity toward the orbital threshold.
orbital_radius LevelBasedValue Yes - Target distance from the epicenter the entity attempts to maintain.
orbit_velocity LevelBasedValue No 0.2 Tangential force pushing the entity along the rotation vector.
drag_multiplier LevelBasedValue No 0.8 Friction parameter dampening the entity's existing momentum.
distance_scaling DistanceScalingFunction No constant Algorithm determining force falloff based on the distance error to the radius.
axis FieldAxis No - Geometric plane locking the orbital rotation pattern. Defaults to chaotic spherical if absent.
rotation_direction RotationDirection No any Determines whether the orbit flows clockwise, counter-clockwise, or splits based on entity ID.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<OrbitEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(ATTRACTION_STRENGTH).forGetter(OrbitEffect::attractionStrength),
        LevelBasedValue.CODEC.fieldOf(ORBITAL_RADIUS).forGetter(OrbitEffect::orbitalRadius),
        LevelBasedValue.CODEC.optionalFieldOf(ORBIT_VELOCITY, LevelBasedValue.constant(0.2F)).forGetter(OrbitEffect::orbitVelocity),
        LevelBasedValue.CODEC.optionalFieldOf(DRAG_MULTIPLIER, LevelBasedValue.constant(0.8F)).forGetter(OrbitEffect::dragMultiplier),
        EnchantmentCoreRegistries.getDistanceScalingFunctionCodec().optionalFieldOf(DISTANCE_SCALING, ConstantScalingFunction.NONE).forGetter(OrbitEffect::distanceScaling),
        FieldAxis.CODEC.optionalFieldOf(AXIS).forGetter(OrbitEffect::axis),
        RotationDirection.CODEC.optionalFieldOf(ROTATION_DIRECTION, RotationDirection.ANY).forGetter(OrbitEffect::rotationDirection),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(OrbitEffect::entityFilter)
).apply(instance, OrbitEffect::new));
Template
{
  "type": "enchantment_core:orbit",
  "attraction_strength": 1.0,
  "orbital_radius": 3.0,
  "orbit_velocity": 0.2,
  "drag_multiplier": 0.8,
  "distance_scaling": {},
  "axis": "vertical",
  "rotation_direction": "any",
  "entity_filter": {}
}

random_teleport

Relocates the entity blindly within a radius.

Property Type Required Default Description
range LevelBasedValue Yes - Maximum coordinate distance evaluated for teleportation placement.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<RandomTeleportEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.fieldOf(RANGE).forGetter(RandomTeleportEffect::range),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(RandomTeleportEffect::entityFilter)
).apply(instance, RandomTeleportEffect::new));
Template
{
  "type": "enchantment_core:random_teleport",
  "range": 8.0,
  "entity_filter": {}
}

reset_lifetime

Resets item/experience despawn timers.

Property Type Required Default Description
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<ResetLifetimeEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        ContextAwarePredicate.CODEC.optionalFieldOf("entity_filter").forGetter(ResetLifetimeEffect::entityFilter)
).apply(instance, ResetLifetimeEffect::new));
Template
{
  "type": "enchantment_core:reset_lifetime",
  "entity_filter": {}
}

summon_entity

Spawns a secondary entity at the target's coordinates.

Property Type Required Default Description
entity_type EntityType Yes - The registry identifier of the entity class to spawn.
count LevelBasedValue No 1.0 Total quantity of entities generated.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<SummonEntityEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        BuiltInRegistries.ENTITY_TYPE.byNameCodec().fieldOf(ENTITY_TYPE).forGetter(SummonEntityEffect::entityType),
        LevelBasedValue.CODEC.optionalFieldOf(COUNT, LevelBasedValue.constant(1.0F)).forGetter(SummonEntityEffect::count),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(SummonEntityEffect::entityFilter)
).apply(instance, SummonEntityEffect::new));
Template
{
  "type": "enchantment_core:summon_entity",
  "entity_type": "minecraft:zombie",
  "count": 1.0,
  "entity_filter": {}
}

summon_lingering_potion

Spawns an area effect cloud at the entity.

Property Type Required Default Description
potion_effects List<PotionPayload> Yes - Array defining the registry identifiers, durations, and amplifiers of effects applied by the cloud.
cloud_radius LevelBasedValue Yes - Expanding bounds radius of the generated area effect cloud.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<SummonLingeringPotionEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        PotionPayload.CODEC.listOf().fieldOf(POTION_EFFECTS).forGetter(SummonLingeringPotionEffect::potionEffects),
        LevelBasedValue.CODEC.fieldOf(CLOUD_RADIUS).forGetter(SummonLingeringPotionEffect::cloudRadius),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(SummonLingeringPotionEffect::entityFilter)
).apply(instance, SummonLingeringPotionEffect::new));
Template
{
  "type": "enchantment_core:summon_lingering_potion",
  "potion_effects": [],
  "cloud_radius": 3.0,
  "entity_filter": {}
}

burst_entity

Emits visual particles from the entity center.

Property Type Required Default Description
particle ParticleOptions Yes - The visual particle type to spawn.
count LevelBasedValue Yes - The quantity of particles spawned per burst.
speed LevelBasedValue Yes - The velocity multiplier applied to the spawned particles.
Codec
public static final MapCodec<BurstEntityVisualEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        ParticleTypes.CODEC.fieldOf(PARTICLE).forGetter(BurstEntityVisualEffect::particle),
        LevelBasedValue.CODEC.fieldOf(COUNT).forGetter(BurstEntityVisualEffect::count),
        LevelBasedValue.CODEC.fieldOf(SPEED).forGetter(BurstEntityVisualEffect::speed)
).apply(instance, BurstEntityVisualEffect::new));
Template
{
  "type": "enchantment_core:burst_entity",
  "particle": "minecraft:flame",
  "count": 10.0,
  "speed": 0.1
}

play_sound_entity

Triggers an audio event tracked to the entity.

Property Type Required Default Description
sound Holder<SoundEvent> Yes - The registry identifier for the audio event.
source SoundSource No players The audio channel routing the sound.
volume LevelBasedValue No 1.0 The amplitude multiplier of the played sound.
pitch LevelBasedValue No 1.0 The pitch modification applied to the audio event.
Codec
public static final MapCodec<PlaySoundEntityEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        BuiltInRegistries.SOUND_EVENT.holderByNameCodec().fieldOf(SOUND).forGetter(PlaySoundEntityEffect::sound),
        SOURCE_CODEC.optionalFieldOf(SOURCE, SoundSource.PLAYERS).forGetter(PlaySoundEntityEffect::source),
        LevelBasedValue.CODEC.optionalFieldOf(VOLUME, LevelBasedValue.constant(1.0F)).forGetter(PlaySoundEntityEffect::volume),
        LevelBasedValue.CODEC.optionalFieldOf(PITCH, LevelBasedValue.constant(1.0F)).forGetter(PlaySoundEntityEffect::pitch)
).apply(instance, PlaySoundEntityEffect::new));
Template
{
  "type": "enchantment_core:play_sound_entity",
  "sound": "minecraft:entity.generic.explode",
  "source": "players",
  "volume": 1.0,
  "pitch": 1.0
}

Volume Effects

explode

Computes and spawns an explosion payload at the target.

Property Type Required Default Description
explosion ExplosionDefinition Yes - The internal parameter object tracking damage limits, radius, and block interactions.
count LevelBasedValue No 1.0 The amount of distinct explosions evaluated.
fuse_ticks LevelBasedValue No 0.0 Execution delay timer for the blast.
fuse_variance LevelBasedValue No 0.0 Random temporal variance applied to the fuse.
spatial_delay LevelBasedValue No 0.0 Temporal delay parameter offset explicitly by the distance from the epicenter.
distribution ProbabilityDistribution No - Defines randomized spatial sampling bounds. Falls back to uniform distribution if omitted.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<ExplodeEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        ExplosionDefinition.CODEC.fieldOf(EXPLOSION).forGetter(ExplodeEffect::explosion),
        LevelBasedValue.CODEC.optionalFieldOf(COUNT, LevelBasedValue.constant(1.0F)).forGetter(ExplodeEffect::count),
        LevelBasedValue.CODEC.optionalFieldOf(FUSE_TICKS, LevelBasedValue.constant(0.0F)).forGetter(ExplodeEffect::fuseTicks),
        LevelBasedValue.CODEC.optionalFieldOf(FUSE_VARIANCE, LevelBasedValue.constant(0.0F)).forGetter(ExplodeEffect::fuseVariance),
        LevelBasedValue.CODEC.optionalFieldOf(SPATIAL_DELAY, LevelBasedValue.constant(0.0F)).forGetter(ExplodeEffect::spatialDelay),
        ProbabilityDistribution.CODEC.optionalFieldOf(DISTRIBUTION).forGetter(ExplodeEffect::distribution),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(ExplodeEffect::entityFilter)
).apply(instance, ExplodeEffect::new));
Template
{
  "type": "enchantment_core:explode",
  "explosion": {},
  "count": 1.0,
  "fuse_ticks": 0.0,
  "fuse_variance": 0.0,
  "spatial_delay": 0.0,
  "distribution": {},
  "entity_filter": {}
}

lightning_strike

Spawns a lightning bolt at the targeted location.

Property Type Required Default Description
count LevelBasedValue No 1.0 Total lightning strikes generated.
delay_ticks LevelBasedValue No 0.0 Execution delay timer for the strike.
delay_variance LevelBasedValue No 0.0 Random temporal variance applied to the delay.
visual_only Boolean No false Nullifies block destruction and entity damage outputs from the bolt.
distribution ProbabilityDistribution No - Defines randomized spatial sampling bounds. Falls back to uniform distribution if omitted.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<LightningStrikeEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        LevelBasedValue.CODEC.optionalFieldOf(COUNT, LevelBasedValue.constant(1.0F)).forGetter(LightningStrikeEffect::count),
        LevelBasedValue.CODEC.optionalFieldOf(DELAY_TICKS, LevelBasedValue.constant(0.0F)).forGetter(LightningStrikeEffect::delayTicks),
        LevelBasedValue.CODEC.optionalFieldOf(DELAY_VARIANCE, LevelBasedValue.constant(0.0F)).forGetter(LightningStrikeEffect::delayVariance),
        Codec.BOOL.optionalFieldOf(VISUAL_ONLY, false).forGetter(LightningStrikeEffect::visualOnly),
        ProbabilityDistribution.CODEC.optionalFieldOf(DISTRIBUTION).forGetter(LightningStrikeEffect::distribution),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(LightningStrikeEffect::entityFilter)
).apply(instance, LightningStrikeEffect::new));
Template
{
  "type": "enchantment_core:lightning_strike",
  "count": 1.0,
  "delay_ticks": 0.0,
  "delay_variance": 0.0,
  "visual_only": false,
  "distribution": {},
  "entity_filter": {}
}

surface_hazard

Spawns a hazard tracking the highest block surface near the target.

Property Type Required Default Description
entity_type EntityType Yes - Registry identifier of the hazard spawned (e.g., Evoker Fangs).
count LevelBasedValue No 1.0 Total hazards generated per evaluation.
vertical_search LevelBasedValue No 5.0 Extends the Y-axis validation check bounds tracking viable surface terrain.
distribution ProbabilityDistribution No - Defines randomized spatial sampling bounds. Falls back to uniform distribution if omitted.
entity_filter ContextPredicate No - Evaluates the target entity against loot context parameters.
Codec
public static final MapCodec<SurfaceHazardEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        BuiltInRegistries.ENTITY_TYPE.byNameCodec().fieldOf(ENTITY_TYPE).forGetter(SurfaceHazardEffect::entityType),
        LevelBasedValue.CODEC.optionalFieldOf(COUNT, LevelBasedValue.constant(1.0F)).forGetter(SurfaceHazardEffect::count),
        LevelBasedValue.CODEC.optionalFieldOf(VERTICAL_SEARCH, LevelBasedValue.constant(5.0F)).forGetter(SurfaceHazardEffect::verticalSearch),
        ProbabilityDistribution.CODEC.optionalFieldOf(DISTRIBUTION).forGetter(SurfaceHazardEffect::distribution),
        ContextAwarePredicate.CODEC.optionalFieldOf(ENTITY_FILTER).forGetter(SurfaceHazardEffect::entityFilter)
).apply(instance, SurfaceHazardEffect::new));
Template
{
  "type": "enchantment_core:surface_hazard",
  "entity_type": "minecraft:evoker_fangs",
  "count": 1.0,
  "vertical_search": 5.0,
  "distribution": {},
  "entity_filter": {}
}

play_sound_volume

Triggers a global audio event at the volume epicenter.

Property Type Required Default Description
sound Holder<SoundEvent> Yes - The registry identifier for the audio event.
source SoundSource No players The audio channel routing the sound.
volume LevelBasedValue No 1.0 The amplitude multiplier of the played sound.
pitch LevelBasedValue No 1.0 The pitch modification applied to the audio event.
Codec
public static final MapCodec<PlaySoundVolumeEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        BuiltInRegistries.SOUND_EVENT.holderByNameCodec().fieldOf(SOUND).forGetter(PlaySoundVolumeEffect::sound),
        SOURCE_CODEC.optionalFieldOf(SOURCE, SoundSource.PLAYERS).forGetter(PlaySoundVolumeEffect::source),
        LevelBasedValue.CODEC.optionalFieldOf(VOLUME, LevelBasedValue.constant(1.0F)).forGetter(PlaySoundVolumeEffect::volume),
        LevelBasedValue.CODEC.optionalFieldOf(PITCH, LevelBasedValue.constant(1.0F)).forGetter(PlaySoundVolumeEffect::pitch)
).apply(instance, PlaySoundVolumeEffect::new));
Template
{
  "type": "enchantment_core:play_sound_volume",
  "sound": "minecraft:entity.generic.explode",
  "source": "players",
  "volume": 1.0,
  "pitch": 1.0
}

Visual Effects

ambient_field

Spawns randomly distributed particles within the volume boundaries.

Property Type Required Default Description
particle ParticleOptions Yes - The visual particle type to spawn.
count LevelBasedValue Yes - The quantity of particles spawned.
speed LevelBasedValue Yes - The scalar applied against random velocity axes per particle.
distribution ProbabilityDistribution Yes - Configures sampling coordinates utilized by the particle generator.
Codec
public static final MapCodec<AmbientFieldVisualEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        ParticleTypes.CODEC.fieldOf(PARTICLE).forGetter(AmbientFieldVisualEffect::particle),
        LevelBasedValue.CODEC.fieldOf(COUNT).forGetter(AmbientFieldVisualEffect::count),
        LevelBasedValue.CODEC.fieldOf(SPEED).forGetter(AmbientFieldVisualEffect::speed),
        ProbabilityDistribution.CODEC.fieldOf(DISTRIBUTION).forGetter(AmbientFieldVisualEffect::distribution)
).apply(instance, AmbientFieldVisualEffect::new));
Template
{
  "type": "enchantment_core:ambient_field",
  "particle": "minecraft:flame",
  "count": 10.0,
  "speed": 0.1,
  "distribution": {}
}

vector_field

Spawns particles traversing along explicit topological axes.

Property Type Required Default Description
particle ParticleOptions Yes - The visual particle type to spawn.
count LevelBasedValue Yes - The quantity of particles spawned.
speed LevelBasedValue Yes - The magnitude applied to the resolved vector driving the particle.
axis FieldAxis No - Explicit geometry aligning the particle movement. Falls back to field axes if absent.
distribution ProbabilityDistribution Yes - Configures sampling coordinates utilized by the particle generator.
Codec
public static final MapCodec<VectorFieldVisualEffect> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
        ParticleTypes.CODEC.fieldOf(PARTICLE).forGetter(VectorFieldVisualEffect::particle),
        LevelBasedValue.CODEC.fieldOf(COUNT).forGetter(VectorFieldVisualEffect::count),
        LevelBasedValue.CODEC.fieldOf(SPEED).forGetter(VectorFieldVisualEffect::speed),
        FieldAxis.CODEC.optionalFieldOf(AXIS).forGetter(VectorFieldVisualEffect::axis),
        ProbabilityDistribution.CODEC.fieldOf(DISTRIBUTION).forGetter(VectorFieldVisualEffect::distribution)
).apply(instance, VectorFieldVisualEffect::new));
Template
{
  "type": "enchantment_core:vector_field",
  "particle": "minecraft:flame",
  "count": 10.0,
  "speed": 0.1,
  "axis": "radial",
  "distribution": {}
}

Clone this wiki locally