🔍Custom Item Match Method
Default Item Match Method
Vanilla Items
By default, we support two sell match method, they are:
Bukkit: This sell method require inventory's item must 100% same as product item, if the item player has changed some thing, it can not be selled anymore. For example, add enchantments or change item name in anvil, they will change item's NBT info.
ItemFormat: ItemFormat can set ignore list of item's vanilla NBT. If you add enchants and name in ignore list, then player can still sell item even the item has more enchantments or changed item name.
Example config:
For options in item-format
section:
require-same-key: This means that the items in the shop must have all the data of the items owned by the player. For example: The shop has a diamond sword without any enchantments, then player has a diamond sword with sharpness enchantment, if player try sell his diamond sword to shop and the
require-same-key
option istrue
, then this sword will not be allowed to sell, because the sword in shop miss the data of enchantment.ignore-key: The list of ItemFormat™ Key that will be ignored when check whether items are same. For example: The shop has a diamond sword with sharpness enchantment, if player's sword don't has this enchantment, and you didn't set
enchants
at this option, then he can not sell the sword to shop, if you setenchants
here, then we will ignore player's sword don't has this enchantment, and contine check other keys.
Third-plugin Item
Custom Match Method for each product - Require MythicChanger
Although the ItemFormat method described above solves the problem of items being modifiable, its flexibility is still insufficient. Therefore, this feature can help you set custom product sell modes for each product.
You can add a match-item
section in the configuration of each product or price, which means that if the item meets this matching rule, it is considered sellable.
ItemFormat is still required if you want give player the item you set here after player try buy this product and display it in plugin's placeholder and shop GUI.
This feature require your server must install MythicChanger plugin, please get it here:
An example product config can be found below, in this example, both emerald and diamond can be selled, but only diamond are display in shop, after player try buy this product, he will only get diamond because match-rule
section does not effect buy.
Last updated