adibarra/enchant-tweaker

feat: Multiplicative Blast Protection

Opened this issue · 0 comments

What does it do?

When Multiplicative Blast Protection is enabled, instead of Blast Protection reducing knockback from explosions by (15 × level)% in a linear fashion, each level of the enchantment multiplies the knockback by 0.85.

In other words, the vanilla formula of the Blast Protection enchantment, $$y = 1 - 0.15 \times \text{level}$$ is replaced with the multiplicative formula $$y = 0.85^{\text{level}}$$ where $y$ is the multiplier to explosion knockback from the Blast Protection enchantment and $\text{level}$ is the sum of the levels of the Blast Protection enchantments on the player's armor.

With Blast Protection IV on 1 piece, the pre-1.21 vanilla effect is maxed out with an explosion knockback multiplier of $1 - 0.15 \times 4 = 0.40$, equivalent to a 60% reduction, while the proposed formula multiplies explosion knockback by $0.85^4 \approx 0.52$, equivalent to a 48% reduction.

With Blast Protection IV on 2 pieces, the post-1.21 vanilla effect is maxed out with an explosion knockback multiplier of $1 - 0.15 \times 8 = -0.20$, making the player immune to knockback from explosions, while the proposed formula multiplies explosion knockback by $0.85^8 \approx 0.27$, equivalent to a 73% reduction.

Why add it?

The multiplicative formula allows Blast Protection to be extended to higher levels beyond the vanilla limits while still keeping most of the vanilla effect at lower levels. If Blast Protection scaled linearly and was uncapped, the multiplier to knockback from explosions would drop below 0 with 7 levels of Blast Protection or more, making the entity unable to be thrown about by explosions. With this change, equipping a full set of Blast Protection IV and getting blown up by many creepers or TNT at once should still launch the player several blocks in the air and/or horizontally.

Anything else?

See also #14.

Before submitting...

  • This issue is not a duplicate of an existing issue (open or closed).