Support for spawn eggs that spawn mobs of different type (currently these get converted or cleared, depending on the internal mob type)
PapiCapi opened this issue ยท 2 comments
Preliminaries:
- Shopkeepers version:
2.12.0
- Spigot version:
Paper 414 ( 1.16.4 )
- I have checked that my issue/question does not get answered by:
- The documentation.
- The FAQ.
- The Known Issues.
- I have checked all open and closed issues, but none seems to fit my issue/question.
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 CraftBukkit version git-Spigot-37d799b-3eb7236 (MC: 1.16.4) (Implementing API version 1.16.4-R0.1-SNAPSHOT)
) with the latest version of Shopkeepers (currently 1.12.0
), with no other plugins and with no kinds of other server or client mods.
The issue:
When adding a modified mob egg to a shopkeeper, the item is deleted. If you disable the conversion of items, it will be saved but no trade will be shown. If you enable the conversion, the item will be cleared from your inventory. Eventually, make a /shopkeeper reload after you set the item in the shopkeeper and before you try to access it.
Here is the recipe saved when disabling conversion :
recipes:
'1':
item1:
==: org.bukkit.inventory.ItemStack
v: 2584
type: PIG_SPAWN_EGG
amount: 3
meta:
==: ItemMeta
meta-type: SPAWN_EGG
display-name: '{"text":"Oeuf de Golem","color":"white","bold":true}'
internal: H4sIAAAAAAAAAONiYOBi4HTNK8ksqQxJTOdgYMpMYRDJzcxLTS5KTCuxyizKz4tPz89JzWVgAACMn0RJLAAAAA==
resultItem:
==: org.bukkit.inventory.ItemStack
v: 2584
type: WOODEN_AXE
Here is the give command :
minecraft:give @p minecraft:pig_spawn_egg{display:{Name:"{"text":"Oeuf de Golem","color":"white","bold":true}",Lore:["Clique droit sur un spawner","pour que le spawner en invoque."]},EntityTag:{id:"minecraft:iron_golem"}} 1
Here is a video of what appens : https://www.youtube.com/watch?v=eEOxGedvSdU&feature=youtu.be&ab_channel=Lohann
Here are the logs : https://pastebin.com/CTX0tz9q
This issue appears to be fixed in Spigot 1.20.6+. This works now: /give blablubbabc minecraft:pig_spawn_egg[minecraft:entity_data={id:"minecraft:creeper"}]
The item is not converted during deserialization.
Yeah, the issue is that Spigot doesn't support these types of spawn eggs. See https://hub.spigotmc.org/jira/browse/SPIGOT-5485
When these items are deserialized (eg. due to Shopkeepers, but this can happen in other situations as well) Spigot detects the internal entity data and runs it through the legacy data converter (that's also why you get the message about the legacy material support in your server log). The purpose of this is to convert legacy spawn eggs (there have not been different types of spawn eggs in the past) to their corresponding type. Since Minecraft has no spawn egg for iron golems, the item is removed.
I will keep this ticket open as a remainder, but ultimately this has to be fixed in Spigot (eg. by not running this legacy data converter for non-legacy spawn eggs).