The new SpawnPotentials list works about 90% correctly. Mob Spawners with a SpawnPotentials list will properly cycle through the mob types in the list (as can be seen by the mob being displayed in the cage), but are spawned with the wrong EntityId. The spawner's base EntityId tag is used to spawn the entities in the list, instead of the provided Type variable. When saving and closing Minecraft, the current EntityId (depending on which one it is on in the cycle) gets saved to the map data, and is used for spawning new mobs when the map is reloaded. Below is the NBT structure of the spawner I have tested this with:
TAG_Compound({
"MinSpawnDelay": TAG_Short(20),
"MaxSpawnDelay": TAG_Short(80),
"SpawnCount": TAG_Short(4),
"id": TAG_String(u'MobSpawner'),
"RequiredPlayerRange": TAG_Short(16),
"Delay": TAG_Short(21),
"MaxNearbyEntities": TAG_Short(6),
"SpawnRange": TAG_Short(4),
"SpawnPotentials": TAG_List([
TAG_Compound({
"Weight": TAG_Int(50),
"Type": TAG_String(u'Skeleton'),
"Properties": TAG_Compound({
"HurtTime": TAG_Short(0),
"IsVillager": TAG_Byte(0),
"Air": TAG_Short(300),
"CanPickUpLoot": TAG_Byte(0),
"AttackTime": TAG_Short(0),
"IsBaby": TAG_Byte(0),
"PersistenceRequired": TAG_Byte(0),
"Fire": TAG_Short(-1),
"FallDistance": TAG_Float(0.0),
"Invulnerable": TAG_Byte(0),
"EntityId": TAG_String(u'Skeleton'),
}),
}),
TAG_Compound({
"Weight": TAG_Int(50),
"Type": TAG_String(u'PigZombie'),
"Properties": TAG_Compound({
"DropChances": TAG_List([
TAG_Float(1.0),
TAG_Float(0.05000000074505806),
TAG_Float(0.05000000074505806),
TAG_Float(0.05000000074505806),
TAG_Float(0.05000000074505806),
]),
"Equipment": TAG_List([
TAG_Compound({
"id": TAG_Short(276),
"Damage": TAG_Short(0),
"Count": TAG_Byte(1),
"tag": TAG_Compound({
"ench": TAG_List([
TAG_Compound({
"id": TAG_Short(16),
"lvl": TAG_Short(5),
}),
]),
"display": TAG_Compound({
"Name": TAG_String(u'\xa7rRipper'),
"Lore": TAG_List([
TAG_String(u'Of the Jack variety'),
]),
}),
}),
}),
TAG_Compound({
"id": TAG_Short(301),
"Damage": TAG_Short(0),
"Count": TAG_Byte(1),
"tag": TAG_Compound({
"display": TAG_Compound({
"color": TAG_Int(16776960),
}),
}),
}),
TAG_Compound({
"id": TAG_Short(300),
"Damage": TAG_Short(0),
"Count": TAG_Byte(1),
"tag": TAG_Compound({
"display": TAG_Compound({
"color": TAG_Int(255),
}),
}),
}),
TAG_Compound({}),
TAG_Compound({}),
]),
"HurtTime": TAG_Short(0),
"IsVillager": TAG_Byte(0),
"Air": TAG_Short(300),
"CanPickUpLoot": TAG_Byte(0),
"AttackTime": TAG_Short(0),
"IsBaby": TAG_Byte(0),
"PersistenceRequired": TAG_Byte(0),
"Fire": TAG_Short(-1),
"FallDistance": TAG_Float(0.0),
"Invulnerable": TAG_Byte(0),
"EntityId": TAG_String(u'PigZombie'),
}),
}),
TAG_Compound({
"Weight": TAG_Int(50),
"Type": TAG_String(u'Zombie'),
"Properties": TAG_Compound({
"DropChances": TAG_List([
TAG_Float(1.0),
TAG_Float(0.05000000074505806),
TAG_Float(0.05000000074505806),
TAG_Float(0.05000000074505806),
TAG_Float(0.05000000074505806),
]),
"Equipment": TAG_List([
TAG_Compound({
"id": TAG_Short(279),
"Damage": TAG_Short(0),
"Count": TAG_Byte(1),
"tag": TAG_Compound({
"ench": TAG_List([
TAG_Compound({
"id": TAG_Short(16),
"lvl": TAG_Short(5),
}),
]),
"display": TAG_Compound({
"Name": TAG_String(u'\xa7rRipper'),
"Lore": TAG_List([
TAG_String(u'Of the Jack variety'),
]),
}),
}),
}),
TAG_Compound({
"id": TAG_Short(301),
"Damage": TAG_Short(0),
"Count": TAG_Byte(1),
"tag": TAG_Compound({
"display": TAG_Compound({
"color": TAG_Int(16776960),
}),
}),
}),
TAG_Compound({}),
TAG_Compound({}),
TAG_Compound({
"id": TAG_Short(298),
"Damage": TAG_Short(0),
"Count": TAG_Byte(1),
"tag": TAG_Compound({
"display": TAG_Compound({
"color": TAG_Int(16711680),
}),
}),
}),
]),
"HurtTime": TAG_Short(0),
"IsVillager": TAG_Byte(1),
"Air": TAG_Short(300),
"CanPickUpLoot": TAG_Byte(0),
"AttackTime": TAG_Short(0),
"IsBaby": TAG_Byte(1),
"PersistenceRequired": TAG_Byte(0),
"Fire": TAG_Short(-1),
"FallDistance": TAG_Float(0.0),
"Invulnerable": TAG_Byte(0),
"EntityId": TAG_String(u'Zombie'),
}),
}),
]),
"EntityId": TAG_String(u'Zombie'),
"x": TAG_Int(44),
"y": TAG_Int(10),
"z": TAG_Int(-210),
})
Comments 5
Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
It was corrected the same night I told Dinnerbone about it on Twitter; this bug report was submitted at his request. As it's fixed, this report should be resolved.
Please put the code on pastebin. Kinda hard to read the NBT tags without the spaces/tabs working properly