Summary
When a Custom Enchantment with a minecraft:tick effect executes a function on a Mannequin wearing enchanted armor, executing a command that reads the entity's NBT while the Mannequin is dying causes repeated server warnings.
The enchantment continues to function correctly, and gameplay is unaffected. The only issue is repeated warning messages in the server log.
Steps
Create a Custom Enchantment with a
minecraft:tickeffect that runs a function.Apply the enchantment to a piece of armor.
Equip the armor on a Mannequin.
In the function, execute a command that reads the entity's NBT, for example:
data get entity @sexecute if data entity @s {Health:0f}execute if predicate <namespace:predicate>(where the predicate reads entity NBT)
Kill the Mannequin.
Observe the server log while the Mannequin is in its dying animation.
Expected Result
The function should continue to execute normally while the Mannequin is dying, and reading the entity's NBT should not produce any serialization warnings.
Actual Result
During the dying animation, the server repeatedly logs:
[Server thread/WARN]: [net.minecraft.advancements.predicates.NbtPredicate] Serialization errors:
Mannequin['Mannequin'/19, l='ServerLevel[My World]', x=-504.52, y=-63.00, z=-460.30]: Failed to encode value 'DYING' to field 'pose': Invalid pose: dyingAdditional Information
The issue does not occur if the function only performs scoreboard operations or entity selector checks (for example,
if entity @s[tag=...]).The warning appears only when the function executes a command that reads the entity's NBT, such as
data get entity,execute if data, orexecute if predicate.The Custom Enchantment continues to function correctly while the Mannequin is dying.
No gameplay issues have been observed; only repeated warnings are written to the server log.
The issue is not that entity NBT can be read while the Mannequin is dying. That behavior appears to work correctly. The only issue is the repeated serialization warnings.
The warning originates from net.minecraft.advancements.predicates.NbtPredicate.
This may be related to MC-303558, which reports the same `Invalid pose: dying` warning during chunk serialization. However, this issue is reproducible without unloading chunks and appears to follow a different code path (net.minecraft.advancements.predicates.NbtPredicate rather than chunk serialization).
I've attached a minimal datapack that reproduces the issue.
/reload
/function test:summon (Summons a Mannequin already wearing the enchanted armor.)
Kill the Mannequin.
Observe the server log.