Crash while saving entity NBT - Cannot encode empty ItemStack
I was working on creating a trident that warps you to it's location when it hits the ground, but it takes damage over time when held and even more when thrown.
I was using `warp.json` for the enchantment and `warp.mcfunction` for the function it calls.
I enchanted a trident with "Warp", and threw it until it broke. It seemed to both break and throw at the same time when it was at 0 durability. When I went to go pick it up, nothing happened, couldn't pick it up, even in creative. I tried to make a new trident with the same enchantment and throw that next. The trident was able to be thrown but instead of applying the damage or running the function the game crashed.
I have attached the enchantment file, `warp.json`, the function file, `warp.mcfunction`, and the crash report. Also, just in case I attached `warp_trident.json` which is the recipe function I was using to obtain the item.
Oh and I know in the crash report it says "(incompatible)" for the datapacks, I think it's because I haven't changed the version number yet. They worked just fine up until this point.
Environment
– System Details –
Details:
Minecraft Version: 1.21
Minecraft Version ID: 1.21
Operating System: Mac OS X (aarch64) version 14.5
Java Version: 21.0.3, Microsoft
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
Memory: 246136016 bytes (234 MiB) / 1644167168 bytes (1568 MiB) up to 3221225472 bytes
Created Issue:
Saving entity NBT - Cannot encode empty ItemStack
I was working on creating a trident that warps you to it's location when it hits the ground, but it takes damage over time when held and even more when thrown.
I was using `warp.json` for the enchantment and `warp.mcfunction` for the function it calls.
I enchanted a trident with "Warp", and threw it until it broke. It seemed to both break and throw at the same time when it was at 0 durability. When I went to go pick it up, nothing happened, couldn't pick it up, even in creative. I tried to make a new trident with the same enchantment and throw that next. The trident was able to be thrown but instead of applying the damage or running the function the game crashed.
I have attached the enchantment file, `warp.json`, the function file, `warp.mcfunction`, and the crash report. Also, just in case I attached `warp_trident.json` which is the recipe function I was using to obtain the item.
Oh and I know in the crash report it says "(incompatible)" for the datapacks, I think it's because I haven't changed the version number yet. They worked just fine up until this point.
Environment
Minecraft Version: 1.21 Pre-Release 1
Minecraft Version ID: 1.21-pre1
Operating System: Mac OS X (aarch64) version 14.0
Java Version: 21.0.3, Microsoft
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
Memory: 865535800 bytes (825 MiB) / 1409286144 bytes (1344 MiB) up to 2147483648 bytes (2048 MiB)
CPUs: 8
Processor Vendor: Apple Inc.
Processor Name: Apple M1
I was working on creating a trident that warps you to it's location when it hits the ground, but it takes damage over time when held and even more when thrown.
I was using `warp.json` for the enchantment and `warp.mcfunction` for the function it calls.
I enchanted a trident with "Warp", and threw it until it broke. It seemed to both break and throw at the same time when it was at 0 durability. When I went to go pick it up, nothing happened, couldn't pick it up, even in creative. I tried to make a new trident with the same enchantment and throw that next. The trident was able to be thrown but instead of applying the damage or running the function the game crashed.
I have attached the enchantment file, `warp.json`, the function file, `warp.mcfunction`, and the crash report. Also, just in case I attached `warp_trident.json` which is the recipe function I was using to obtain the item.
Oh and I know in the crash report it says "(incompatible)" for the datapacks, I think it's because I haven't changed the version number yet. They worked just fine up until this point.
I was working on creating a trident that warps you to it's location when it hits the ground, but it takes damage over time when held and even more when thrown.
I was using `warp.json` for the enchantment and `warp.mcfunction` for the function it calls.
I enchanted a trident with "Warp", and threw it until it broke. It seemed to both break and throw at the same time when it was at 0 durability. When I went to go pick it up, nothing happened, couldn't pick it up, even in creative. I tried to make a new trident with the same enchantment and throw that next. The trident was able to be thrown but instead of applying the damage or running the function the game crashed.
I have attached the enchantment file, `warp.json`, the function file, `warp.mcfunction`, and the crash report. Also, just in case I attached `warp_trident.json` which is the recipe function I was using to obtain the item.
Oh and I know in the crash report it says "(incompatible)" for the datapacks, I think it's because I haven't changed the version number yet. They worked just fine up until this point.
Saving entity NBT - Cannot encode empty ItemStackCrash while saving entity NBT - Cannot encode empty ItemStack
Minecraft Version: 1.21 Pre-Release 1
Minecraft VersionID: 1.21-pre1
Operating System: Mac OS X (aarch64) version 14.0
Java Version: 21.0.3, Microsoft
JavaVMVersion:OpenJDK 64-Bit Server VM (mixed mode), Microsoft
Memory: 865535800 bytes (825 MiB) / 1409286144 bytes (1344 MiB) up to 2147483648 bytes (2048 MiB)
CPUs: 8
Processor Vendor: Apple Inc.
Processor Name: Apple M1– System Details –
Details:
Minecraft Version: 1.21 Pre-Release 3
Minecraft Version ID: 1.21-pre3
Operating System: Mac OS X (aarch64) version 14.5
Java Version: 21.0.3, Microsoft
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
Memory: 363145904 bytes (346 MiB) / 1308622848 bytes (1248 MiB) up to 2147483648 bytes (2048 MiB)
– System Details –
Details:
Minecraft Version: 1.21Pre-Release 3
Minecraft Version ID: 1.21-pre3
Operating System: Mac OS X (aarch64) version 14.5
Java Version: 21.0.3, Microsoft
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
Memory:363145904bytes (346MiB) / 1308622848 bytes (1248 MiB) up to2147483648 bytes (2048 MiB)– System Details –
Details:
Minecraft Version: 1.21
Minecraft Version ID: 1.21
Operating System: Mac OS X (aarch64) version 14.5
Java Version: 21.0.3, Microsoft
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
Memory: 246136016 bytes (234 MiB) / 1644167168 bytes (1568 MiB) up to 3221225472 bytes
I think this is a duplicate ofMC-272585; your weapon stack broke, and that incorrectly affected the weapon stack of the projectile entity. In this case, the weapon and projectile are the trident.On further investigation, tridents use a different code path than bows and crossbows, so this is a related but separate issue from
MC-272585. The trident stack is damaged, then a copy of the damaged stack (which can be empty if the trident breaks) becomes the trident entity's weapon stack. LikeMC-272585, the crash occurs when the projectile entity attempts to serialize an empty stack, which is not allowed by the ItemStack#encode method (this serialization uses the same code path as the bow issue).Just confirmed and this also affects 1.21 Pre-Release 2
Have a look at the Resolution and the comments to see why this ticket has been resolved. If you think this ticket has been resolved erroneously you can contact the Mojira staff on Discord or Reddit.
– I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit
Have a look at the Resolution and the comments to see why this ticket has been resolved. If you think this ticket has been resolved erroneously you can contact the Mojira staff on Discord or Reddit.
– I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit
Still affects 1.21 and causes it to crash