Mojira Archive
MC-271267

Invalid drop chances set to "minecraft:entity_data" component by "set_components"

If the `set_components` function is used to set the `entity_data` component of a spawn egg or similar in a loot table or item modifier, and any of HandDropChances, ArmorDropChances, aor body_drop_chance is specified, those tags will be invalid, and will not be applied to the resulting entity.

This appears to happen because `set_components` sets those components in the item as byte values instead of the required float values.

For example, the following loot table:

drop.json

generates a spawn egg with the following data:

{components: {"minecraft:entity_data": {ArmorDropChances: [B; -10B, -10B, -10B, -10B], body_armor_drop_chance: -1b, ArmorItems: [\{count: 1b, id: "minecraft:diamond_boots"}, \{count: 1b, id: "minecraft:diamond_leggings"}, \{count: 1b, id: "minecraft:diamond_chestplate"}, \{count: 1b, id: "minecraft:diamond_helmet"}], HandDropChances: [B; 1B, 1B], id: "minecraft:zombie_villager", HandItems: [\{count: 1b, id: "minecraft:diamond_sword"}, {}]}}, count: 2, id: "minecraft:zombie_villager_spawn_egg"}

Using said spawn egg generates a zombie villager with default values for its ArmorDropChances and HandDropChances tags.

Duplicate

Callum Milne

2024-04-29, 12:18 AM

2024-04-29, 09:32 PM

2024-04-29, 09:27 PM

0

0

Unconfirmed

(Unassigned)

1.20.5

-