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

Changing spawner with spawn egg only overrides id

XMLWordPrintable

    • Confirmed

      Important!

      When fixing this, please consider also disabling non-op player from using spawn_eggs or use another way to prevent MC-75630 from happening.

      General overriding problem

      When you use a spawn egg to override the Entity of a spawner, it will only replace the id tag in the id tag in the EntityTag of the spawn egg.
      This means other tags are still contained.

      Example command
      /setblock ~ ~1 ~ mob_spawner 0 replace {SpawnData:{id:Sheep,Color:1},Delay:32767,MinSpawnDelay:32767,MaxSpawnDelay:32767,SpawnCount:1,SpawnRange:1}
      

      – Changing to Guardian spawner –

      /blockdata
      {
      	MaxNearbyEntities:6s,
      	RequiredPlayerRange:16s,
      	SpawnCount:1s,
      	SpawnData:{
      		Color:1,
      		id:"Guardian"
      	},
      	MaxSpawnDelay:32767s,
      	Delay:19754s,
      	x:-481,
      	y:57,
      	z:-496,
      	id:"MobSpawner",
      	SpawnRange:1s,
      	MinSpawnDelay:32767s,
      	SpawnPotentials:[
      		0:{
      			Entity:{
      				Color:1,
      				id:"Guardian"
      			},
      			Weight:1
      		}
      	]
      }
      

      Overriding with spawn_egg containing EntityTag

      If the spawn egg contains other NBT data, it will ignore it and only change the id.

      Example command
      /give @p spawn_egg 1 0 {EntityTag:{id:FallingSand,Block:stone}}
      

            searge [Mojang] Searge (Michael Stoyke)
            marcono1234 [Mod] Marcono1234
            Votes:
            2 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: