Spell Filter - TheComputerGeek2/MagicSpells GitHub Wiki

Description:

  • The Spell Filter is used to refer to a group of spells. If the filter is empty, all spells pass it.
  • The reference of spell tags below refers to a general spell option tags which can be a list of strings (e.g. tags: ["Admin"]).
  • All spells have predefined tags (e.g. for .instant.BeamSpell):
    • spell-class:com.nisovin.magicspells.spells.instant.BeamSpell
    • spell-package:com.nisovin.magicspells.spells. + instant/targeted/etc.
    • Since 4.0 Beta 17: magicspells:beneficial - for spells configured with beneficial: true
    • Since 4.0 Beta 17: magicspells:helper-spell - for spells configured with helper-spell: true
  • The filter does not support Expressions from 4.0 Beta 13.

Config:

Option Description
spells List of spells the filter will include, ignoring other spells.
denied-spells List of spells not included in the filter.
spell-tags List of spell tags the filter will include, ignoring other tags.
denied-spell-tags List of spell tags not included.

Legacy String:

  • Follows the format: "allowedSpell,!disallowedSpell,tag:allowedTag,!tag:disallowedTag".
  • Since 4.0 Beta 13, you may use # instead of tag: to denote a tag. E.g. "allowedSpell,!disallowedSpell,#allowedTag,!#disallowedTag".
  • Since 4.0 Beta 14, you may use * for the entire filter to allow all spells, but an empty string filter can achieve the same effect.
  • Since 4.0 Beta 17, you can use the new String Spell Filter format instead.

String:

Note

Since 4.0 Beta 17.

  • Aside from using * to match all spells, you can select a specific spell by its name (e.g. spell_name) or a group of spells by one of their tags, starting with # (e.g. #tag).
  • You can refine the selection with logical operators (e.g. spell_name & #tag):
    • And (&) - Select spells that match both conditions.
    • Or (|) - Select spells that match either condition.
    • XOR (^) - Select spells that match only one of the conditions.
  • Prefix an expression with ! to exclude spells that match it.
  • You can use parentheses to group expressions. All the above operators can be applied to groups too to craft more complex filters:
(#water | #earth | #fire | #air) & !(#novice | #advanced)

Magic without writing Java

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

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