Deprecations - TheComputerGeek2/MagicSpells GitHub Wiki

Table of Contents

Introduction

A feature is deprecated when its use is heavily discouraged. Deprecations are usually issued because the feature is poorly implemented, and are generally accompanied with a better alternative. Deprecated features may be removed in future releases, after adequate time is given to migrate away from their use.

Bukkit Damage Causes

Many deprecated spell options reference Bukkit damage causes, as listed here. Bukkit damage causes are a legacy representation of Minecraft's base damage types. These damage causes do not properly align with Minecraft's damage type system; multiple damage types can be represented as a single damage cause, or have no corresponding damage cause. Additionally, they cannot represent data-driven damage types added by datapacks and plugins.

Some spell classes that deal damage, such as .targeted.PainSpell, have options to specify a Bukkit damage cause. These options do not work properly, as there is no mechanism to damage with a provided Bukkit damage cause. Instead, these spell classes fire a fake damage event with the provided damage cause prior to dealing damage. An event is used to notify plugins that an action is being performed - for example, an event is fired whenever an entity takes damage. Firing an event does not perform the action; in firing a fake damage event, these spell classes cause a variety of issues with plugins listening to these events, including MagicSpells. For example, .targeted.PainSpell can cause a givedamage passive trigger to fire multiple times - first with the damage cause specified by the PainSpell's damage-type option, and again when the damage is actually dealt, which will always be with the ENTITY_ATTACK damage cause.

As such, all options relying on Bukkit damage causes are deprecated.

Deprecations by Spell

Option Reason Replacement
damage-causes Relies on Bukkit damage causes. Use the damage-types option.
Option Reason Replacement
normal-damage-types Relies on Bukkit damage causes. Use the damage-types option.
Option Reason Replacement
damage-type Relies on Bukkit damage causes. Use the .targeted.DamageSpell and .targeted.LoopSpell spell classes.
Option Reason Replacement
health drain type Relies on Bukkit damage causes. Use the health_points drain type.[1]
  1. Prior to Beta 17, health had been the default drain type. As of Beta 17, health_points has become the default; as the option does not respect the damage-type and ignore-armor options, the drain-damage-type option should be used to replace them.
Option Reason Replacement
damage-type Relies on Bukkit damage causes. Use the .targeted.DamageSpell spell class.

Passive Triggers

Passive Trigger Reason Replacement
fataldamage Relies on Bukkit damage causes, and can be inaccurate.[1] Use the damage[2] or death passive triggers.
givedamage Relies on Bukkit damage causes. Use the damage passive trigger with mode: give.
takedamage Relies on Bukkit damage causes. Use the damage passive trigger with mode: take.
  1. A variety of factors can the trigger to not fire, or to fire erroneously.
  2. The damage passive trigger has a minimum-damage option that can simulate the fataldamage passive trigger with variable replacement; this can only currently be used for players.

Magic without writing Java

This is just some padding so that the header linking experience is better.

MagicSpells Icon
⚠️ **GitHub.com Fallback** ⚠️