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}
|
- Use the respective spawner command
- Right click with a Sheep spawn egg
- Inspect the NBT data of the spawner, for example with the following command (while standing on top of the spawner)