-
Notifications
You must be signed in to change notification settings - Fork 72
Magic Items
- Predefined Magic Items can be defined in any spell file, but they can also be defined in
general.yml. This lets you use the same item configuration in multiple places throughout the plugin without having to write the same full item multiple times. - You can pre-define them under the
magic-itemsconfiguration section:
magic-items:
<internal name>: . . .
. . .- Aside from spells like
ConjureSpell, you can give yourself predefined magic items using the/ms magicitemcommand. - You can define them with:
magic-items:
golden_stick: 'stick{name: "<gold>Golden Stick"}'magic-items:
golden_stick:
type: stick
name: "<gold>Golden Stick"
# . . .The following section configures how item matching behaves for Magic Items in places such as modifier conditions and passive triggers. Cast items don't rely on the following options - instead, their matching is configured globally.
Options that have been explicitly defined by you in the config (and in the case of lists, not empty) are used when comparing an item matches a Magic Item. If the item has an item component that differs from what is defined in an option, the item does not match the magic item.
See:
Options listed in ignored-attributes are ignored in this comparison. For example, the following item would match any stone sword with 20 durability damage, ignoring any other attribute.
magic-items:
broken-sword:
type: "stone_sword"
durability: 20However, the following would match any sword, regardless of durability.
magic-items:
broken-sword:
type: "stone_sword"
durability: 20
ignored-attributes:
- durabilitySimilar to ignored-attributes, except that any option defined in blacklisted-attributes is not allowed to exist on an item when it is compared to a magic item. For example, the following would match any redstone item, regardless of name, lore or enchantments.
magic-items:
redstone-cost:
type: "redstone"However, the following would only match redstone items that do not have a custom name, lore or enchantments.
magic-items:
redstone-cost:
type: "redstone"
blacklisted-attributes:
- name
- lore
- enchantsNote
Since 4.0 Beta 13.
When true, the item property must be strictly equal. When false, matching of these components is asymmetric - the target item must contain the Magic Item's properties, but any extra properties, components, or states are ignored on the target. For values, such as enchantment level or durability, the target item must have at least the value this Magic Item has, but the target may have more than that amount.
| Option | Type | Default |
|---|---|---|
strict-enchants |
Boolean | true |
strict-enchant-level |
Boolean | true |
strict-durability |
Boolean | true |
strict-block-data |
Boolean | true |
Example: If the target item has extra enchantments, or a higher unbreaking level, the match; pass for item_1, fail for item_2.
magic-items:
item_1:
type: paper
strict-enchant-level: false
strict-enchants: false
enchants:
- unbreaking 1
item_2:
type: paper
enchants:
- unbreaking 1In most cases where magic items can be specified, usage of the inline Magic Item String format is also supported. Some major uses of magic items are shown below.
magic-items:
mana-crystal:
type: "redstone"
name: "&bMana Crystal"
lore:
- "&7Required when casting magic."
heal:
spell-class: ".targeted.PotionEffectSpell"
name: "Heal"
target-self: true
strength: 1
duration: 1
type: "instant_health"
cost:
- "mana-crystal 1"Certain modifiers conditions take magic items as arguments.
magic-items:
essense-stick:
type: "stick"
name: "&aEssense Stick"
lift:
spell-class: ".targeted.PotionEffectSpell"
name: "Lift"
modifiers:
- "holdingprecise essense-stick required"
target-self: true
duration: 200
strength: 1
type: "jump_boost"Certain passive triggers take magic items as arguments.
magic-items:
heavy-sword:
type: "wooden_sword"
name: "𘘤b&lHeavy 𘘤bSword"
heavy_damage:
spell-class: ".PassiveSpell"
triggers:
- givedamage heavy-sword
spells:
- heavy_pain(mode=full)
heavy_pain:
spell-class: ".targeted.PainSpell"
damage: 10
str-cast-target: "&cYou've been heavily damaged!"magic-items:
booster-wand:
type: "stick"
name: "&eBooster &6Wand"
lore:
- "&7Grants the user the ability to boost."
boost:
spell-class: ".targeted.PotionEffectSpell"
name: "Boost"
cast-item: "booster-wand"
target-self: true
duration: 200
strength: 1
type: "speed"magic-items:
magic-wand:
type: "stick"
name: "&cMagical &6Wand"
lore:
- "&7Right click to cast magic."
regen_magic:
spell-class: ".targeted.PotionEffectSpell"
right-click-cast-item: "magic-wand"
target-self: true
duration: 200
strength: 1
type: "regeneration"