mojira.dev
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:

[media]

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.

Linked issues

Attachments

Comments 1

Thank you for your report!
We're tracking this issue in MC-270965, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

GrifterMage

(Unassigned)

Unconfirmed

(Unassigned)

1.20.5

Retrieved