items.yml
This is the most important part of Spellitems.
It can be used to create custom Items and Enchantments.
But it might also be a bit complicated to understand at first.
Here is a as detailed as possible (for me) description:
The items.yml is sepperated into two parts:
- items: Here you can create your custom Items
- enchantments: Here you can create your custom Enchantments
Items
Every Item has this basic structure to describe the Item itself:
internalname: name: "Yeay a Stone!" lore: - "Nothing special here" id: 1 data: 0
Now the explanation:
- internalname: This is the name which can be used to Give/Reference the Item
- It must be unique and cannot contain spaces
- name: This is the Ingame name of the Item
- This needs to be set or else the item will not work
- lore: This is the Ingame lore of the Item
- This needs at least one line or else the item will not work
- id and data: These are simply the id and datavalue of the Item
Then the spells are described:
useUp: false ignoreDamage: false countup: leftclick: rightclick: onEat:
The Explanation:
- useUp. Will this Item get consumed when it was used
- ignoreDamage: Should the damage/datavalue of the item get ignored(usefull for items with durability)
- countup: Used for "charging up" spells, can be left out
- leftclick, rightclick and onEat are the possible actions on when to cast the spells
- Every Item can have spells on all three of them, but doesn't need to
- I will use leftclick for the further explanation
countup:
enabled: true max: 90 perSecond: 30 overridable: true interrupt: move: true damage: true itemSwitch: true
The Explanation:
- enabled: This can be used to enable needing to "charge up" the spell
- max: The value at which the Spells will get casted
- perSecond: How much will it increase per second(starting at 0)
- overridable: This can be used to make the Spell overidable by other Spells with "countups"
- interrupt: This can be used to define the actions which interrupt the counter
- move: Moving
- damage: Taking damage
- itemSwitch: Switching to another item
Finally the Spells themselves:
leftclick: effects: - "Caster ItemEffectSound BAT_IDLE:1:0.5" cooldown: 10 mana: cost: 0 casts:
The Explanation:
- effects: This can be used to create various effects
- More detailed information here: Effects
- cooldown: The ammount of time in seconds you have to wait until you can use that Spell again
- mana-cost: This can be used to define the ammount of mana you need to cast this spell
- Right now there is no way to get mana so you should leave this at 0
- This will hopefully change for Version 1.2
- casts: This can be used to define which Spells will get used
casts syntax:
casts: 0: cast: "ItemDamage" require: -1 castVars: - 0 - 2 1: cast: "ItemDamage" require: 0 castVars: - 1 - -2
The explanation:
- All spells need to be numbered
- cast: This is the name of the Spell
- require: This can be used to only execute a Spell if another one succeded(-1 to ignore)
- castVars: A list of vars used for the Spell
Information on what Spells are available and what vars they require can be found here: Spells
Examples can be found in the default items.yml
Enchantments
Enchantments have the same syntax as items but with less options.
The Spells will get used on a Player when he was damaged with the Item.
These Enchantments also work on Bows, Snowballs, Eggs, ...
Example:
internalname: name: "Poison" effects: [] casts: 0: cast: "ItemPotionEffect" require: -1 castVars: - 0 - "19:60:4"
Comments