[SPIGOT-7849] Serializing Food Item (null value in entry: using-converts-to=null) Created: 25/Jul/24  Updated: 25/Dec/24  Resolved: 25/Jul/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: TechnicallyCoded Assignee: Doc
Resolution: Fixed Votes: 0
Labels: food, serialization
Environment:

openjdk version "21.0.3" 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)

Ubuntu 22.04.3 LTS


Attachments: PNG File Screenshot 2024-07-25 at 3.31.00 PM.png     File SerializationTest-1.0.0.jar     Text File logs.txt    
Version: CraftBukkit version 4273-Spigot-34bd42b-2c54749 (MC: 1.21) (Implementing API version 1.21-R0.1-SNAPSHOT)
Plugin: SerializationTest
Guidelines Read: Yes

 Description   

Serializing an item using BukkitObjectOutputStream with the "can_always_eat" tag will trigger a NullPointerException. I am assuming other similar tags may cause the same issue.

I provided a test plugin: simply run /serializationtest when holding an item with this tag in your hand. A plugin like ItemEdit can be used to apply this tag to the item quickly

Thank you for your time ^^



 Comments   
Comment by Doc [ 25/Jul/24 ]

PR Created the issue is with the value of item to convert when eat being null.

https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1454/overview

You can test this in BuildTools with: 

--rev 1.21 --pr craftbukkit:1454
Generated at Sat Dec 13 20:46:57 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.