ArmorDropChances and HandDropChances in spawn egg data from loot tables are not converted into lists of floats, causing them to reset when a mob is spawned from the spawn egg
A loot table that returns a spawn egg with the entity_data component containing either ArmorDropChances or HandDropChances set to a JSON array of values does not convert the JSON array to a list of float values, causing the tag to reset on any mobs spawned by using that spawn egg.
How to reproduce:
- Create a world with the attached data pack (MC-274615.zip
). - Execute the following command:
/loot give @s loot mc-274615:byte_array
- While holding the spawn egg you were given, execute the following command:
/data get entity @s SelectedItem.components."minecraft:entity_data".ArmorDropChances - Look at the list of values returned in the chat.
- Use the spawn egg to spawn a zombie.
- Execute the following command:
/data get entity @n[type=minecraft:zombie]
- Notice that the list of values returned is different from the ones stored in the spawn egg itself.
Expected result:
A mob spawned from a spawn egg with an incorrectly converted ArmorDropChances or HandDropChances tag would use the stored values for that tag.
Observed result:
A mob spawned from a spawn egg with an incorrectly converted ArmorDropChances or HandDropChances tag resets the tag to its default value.
Original description:
Using the following loot table:
{
"pools": [{
"rolls": 1,
"entries": [{
"type": "item",
"weight": 1,
"name": "minecraft:zombie_spawn_egg",
"functions": [
{"function": "set_count", "count": 1},
{
"function": "set_components",
"components": {
"minecraft:entity_data": {
"id": "minecraft:zombie",
"ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}],
"ArmorDropChances": [0, 0, 0, 0]
}
}
}
]
}]
}]
}
It gives spawn egg with entity data like this, which means it got converted into a byte array instead of a list of floats:

The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]. Using a non-zero values like [0.001, 0.001, 0.001, 0.001] anywhere in this list does cause same issue but with 4 doubles instead of floats (also incorrect data type)
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.

The same issue happens with HandDropChances.
Created Issue:
ArmorDropChances and HandDropChances don't work in loot table entity_data component
using this loot_table:
{"function":"set_count","count":1}
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg","functions":[,{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax error
using this loot_table:
{"function":"set_count","count":1}
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg","functions":[,{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax errorusing this loot_table:
{"function":"set_count","count":1}
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg","functions":[,{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax error
using this loot_table:
{"function":"set_count","count":1}
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg","functions":[,{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax errorusing this loot_table:
{"function":"set_count","count":1}
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg","functions":[,{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax error
using this loot_table:
{"function":"set_count","count":1}
~{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg","functions":[,{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}~
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax error
using this loot_table:
{"function":"set_count","count":1}
~{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg","functions":[,{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}~
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax errorusing this loot_table:
{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg", "functions":[\{"function":"set_count","count":1}
{"pools":[{"rolls":1,"entries":[,{"function":"set_components",
"components":{"minecraft:entity_data":
{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax error
using this loot_table:
{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg",
{"pools":[{"rolls":1,"entries":["functions":[\{"function":"set_count","count":1},{"function":"set_components",
"components":{"minecraft:entity_data":
{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax errorusing this loot_table:
{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg", "functions":[\{"function":"set_count","count":1}
{"pools":[{"rolls":1,"entries":[,{"function":"set_components",
"components":{"minecraft:entity_data":
{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax error
using this loot_table:
{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg", "functions":[\{"function":"set_count","count":1}
{"pools":[{"rolls":1,"entries":[,{"function":"set_components",
"components":{"minecraft:entity_data":
{"id":"minecraft:zombie","ArmorItems":[{},{},{},\{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax errorusing this loot_table:
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg", "functions":[{"function":"set_count","count":1},{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use 0.0 it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax error
using this loot_table:
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg", "functions":[{"function":"set_count","count":1},{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of floatIf I use 0.0it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax errorusing this loot_table:
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg", "functions":[{"function":"set_count","count":1},{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes an Byte array instead of float
If I use [0.0,0.0,0.0,0.0] it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax error
using this loot_table:
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg", "functions":[{"function":"set_count","count":1},{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes anByte array instead of float
If I use [0.0,0.0,0.0,0.0] it also becomes B array
If I use an number with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax error
using this loot_table:
{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg", "functions":[{"function":"set_count","count":1},{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes a Byte array instead of float
If I use [0.0,0.0,0.0,0.0] it also becomes B array
If I use annumber with point like 0.001 it becomes double but not float
then if i spawn this mob, ArmorDropChances get overriden with it default 0.085f ignoring wrong data type array
same with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax error
using thisloot_table:{"pools":[{"rolls":1,"entries":[{"type":"item","weight":1,"name":"minecraft:zombie_spawn_egg", "functions":[{"function":"set_count","count":1},{"function":"set_components","components":{"minecraft:entity_data":{"id":"minecraft:zombie","ArmorItems":[{},{},{},{"id":"minecraft:iron_helmet","count":1}],"ArmorDropChances":[0,0,0,0]}}}]}]}]}
It gives spawn egg with entity_data like this:
Somehow it becomes a Byte array instead of float
If I use [0.0,0.0,0.0,0.0] it also becomes B arrayIf I use a number with point like 0.001 it becomes double but not floatthen if i spawn this mob, ArmorDropChancesget overriden withit default0.085f ignoring wrong data type array
same
with HandDropChances.
Tried writing array like [0.0f,0.0f,0.0f,0.0f] and few more variants and it even not loaded because of json syntax errorUsing the following loot table:
{ "pools": [ { "rolls": 1, "entries": [ { "type": "item", "weight": 1, "name": "minecraft:zombie_spawn_egg", "functions": [ {"function": "set_count", "count": 1}, { "function": "set_components", "components": { "minecraft:entity_data": { "id": "minecraft:zombie", "ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}], "ArmorDropChances": [0, 0, 0, 0] } } } ] } ] } ] }
It gives spawn egg with entity data like this:
However, it gets converted into a byte array instead of a list of floats.
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]
Using a non-zero value anywhere in this list does not cause the issue.
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
ArmorDropChances and HandDropChancesdon't workin loot tableentity_data componentArmorDropChances and HandDropChances set to 0 in loot tables are converted into a byte array, causing them to not work
Using the following loot table:
{ "pools": [{"rolls": 1,"entries": [{"type": "item","weight": 1,"name": "minecraft:zombie_spawn_egg","functions": [{"function": "set_count", "count": 1},{"function": "set_components","components": {"minecraft:entity_data": {"id": "minecraft:zombie","ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}],"ArmorDropChances": [0, 0, 0, 0]}}}]} ] }] }
It gives spawn egg with entity data like this:
However, it gets converted into a byte array instead of a list of floats.
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]
Using a non-zero value anywhere in this list does not cause the issue.
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
Using the following loot table:
{ "pools": [{ "rolls": 1, "entries": [{ "type": "item", "weight": 1, "name": "minecraft:zombie_spawn_egg", "functions": [ {"function": "set_count", "count": 1}, { "function": "set_components", "components": { "minecraft:entity_data": { "id": "minecraft:zombie", "ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}], "ArmorDropChances": [0, 0, 0, 0] } } } ] }] }] }
It gives spawn egg with entity data like this:
However, it gets converted into a byte array instead of a list of floats.
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]
Using a non-zero value anywhere in this list does not cause the issue.
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
Using the following loot table:
{ "pools": [{ "rolls": 1, "entries": [{ "type": "item", "weight": 1, "name": "minecraft:zombie_spawn_egg", "functions": [ {"function": "set_count", "count": 1}, { "function": "set_components", "components": { "minecraft:entity_data": { "id": "minecraft:zombie", "ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}], "ArmorDropChances": [0, 0, 0, 0] } } } ] }] }] }
It gives spawn egg with entity data like this:
However, it gets converted into a byte array instead of a list of floats.
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]
Using a non-zero value anywhere in this list does not cause the issue.
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
Using the following loot table:
{ "pools": [{ "rolls": 1, "entries": [{ "type": "item", "weight": 1, "name": "minecraft:zombie_spawn_egg", "functions": [ {"function": "set_count", "count": 1}, { "function": "set_components", "components": { "minecraft:entity_data": { "id": "minecraft:zombie", "ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}], "ArmorDropChances": [0, 0, 0, 0] } } } ] }] }] }
It gives spawn egg with entity data like this, which means, it got converted into a byte array instead of a list of floats:
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]. Using a non-zero value anywhere in this list does not cause the issue.
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
Using the following loot table:
{ "pools": [{ "rolls": 1, "entries": [{ "type": "item", "weight": 1, "name": "minecraft:zombie_spawn_egg", "functions": [ {"function": "set_count", "count": 1}, { "function": "set_components", "components": { "minecraft:entity_data": { "id": "minecraft:zombie", "ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}], "ArmorDropChances": [0, 0, 0, 0] } } } ] }] }] }
It gives spawn egg with entity data like this, which means, it got converted into a byte array instead of a list of floats:
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]. Using a non-zero value anywhere in this list does not cause the issue.
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
Using the following loot table:
{ "pools": [{ "rolls": 1, "entries": [{ "type": "item", "weight": 1, "name": "minecraft:zombie_spawn_egg", "functions": [ {"function": "set_count", "count": 1}, { "function": "set_components", "components": { "minecraft:entity_data": { "id": "minecraft:zombie", "ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}], "ArmorDropChances": [0, 0, 0, 0] } } } ] }] }] }
It gives spawn egg with entity data like this, which means it got converted into a byte array instead of a list of floats:
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]. Using a non-zero value anywhere in this list does not cause the issue.
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
relates to
Using the following loot table:
{ "pools": [{ "rolls": 1, "entries": [{ "type": "item", "weight": 1, "name": "minecraft:zombie_spawn_egg", "functions": [ {"function": "set_count", "count": 1}, { "function": "set_components", "components": { "minecraft:entity_data": { "id": "minecraft:zombie", "ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}], "ArmorDropChances": [0, 0, 0, 0] } } } ] }] }] }
It gives spawn egg with entity data like this, which means it got converted into a byte array instead of a list of floats:
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]. Using a non-zero value
anywhere in this list does not cause the issue.When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
Using the following loot table:
{ "pools": [{ "rolls": 1, "entries": [{ "type": "item", "weight": 1, "name": "minecraft:zombie_spawn_egg", "functions": [ {"function": "set_count", "count": 1}, { "function": "set_components", "components": { "minecraft:entity_data": { "id": "minecraft:zombie", "ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}], "ArmorDropChances": [0, 0, 0, 0] } } } ] }] }] }
It gives spawn egg with entity data like this, which means it got converted into a byte array instead of a list of floats:
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]. Using a non-zero values like [0.001, 0.001, 0.001, 0.001] anywhere in this list does cause same issue but with 4 doubles instead of floats (also incorrect data type)
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
ArmorDropChances and HandDropChancesset to 0 inloot tables are converted intoa byte array, causing them tonot workArmorDropChances and HandDropChances in spawn egg data from loot tables are not converted into lists of floats, causing them to reset when a mob is spawned from the spawn egg
Using the following loot table:
{ "pools": [{ "rolls": 1, "entries": [{ "type": "item", "weight": 1, "name": "minecraft:zombie_spawn_egg", "functions": [ {"function": "set_count", "count": 1}, { "function": "set_components", "components": { "minecraft:entity_data": { "id": "minecraft:zombie", "ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}], "ArmorDropChances": [0, 0, 0, 0] } } } ] }] }] }
It gives spawn egg with entity data like this, which means it got converted into a byte array instead of a list of floats:
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]. Using a non-zero values like [0.001, 0.001, 0.001, 0.001] anywhere in this list does cause same issue but with 4 doubles instead of floats (also incorrect data type)
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
A loot table that returns a spawn egg with the entity_data component containing either ArmorDropChances or HandDropChances set to a JSON array of values does not convert the JSON array to a list of float values, causing the tag to reset on any mobs spawned by using that spawn egg.
How to reproduce:
- Create a world with the attached data pack (MC-274615.zip
).
- Execute the following command:
/loot give @s loot mc-274615:byte_array- While holding the spawn egg you were given, execute the following command:
/data get entity @s SelectedItem.components."minecraft:entity_data".ArmorDropChances- Look at the list of values returned in the chat.
- Use the spawn egg to spawn a zombie.
- Execute the following command:
/data get entity @n[type=minecraft:zombie]- Notice that the list of values returned is different from the ones stored in the spawn egg itself.
Expected result:
A mob spawned from a spawn egg with an incorrectly converted ArmorDropChances or HandDropChances tag would use the stored values for that tag.
Observed result:
A mob spawned from a spawn egg with an incorrectly converted ArmorDropChances or HandDropChances tag resets the tag to its default value.
Original description:
Using the following loot table:
{ "pools": [{ "rolls": 1, "entries": [{ "type": "item", "weight": 1, "name": "minecraft:zombie_spawn_egg", "functions": [ {"function": "set_count", "count": 1}, { "function": "set_components", "components": { "minecraft:entity_data": { "id": "minecraft:zombie", "ArmorItems": [{}, {}, {}, {"id": "minecraft:iron_helmet", "count": 1}], "ArmorDropChances": [0, 0, 0, 0] } } } ] }] }] }
It gives spawn egg with entity data like this, which means it got converted into a byte array instead of a list of floats:
The same happens when using "ArmorDropChances": [0.0, 0.0, 0.0, 0.0]. Using a non-zero values like [0.001, 0.001, 0.001, 0.001] anywhere in this list does cause same issue but with 4 doubles instead of floats (also incorrect data type)
When spawning a mob from this item, the ArmorDropChances get overriden with the default value of 0.085f, ignoring array with the incorrect data type.
The same issue happens with HandDropChances.
Have you tried "ArmorDropChances":[0.0,0.0,0.0,0.0], does that work?
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
"ArmorDropChances":[0.0,0.0,0.0,0.0] also becomes a B array
For some reason, the only value that gets properly converted into a float is 0.5. All other decimal values between 0 and 1 are converted to doubles and 0 and 1 themselves are converted to bytes.
I have uploaded a data pack with some loot tables with varying values to demonstrate a few different conversions that cause the tag to reset when the mob is spawned. One of the included loot tables, mc-274615:float, is correctly converted to a list of floats.
This can be worked around by using stringified SNBT format (and specifying type) for the entity_data component
Thank you for your report!
After consideration, the issue is being closed as Won't Fix.
Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki