Open hkkongou opened 2 years ago
I am having the same issue too, some spawners are turning into pig
I'm afraid this sounds like a Vanilla bug
kinda sad that after a month there is still no updates...
i tried with other plugin support mining spawner in 1.18 such as wildstacker, which works normally, so even if is vanilla bug , it should be able to avoid or fix
@timbru31 Ok: I dug down to find the cause of this bug.
Bug Summary:
In 1.17 the NBT structure for SpawnData was "SpawnData.ID", but in 1.18 its "SpawnData.Entity.ID". The spawner items do not seem to have auto-upgraded with the world.
Reproduction Steps:
7:57:36 PM CONSOLE:WARN]: Invalid SpawnData: No key entity in MapLike[{id:"minecraft:magma_cube"}] 7:57:36 PM CONSOLE:WARN]: Invalid SpawnData: No key entity in MapLike[{id:"minecraft:magma_cube"}]
Proposed Solution: Automatically fix old SpawnData NBT tags in items.
Thanks for the debugging @t00thpick1 Have you tried to v7.3.0? I've added the proper NBT path in https://github.com/timbru31/SilkSpawners/commit/42a9fc0623f9a0f5179a7652a5b633c8804b71cb and look in both places.
If Vanilla does not upgrade old spawners correctly this needs to be reported to Mojang, too.
@timbru31 I am using v7.3.0, which is why spawners mined/spawned in 1.18 work. But the old spawners still have the old NBT, which you do properly read (so the boss bar description and such are correct) but because it is never re-written, when it is placed it creates a block with the old NBT as well, and this is what causes the pig reversion. You could fix this by adding a correction in say onPlayerHoldItem() that detects the old NBT and upgrades it.
I think its wrong to consider this a vanilla bug as there is no supported method in vanilla minecraft to obtain spawner items. (Specifying NBT in a command is not considered supported). Rather it is the responsibility of the plugin that made the now-incorrect spawner items in the first place (i.e. silkspawners) to ensure they continue working in new versions.
What steps will reproduce the problem?
place spawner in 1.18 worlds or place spawner in world thats is originally 1.18 below, but upgraded to 1.18, at location y>255 or y<0
Expected output
spawner placed normal
What do you see instead?
placing default spawner message is showing in each placement, the spawner turns into pig.
video: https://youtu.be/jzKZBy__MnU
at start, is in 1.17.1->1.18.1 upgraded world, placing between 255~ at the end, that world is a 1.18.1 world
Log file of the issue/error
no error
/version output?
[14:34:51 INFO]: This server is running Paper version git-Paper-151 (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT) (Git: 6663747) You are 1 version(s) behind Download the new version at: https://papermc.io/downloads Previous version: git-Paper-407 (MC: 1.17.1)
SilkSpawners version
SilkSpawners#263 or 7.2.0
Please provide any additional information below.
Checklist