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

Custom Spawn egg: Providing NBT does not prevent entity equipment and randomization


    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.12.2, Minecraft 18w03b, Minecraft 18w16a, Minecraft 18w21a, Minecraft 18w22a, Minecraft 1.13-pre1, Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre4, Minecraft 1.13-pre6, Minecraft 1.13-pre7, Minecraft 1.13-pre8, Minecraft 1.13, Minecraft 1.13.1-pre1, Minecraft 1.13.2, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w05a, Minecraft 19w06a, Minecraft 19w07a, Minecraft 19w12b, Minecraft 19w13b, Minecraft 1.14.1, Minecraft 1.14.2 Pre-Release 2, Minecraft 1.14.2 Pre-Release 3, 1.15.2 Pre-Release 1, 1.15.2, 20w06a, 20w09a, 20w13a, 20w13b, 20w14a, 20w17a, 20w19a, 1.16 Pre-release 5, 1.16 Release Candidate 1, 1.16, 1.16.1, 1.16.2 Pre-release 1, 1.16.2 Pre-release 3, 1.16.3, 1.16.4, 20w49a, 21w03a, 1.17.1 Pre-release 1, 22w12a, 1.19.2, 22w44a, 22w45a
    • Confirmed
    • Commands, Mob spawning

      The bug

      Omitting or inserting NBT data into a custom spawn egg can still have randomized outcomes.

      Details and examples:

      • The plain summon-command, e.g. for Zombies, can spawn also Zombies including equipment (armour, weapons, tools) as well as Zombie babies.
        /summon minecraft:zombie ~ ~ ~
      • If you use this summon-command though:
        /summon minecraft:zombie ~ ~ ~ {}

        it will not summon randomized Zombies (e.g. babies or with equipment), only regular adult Zombies without any form of equipment whatsoever.
        Iirc this was an issue in previous MC versions, but not anymore (thanks to Panda4994, making me aware )

      • (See Searge's comment on MC-86172: "If you specify a NBT tag, it won't automatically add the default equipment to mobs. In this case you have to specify it in the NBT") to verify it being WaI.)
      • Plain regular Spawn Eggs from the Creative menu can spawn entities with randomized NBT data (as they apparently should), but if you spawn Zombies with a custom zombie spawn egg, it will also randomize Zombies in swapping equipment (right-handed Zombie becoming left-handed) and even also spawn baby Zombies, even though you e.g. inserted specifically that the Age of the Zombie should only result in an adult type.

      Example: Custom Spawn Eggs with defined NBT can still have random outcomes, e.g. a custom spawn egg with:

      /give @p zombie_spawn_egg{EntityTag:{}}

      can still spawn zombies with equipment

      as well as baby zombies


      • a custom spawn egg with distinct specified equipment can also have random outcomes, e.g.:
        /give @p zombie_spawn_egg{EntityTag:{IsBaby:0b,ArmorItems:[{id:golden_boots,Count:1b,tag:{ench:[{id:0,lvl:1}]}},{id:chainmail_leggings,Count:1b,tag:{ench:[{id:0,lvl:1}]}},{id:chainmail_chestplate,Count:1b,tag:{ench:[{id:0,lvl:1}]}},{id:lapis_block,Count:1b}],HandItems:[{id:bone,Count:1b},{id:shield,Count:1b}],PersistenceRequired:1,NoAI:1,Silent:1}}

        this should only spawn an Adult Zombie with a bone in its right and shield in its left hand (+lapis block on its head, chain chestplate, golden boots).

      However, it can also spawn as lefthanded, basically it swaps the bone and shield; this seems to occur with an estimated chance of roughly 10-15%.

      But not only the handedness can be affected, it can also spawn a baby Zombie with the same equipment.

      And also both can happen at the same time (handedness-swap and baby zombie).

      From MC-200002 by Onnowhere: Additionally, spawn eggs with custom nbt may occasionally naturally spawn a passenger. For example, a Strider may occasionally spawn with a baby Strider or Zombified Piglin riding it when using a custom spawn egg for striders.

      The same data when used in /summon or a spawner will not spawn the natural passenger on top. This happens with all entities that can have natural passengers, including Spiders and Chickens. This bug relates to MC-85340 but is different in that it does not involve setting the passenger tag itself.

      To reproduce:

      1. Run the following command to give yourself a custom spawn egg with custom NBT.

      /give @p minecraft:strider_spawn_egg{EntityTag:{CustomName:'"example"'}}

      2. Use this spawn egg several times and observe that sometimes baby Striders or Zombified Piglins will spawn on top of the Strider.

      3. Run the following command several times and observe that the custom NBT restricts the strider from naturally spawning a passenger entity

      /summon strider ~ ~ ~ {CustomName:'"example"'}

      4. Another example of expected behavior is via a spawner.

      /setblock ~ ~1 ~ spawner{SpawnData:{id:strider,CustomName:'"example"' replace}}

        1. 2018-01-19_16.34.41.png
          1.30 MB
        2. 2018-01-19_16.34.50.png
          1.82 MB
        3. 2018-01-19_16.35.06.png
          2.00 MB
        4. 2018-01-19_16.35.39.png
          1.21 MB
        5. 2018-01-19_16.36.12.png
          1.33 MB
        6. 2018-01-19_17.41.26.png
          1.61 MB
        7. 2018-01-19_17.42.02.png
          1.21 MB
        8. 2018-01-19_18.00.00.png
          2.17 MB
        9. 2018-01-19_18.01.10.png
          1014 kB
        10. 2018-01-23_15.33.52.png
          1.31 MB
        11. 2018-01-23_15.36.29.png
          1.31 MB
        12. 2018-01-23_15.36.43.png
          1.31 MB
        13. 2018-01-23_15.37.36.png
          799 kB
        14. Custom-Spawn-Egg-Randomization_Passengers.mp4
          5.68 MB

            Unassigned Unassigned
            LapisDemon Meri Diana
            13 Vote for this issue
            9 Start watching this issue