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

Inconsistent entity data overriding when using spawn eggs on spawners

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • Minecraft 15w51b, Minecraft 1.9 Pre-Release 2, Minecraft 1.9.4, Minecraft 1.10 Pre-Release 1, Minecraft 1.11.2, Minecraft 1.12.2, Minecraft 18w05a
    • Community Consensus

      The bug

      The problem is that you are unable to tell from the NBT data whether the SpawnData entity is the same entity object also stored in the SpawnPotentials which would cause both to be overridden when using a spawn egg. In this case you would be as well unable to tell which of the SpawnPotentials entries get overridden in case there are mutliple entries with the same tags and values. If the SpawnData entity is not in the SpawnPotentials list then only the SpawnData entity gets modified.

      SpawnData spawned SpawnPotentials set Changed tag
      SpawnData and SpawnPotentials
      SpawnData
      SpawnData and SpawnPotentials
      Key
      • SpawnData spawned = Spawner spawned the entity provided in the SpawnData tag already
      • SpawnPotentials set = SpawnPotentials tag was set by a command, else the game adds this tag
      • Changed tag = The tag that is changed
      • = Yes
      • = No
      • = Does not matter
      Note

      For all the different situations listed above it does not matter if the SpawnData tag is set

      Possible reason

      SpawnData spawned SpawnPotentials set Possible reason
      Next SpawnPotentials entity object is set as SpawnData, so both contain the same entity object
      Changing the entity stored as SpawnData with the spawn egg
      Same entity object of SpawnData is used in SpawnPotentials

      Possible solution

      One way to solve this would be to have a tag called SpawnIndex (Integer) with these values:

      Value Situation
      -1 SpawnData entity is not listed in SpawnPotentials
      0 to ... SpawnData entity is listed in SpawnPotentials, value is index of entry

      How to reproduce

      SpawnData spawned SpawnPotentials set Spawner command
      /setblock ~ ~1 ~ mob_spawner 0 replace {SpawnData:{id:"ArmorStand",CustomName:"SpawnData",CustomNameVisible:1b},SpawnPotentials:[{Entity:{id:"ArmorStand",CustomName:"SpawnPotentials",CustomNameVisible:1b}}]}
      
      /setblock ~ ~1 ~ mob_spawner 0 replace {SpawnData:{id:"ArmorStand",CustomName:"SpawnData",CustomNameVisible:1b},SpawnPotentials:[{Entity:{id:"ArmorStand",CustomName:"SpawnPotentials",CustomNameVisible:1b}}],Delay:32767s}
      
      /setblock ~ ~1 ~ mob_spawner 0 replace {SpawnData:{id:"ArmorStand",CustomName:"SpawnData",CustomNameVisible:1b},Delay:32767s}
      
      1. Use the respective spawner command
      2. Right click with a Sheep spawn egg
      3. Inspect the NBT data of the spawner, for example with the following command (while standing on top of the spawner)
        /blockdata ~ ~-1 ~ {} 
        

            Unassigned Unassigned
            marcono1234 [Mod] Marcono1234
            Votes:
            15 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: