The egg doesn't work anymore
Xentyo opened this issue ยท 2 comments
Preliminaries:
- Shopkeepers version:
2.19.0
- Spigot version:
git-Paper-378 (MC: 1.20.4)
- If the player exits and re-enters the server with the egg in their inventory, the egg becomes a simple villager egg
- If the egg is in a chest (or other inventory). After the server restarts, it becomes a normal villager egg
How to fix?
There was some internal change in MC 1.20.4 that causes the shop creation items stored inside the config to now produce a different item when loaded (the item looks the same, but its internal data is different). And items created based on this template can change in certain cases, because the server does not consider this item to be in a valid format in certain cases.
There is an upstream ticket discussing this issue: https://hub.spigotmc.org/jira/browse/SPIGOT-7571
But I haven't found the time yet to further investigate this.
The issue cannot be resolved without manual changes to the definition of the shop creation item inside the config: The server has made some changes that are unlikely to be reverted in how the item display name is converted to a corresponding json Minecraft representation. Items with different internal Json display name data are considered different by the Minecraft server.
The solution is to explicitly specify the json representation of the display name inside the config. See the changelog for Shopkeepers v2.20.0:
- I have adjusted the default display name from the previous
display-name: '&aShopkeeper'
todisplay-name: '{"text":"Shopkeeper","italic":false,"color":"green"}'
. However, this only applies to new plugin installations. - Existing servers need to manually adjust the display name to match the json representation that was previously generated on their server. For shop creation items generated on Spigot v1.20.4 and earlier, this would be
display-name: '{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"green","text":"Shopkeeper"}],"text":""}'
- Additionally, to make future item adjustments easier, I have added new settings to identify the shop creation item by a new tag, instead of matching all of its item data. This however only applies to new plugin installations by default. See the comments in the changelog and inside the default configuration for further information and implications of the new settings.