Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-271267

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.20.5
    • None
    • Unconfirmed
    • (Unassigned)

      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.

            Unassigned Unassigned
            GrifterMage Callum Milne
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: