Skip to main content
More RPG Library provides 14 custom spell impact handlers that enable advanced mechanics not available in base Spell Engine. These impacts handle movement, knockback, crowd control, and special damage calculations.

Adding Custom Impacts to Spells

Use the CUSTOM impact type with the specific handler identifier:
{
  "impacts": [
    {
      "action": {
        "type": "CUSTOM",
        "custom": {
          "intent": "HARMFUL",
          "handler": "more_rpg_classes:knock_up_fixed"
        }
      }
    }
  ]
}

Knockback & Displacement

Knock Up

Knocks the target upward with scalable height.Handler: more_rpg_classes:knock_upIntent: HARMFULScaling: Configurable height multiplier

Knock Up (Fixed)

Knocks the target upward with a fixed height of 0.75 Y-velocity.Handler: more_rpg_classes:knock_up_fixedIntent: HARMFULAdditional: Applies 20 ticks of Slow Falling

Range Scaled Knockback

Knockback that increases the closer the target is to the caster.Handler: more_rpg_classes:range_scaled_knockbackIntent: HARMFULScaling: Inverse distance scaling

Trembling

Throws the target around in random directions.Handler: more_rpg_classes:tremblingIntent: HARMFULEffect: Chaotic multi-directional knockback

Knock Up Fixed Implementation

@Override
public SpellHandlers.ImpactResult onSpellImpact(
    RegistryEntry<Spell> spell,
    SpellPower.Result powerResult,
    LivingEntity caster,
    Entity target,
    SpellHelper.ImpactContext context
) {
    if (!(target instanceof LivingEntity)) return null;

    ((LivingEntity) target).addStatusEffect(
        new StatusEffectInstance(StatusEffects.SLOW_FALLING, 20, 0, false, false, false)
    );
    Vec3d velocity = target.getVelocity();
    target.setVelocity(velocity.x, 0.0, velocity.z);
    target.addVelocity(0.0, base, 0.0);
    target.velocityModified = true;

    return new SpellHandlers.ImpactResult(true, false);
}

Pull Mechanics

Pull to Caster (Direct)

Instantly pulls the target directly in front of the caster.Handler: more_rpg_classes:pull_to_caster_directIntent: HARMFULUse Case: Execute abilities, melee gap closers

Pull to Caster (Slow)

Slowly pulls the target toward the caster over time.Handler: more_rpg_classes:pull_to_caster_slowIntent: HARMFULUse Case: Channeled spells, sustained CC
Pull impacts are ideal for creating crowd control chains or setting up combos with melee abilities.

Dash & Movement

Forward Dash (Range)

The caster dashes forward based on spell range value.Handler: more_rpg_classes:forward_dash_rangeIntent: N/A (movement)Scaling: Uses range value from spell.json

Backward Dash (Fixed)

The caster dashes backward for a fixed distance.Handler: more_rpg_classes:backward_dash_fixedIntent: N/A (movement)Use Case: Escape abilities, kiting

Backward Dash (Range)

The caster dashes backward based on spell range value.Handler: more_rpg_classes:backward_dash_rangeIntent: N/A (movement)Scaling: Uses range value from spell.json

Rush Forward to Target

The caster rapidly travels forward to the target’s location.Handler: more_rpg_classes:rush_forward_to_targetIntent: N/A (movement)Use Case: Charge abilities, gap closers

Range-Based Dash Example

{
  "range": 10,
  "impacts": [
    {
      "action": {
        "type": "CUSTOM",
        "custom": {
          "handler": "more_rpg_classes:forward_dash_range"
        }
      }
    }
  ]
}
Use forward_dash_range and backward_dash_range with different spell range values to create varied mobility abilities from the same impact handler.

Special Mechanics

Lightning Strike

Summons a friendly lightning entity that won’t damage allies or set fires.Handler: more_rpg_classes:lightningIntent: HARMFULSpecial: Server-side only, spawns at target’s block position

Stop Arrows

Checks for arrows near the target and sets their velocity to 0.Handler: more_rpg_classes:stop_arrowsIntent: N/A (utility)Use Case: Defensive abilities, arrow shields

Frozen Ticks

Adds frozen entity ticks to the target.Handler: more_rpg_classes:frozen_ticksIntent: HARMFULUse Case: Frost-themed crowd control

Lightning Strike Implementation

@Override
public SpellHandlers.ImpactResult onSpellImpact(
    RegistryEntry<Spell> spell,
    SpellPower.Result powerResult,
    LivingEntity caster,
    Entity target,
    SpellHelper.ImpactContext context
) {
    if(target instanceof LivingEntity livingEntity && 
       livingEntity.getWorld() instanceof ServerWorld serverWorld){
        // Spawn the friendly lightning entity
        FriendlyLightningEntity.spawnAtBlock(
            serverWorld,
            livingEntity.getBlockPos(),
            caster,
            MRPGCEntities.FRIENDLY_LIGHTNING
        );
    }
    return new SpellHandlers.ImpactResult(true, false);
}

Advanced Damage

Damage According to Missing Health

Deals damage based on target’s missing health percentage with spell power scaling.Handler: more_rpg_classes:damage_according_to_missing_healthIntent: HARMFULDamage Formula: School Attribute × Missing Health MultiplierMultipliers:
  • Above 50% HP: 0.25×
  • Below 50% HP: 1.0×
  • Below 25% HP: 1.75×

Missing Health Damage Implementation

@Override
public SpellHandlers.ImpactResult onSpellImpact(
    RegistryEntry<Spell> spell,
    SpellPower.Result powerResult,
    LivingEntity caster,
    Entity target,
    SpellHelper.ImpactContext context
) {
    if (target instanceof LivingEntity livingEntity) {
        float missinghealth = (livingEntity.getHealth() - livingEntity.getMaxHealth()) 
            / livingEntity.getMaxHealth();
        float damageMultiplier = MRPGCMod.tweaksConfig.value
            .custom_spell_impact_damage_to_missing_health_above_50;
        if(missinghealth >= 0.5F){
            damageMultiplier = MRPGCMod.tweaksConfig.value
                .custom_spell_impact_damage_to_missing_health_under_50;
        } else if(missinghealth >= 0.25F){
            damageMultiplier = MRPGCMod.tweaksConfig.value
                .custom_spell_impact_damage_to_missing_health_under_25;
        }
        float schoolAttributeValue = (float) caster.getAttributeValue(
            spell.value().school.attributeEntry
        );
        livingEntity.timeUntilRegen = 0;
        livingEntity.damage(
            SpellDamageSource.create(spell.value().school, caster), 
            schoolAttributeValue * damageMultiplier
        );
    }
    return new SpellHandlers.ImpactResult(true, false);
}
The missing health damage impact is extremely powerful as an execute ability. The damage can increase by up to 7× between full health and low health targets.

Complete Impact List

Handler IDTypeDescription
knock_upKnockbackScalable upward knockback
knock_up_fixedKnockbackFixed 0.75 Y-velocity knock up
range_scaled_knockbackKnockbackStronger knockback at close range
tremblingKnockbackRandom directional knockback
pull_to_caster_directPullInstant pull to caster
pull_to_caster_slowPullGradual pull over time
forward_dash_rangeMovementForward dash scaled by spell range
backward_dash_fixedMovementFixed backward dash
backward_dash_rangeMovementBackward dash scaled by spell range
rush_forward_to_targetMovementFast travel to target
lightningSpecialSummon friendly lightning
stop_arrowsUtilityFreeze arrow velocity
frozen_ticksCCAdd frozen entity ticks
damage_according_to_missing_healthDamageExecute-style damage

Combining Multiple Impacts

You can combine custom impacts with standard Spell Engine impacts:
{
  "impacts": [
    {
      "action": "DAMAGE",
      "damage": 5
    },
    {
      "action": {
        "type": "CUSTOM",
        "custom": {
          "intent": "HARMFUL",
          "handler": "more_rpg_classes:knock_up_fixed"
        }
      }
    },
    {
      "action": "STATUS_EFFECT",
      "effect": {
        "effect_id": "more_rpg_classes:frozen_solid",
        "duration": 60,
        "amplifier": 0
      }
    }
  ]
}
Combo Potential: Chain impacts to create complex spell effects:
  • pull_to_caster_directknock_up_fixed → melee attack combo
  • backward_dash_range → arrow volley for kiting
  • rush_forward_to_target → AoE damage for gap-closer abilities
  • damage_according_to_missing_healthlightning for execute finishers

Configuration

Some impacts have configurable values in the mod’s config file:
  • custom_spell_fixed_impact_knock_up - Y-velocity for fixed knock up (default: 0.75)
  • custom_spell_impact_damage_to_missing_health_above_50 - Multiplier above 50% HP (default: 0.25)
  • custom_spell_impact_damage_to_missing_health_under_50 - Multiplier below 50% HP (default: 1.0)
  • custom_spell_impact_damage_to_missing_health_under_25 - Multiplier below 25% HP (default: 1.75)
All custom spell impacts are registered and available immediately after mod initialization. See the source files in net.more_rpg_classes.custom.spell_impacts for implementation details.