"Not a string" appears in log when serializing angered Warden
When an angered Warden is serialized, "Not a string" appears as an error message in the chat.
To Reproduce
- Use spawn eggs to spawn a Warden and a couple of Zoglins.
- When they start to fight, trigger the serialization of Warden by saving the world, pausing the game, or using the /data get command
- -> "Not a string" appears in the log. If you use the /data get command, you will find that there's no anger field in the data.
- When all the Zoglins are killed, trigger the serialization again
- -> The message does not appear. If you use the /data get command, you will find that the anger field is correctly serialized.
Code Analysis
Code analysis by [Mod] SPGoding can be found in this comment.
Created Issue:
"Not a string" appears in log when saving world
When saving a world, "Not a string" appears as an error message in the chat. This seems to occur whenever there's a warden in the world when saving the game, once per warden.
When saving a world, "Not a string" appears as an error message in the chat. This seems to occur whenever there's a warden in the world when saving the game, up to once per warden.
To reproduce:
1. Create a superflat world.
2. Use spawn eggs to spawn a Warden and a couple of Zoglins.
3. When they start to fight, save the world -> "Not a string" appears in the log.
4. When all the zoglins are killed, save the world -> The message does not appear.
When saving a world, "Not a string" appears as an error message in the chat. This seems to occur whenever there's a warden in the world when saving the game, up to once per warden.
To reproduce:
1. Create a superflat world.
2. Use spawn eggs to spawn a Warden and a couple of Zoglins.
3. When they start to fight, save the world or pause the game -> "Not a string" appears in the log.
4. When all the zoglins are killed, save the world or pause the game -> The message does not appear.
When
saving a world, "Not a string" appears as an error message in the chat.This seems to occur whenever there's a warden in the world when saving the game, up to once per warden.To reproduce:
1. Create a superflat world.
2. Use spawn eggs to spawn a Warden and a couple of Zoglins.
3. When they start to fight, save the world or pause the game -> "Not a string" appears in the log.
4. When all the zoglins are killed, save the world or pause the game -> The message does not appear.When an angered Warden is serialized, "Not a string" appears as an error message in the chat.
To Reproduce
- Use spawn eggs to spawn a Warden and a couple of Zoglins.
- When they start to fight, trigger the serialization of Warden by saving the world, pausing the game, or using the /data get command
- -> "Not a string" appears in the log. If you use the /data get command, you will find that there's no anger field in the data.
- When all the Zoglins are killed, trigger the serialization again
- -> The message does not appear. If you use the /data get command, you will find that the anger field is correctly serialized.
Code Analysis
Code analysis by [Mod] SPGoding can be found in this comment.
"Not a string" appears in log when saving world"Not a string" appears in log when serializing angered Warden

This also appears to happen when the game is paused.
Yes, pausing the game is sufficient (the world is also saved at that time). I have added this to the steps to reproduce.
I may be completely wrong, but this might be caused by the Codec in net/minecraft/world/entity/monster/warden/AngerManagement trying to use ExtraCodecs.UUID, something that reads from/writes to an int stream, as the key.