- Added required items feature.
- Now you can set a list of required items that player must have in their inventory to be able to upgrade their item.
- You can set a custom 'you don't have enough of required items' message based on different upgrades.
- You can set different required items for different upgrades.
- You can define material, displayname, lore, amount and enchantments for required items.
Changes in config.yml
Code (YAML):
required-items
:
# If true, we will remove the required items from player's inventory if they have enough chance to upgrade.
# Otherwise, we won't touch their items.
remove-on-success
: true
# If true, we will remove the required items from player's inventory if they don't have enough chance to upgrade.
# Otherwise, we won't touch their item even if they fail to upgrade their item.
remove-on-failure
: true
Usage of the new feature:
Code (YAML):
upgrades
:
'1':
from
:
# 'from.item' is the item that will be upgraded to another item.
item
: APPLE
# 'from.name' is the name of the item that will be upgraded to another item.
name
:
""
to
:
# 'to.item' is the item that will be the upgraded item from a previous item.
# Use 'oraxen:item_id_here' for custom textured items by Oraxen plugin.
# Use 'itemsadder:item_id_here' for custom textured items by ItemsAdder plugin.
# Use 'ecoitems:item_id_here' for custom items by EcoItems plugin.
item
: GOLDEN_APPLE
# 'to.item' is the new item's name which will be the upgraded from a previous item.
# %price% and %chance% placeholders can be used in the name and lore section.
name
:
"&e&lUpgraded Apple"
# 'to.lore' is the new item's lore which will be the upgraded from a previous item.
lore
:
-
""
-
"&7A golden apple that is upgraded"
-
"&7with a chance of %chance%%"
# The amount of the upgraded item. This option is also optional, by default the value is 1.
amount
: 1
# 'chance' amount is going to be used if player accepts to upgrade and try their chance.
# If player is unlucky, they will lose their item and item won't be upgraded :(
chance
: 99
# 'price' is optional, you can set a price for that upgrade. Price system is using the Vault API.
price
: 0
# 'enchantments' are optional. You can add enchantments to the new upgraded item.
enchantments
:
[
]
# 'reset-enchants' is optional. You can reset the enchantments of the previous item.
# If the previous item has enchantments, they will be applied to the new upgraded item as well.
# If there are same enchantments in the previous item and upgraded item, larger level will be used.
reset-enchants
: true
# 'disallowed-enchantments' is optional. If the previous item contains one these enchantments
# they won't be able to open upgrade menu and upgrade the item, and will receive a message about that.
disallowed-enchantments
:
[
]
# 'required-items' is optional. To be able to upgrade the item player must have these items in their inventory.
required-items:
'1':
material
: STICK
name
:
""
# Player must have minimum 5 sticks to upgrade their item.
amount
: 5
lore
:
[
]
enchantments
:
[
]
# - "PROTECTION:1"
# This option is a must if you set the 'required-items' section.
# The message that will be sent to player if they don't have enough the required items in their inventory.
no-required-items-found
:
"&cYou don't have the required items in your inventory! You need 5 sticks to upgrade your Apple!"