Skip to content

Instantly share code, notes, and snippets.

@JasperLorelai
JasperLorelai / MagicSpellsAPI.java
Last active April 9, 2024 20:58
The class below simplifies the MagicSpells API into just a few lines of code. If you'd like to use it, you can copy-paste the class in your plugin. Remember that in order to use the MagicSpells API at all, you need to "soft depend" MagicSpells.
package com.jasperlorelai.cerberus.util;
import java.util.Map;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.bukkit.event.Listener;
import org.bukkit.event.EventHandler;
@JasperLorelai
JasperLorelai / changelog-beta-11.md
Last active August 29, 2022 17:39
MagicSpells Changelog - Beta 11
  • Updated to 1.18.2.
  • You can use the MiniMessage format in places like str- messages, magic items (names, lore, book pages), conjure book, etc. https://docs.adventure.kyori.net/minimessage/
  • Added Loop spell - an official replacement for the traditional "multi-loop" concept.
  • Added loopactive (loopSpell) and ownedloopactive (loopSpell) modifier conditions.
  • Cleanse spell supports loop:(loopSpell) prefix in the remove property.
  • Added spell-on-entity-location to Beam, Bow, and Projectile spells.
  • Added targetedblock.x, targetedblock.y, targetedblock.z (eye location) data elements to Data spell.
  • Added force property to particle spell effects.
  • Added str-on-teach for spells.
  • For the Glow spell: removed client-side, added visible-to-everyone" and visible-to-caster.

(required) & [optional]

Placeholder Description
<var:[target,caster,name,uuid]:(varName):[max,min]:[precision]> Variable
<arg:(index):[defaultValue]> Spell argumnent
<papi:[caster,target,name,uuid]:(placeholder)> Papi placeholder
<data:[caster,target,name,uuid]:(dataElement)> Data elements
<cooldown:[caster,target,name,uuid]:(spell):[now]:[precision]> Cooldown
`` Spell Charges

Changes:

  • This version supports PaperMC 1.19 through 1.20.1.
  • Changed the default value of pass-targeting on TargetedMultiSpell, AreaEffectSpell, and LoopSpell to false, matching old behaviour.
  • Fixed an issue where the hit-radius and vertical-hit-radius of ParticleProjectileSpell were halved when hitting entities. IMPORTANT: divide those values in your configurations by 2. Tony made a tool for this here.
  • Optimised Nova spell/effect.
  • WindwalkSpell now restores flight states after ending.
  • Revert variable replacement support for the types list for NovaEffect till it's fixed.
  • Buff passive trigger is now consistent with its description. spells no longer only casts buff spells.
  • entity effect can now play at spell locations.
  • The subspell options delay, chance, power and args now support GVR. Additionally, arguments are now passed to subspell casts, allowing for argument replacement.
  • fataldamage now supports damage causes in TriggerVar, separated by |
  • lightlevel condition now supports optional light type - type;=15. type can be all(default),skyorblock`.
  • In variable-mods-target the player whose variable is modified is the target's by default. You can now change this by using: caster:varName =<varMod>
  • Added ignore-radius: false to AreaEffect spells. When true, it makes the AOE target all entities.
  • Added blockbreak location spell effect (block break cracking), with range: 32 (display range), and stage: 1 (0-10)
  • All custom recipe ingredient options are no longer limited to material names. They may be singular or a list of material tags or magic items in a string, or configuration section format.
  • %a and %t can now be used in areas that use config data string replacement.
  • The %t placeholder will now use an entity's name instead of unknown when its type isn'

Changes:

  • Added 1.20.2-1.20.4 support.

  • Added min-horizontal-radius and min-vertical-radius to the AreaEffect spell.

  • Placeholders %a and %t now prioritise returning the non-player entity's display name before its configured name from entity-names in general.yml.

  • Added lastdamagecause.attacker data element returning its display name.

  • moonphase condition now accepts PaperMC's moon phases. Legacy grouped phases are still supported: fullwaningnewwaxing.

  • string modifier action now supports string expressions.

  • Added meta_forwards_movement and meta_sideways_movement meta variables.

Bugfixes:

  • Fixed console command completion for some commands.
  • Fixed showing mana on the food bar so that food changes are fake and food levels aren't modified.
  • Fixed modifying global variables without a player.
  • Fixed RepairSpell saving the repaired chestplate into the helmet slot.
  • Fixed an issue that caused targeting to fail on players if can-target was not specified.
  • Fixed SilenceSpell overriding its targeting to always target players.
  • Fixed an issue that caused invalid entries in remove on CleanseSpell to cause an error.
  • Fixed NPE (error) caused by FlightPathSpell option land-spell not being specified.
variables:
protego_diabolica_target_x:
type: playerstring
protego_diabolica_target_z:
type: playerstring
protego_diabolica_radius:
type: player
protego_diabolica_rotate_loop:
spell-class: ".targeted.LoopSpell"

Note

  • 4.0 Beta 14 only supports 1.20.4.
  • All changes are already on the Wiki

Table Of Contents: