Shopkeepers

Shopkeepers

2M Downloads

can't trade

CraftWorksMC opened this issue ยท 1 comments

commented

Shopkeepers version:** 2.9.1
Spigot version:** 1.15.2 with ProtocolSupport for older versions

Reproduction on a fresh and up-to-date Spigot server:

I was able to reproduce my issue on a freshly setup and up-to-date Spigot server (currently 1.15.2) with the latest version of Shopkeepers (currently 1.9.2), with no other plugins and with no kinds of other server or client mods.

The issue:

i have command blocks running on a clock with summoning items (with custom names and lore.) and i added these items to buy a sword (with custom name and enchantments) and i couldn't buy it.
i should be able to pick it up but i can't.

to create the items i used https://www.gamergeeks.nz/apps/minecraft/give-command-generator
and copyed that in a command block. the sword i just had to do /enchant.

i didn't modify anything on the config file.

i don't know what is causing the issue. it happened in the past. same issue

commented

Can you post the exact command you are using to create those items?

Edit: If your item name or lore contain colors, I assume you are running into this issue: #578

Spigot's item serialization (what the Shopkeepers plugin uses to store the items for the trades in the save.yml file) does not preserve the exact item representation used in the minecraft give command. So after a reload of the plugin, the items inside the shop will no longer match the items created by the give command, so the trading no longer works. Ultimately this is something to fix in Spigot, but a workaround is to either not use the give command to create those items (eg. use a plugin that internally uses Spigot's API for creating the items), or use legacy color codes inside the given command. Example:
give @p minecraft:emerald{display:{Name:"{\"text\":\"\\u00A7a\\u00A7oEmerald Name\"}",Lore:["{\"text\":\"\\u00A76\\u00A7oLore\"}"]}} 1