mojira.dev
MC-87184

Changing spawner with spawn egg only overrides id

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}}

Linked issues

Comments 3

What about the inconsistency with the SpawnPotentials tag?

Please remove that part from the ticket and create a new ticket for it.

marcono1234

michael

Confirmed

SpawnData, SpawnPotentials, id, mob-spawner, spawn-egg, spawner

Minecraft 15w34d, Minecraft 15w39c, Minecraft 15w43a

Retrieved