mojira.dev
MC-90101

Mob Spawner is overwriting (ignoring?) Pos[x,y,z] data of entity

In 1.8.8 you could define where entity from spawner whould appear:

/setblock ~ ~2 ~ minecraft:mob_spawner 0 replace {SpawnCount:1,SpawnRange:1,Delay:-1,MinSpawnDelay:50,MaxSpawnDelay:50,MaxNearbyEntities:1,RequiredPlayerRange:-1,SpawnPotentials:[{Type:MinecartCommandBlock,Weight:1,Properties:{Pos:[10.5,87.0,10.5]}}]}

In this case, minecartCommandBlock appeared at 10,87,10 every time the Delay hit 0. It was easy to set activator rail to run the command in cart

When I rewrited this for 1.9 snapshots, the Pos[x,y,z] entitydata was ignored. Tried both ways in Entity tag and in Properties tag:

/setblock ~ ~2 ~ minecraft:mob_spawner 0 replace {SpawnCount:1,SpawnRange:1,Delay:-1,MinSpawnDelay:50,MaxSpawnDelay:50,MaxNearbyEntities:1,RequiredPlayerRange:-1,SpawnPotentials:[{Entity:{id:"MinecartCommandBlock",Command:"hi",Pos:[10.5,87.0,10.5]},Weight:1}]}

In this case, minecartCommandBlock appears near spawner, randomly, definitely not in specified position. Setting SpawnRange:0 is still random y+-1, so minecart can spawn in spawner, over it or under.
In 15w40b the second command was working, in 15w41a it stopped working. Save file in attachment to easy check when it works and when not. It can be opened in 1.8.8 and in snapshots of 1.9.

Related issues

Attachments

Comments

migrated
[media]
Irbis

It might be related to MC-89923

migrated

Can confirm.

migrated

Confirmed. I was just about to post a bug report about this.

I can also confirm that this change took place after 15w39c, because the original behaviour still works in 15w39c.

Irbis

The second command (1.9 style) was working since 15w35 or even earlier till 15w40b. It broke in 15w41a. Hope it will be fixed before official 1.9 release, because a lot of custom maps from mapmakers will be unfixable.

migrated

Indeed. I didn't notice sooner because I've been sitting on 15w39c until today.

One (hopefully temporary) workaround is to create an always-active repeat command block that teleports entities from the spawner to their expected position (the one given by the Pos tag). For this to work you'd need the SpawnRange set very low (i.e. 0) so you know exactly where the entities will spawn.

migrated

Confirmed for 15w44a.

migrated

Confirmed for 15w45a, also, you should use Pos:[10.5d,87.0d,10.5d] instead of Pos:[10.5,87.0,10.5]

Irbis

Steven, It is working without "d/f" at the end of numbers. Try it on 15w40b, and it will work. But later it will not.

migrated

@@unknown Oh, than that's probably because there's a dot in the numbers, so the game will make it a double type.

Irbis

@Steven W.d.V. Exactly.
— "When no letter is used and Minecraft can't tell the type from context, it assumes double (if there's a decimal point), int (if there's no decimal point and the number is small enough to store as an int), or string (if neither is true)."
scr: http://minecraft.gamepedia.com/Commands

migrated

Confirmed for 15w46a

migrated

Confirmed for 15w47c

Skylinerw

Confirmed for 15w49b.

Skylinerw

Confirmed for 15w50a & 15w51b.

migrated

This is not a discussion forum.

Skylinerw

Confirmed for 16w03a.

Skylinerw

Confirmed for 16w04a.

Skylinerw

Confirmed for 16w05a.

migrated

Confirmed for 16w05b

Skylinerw

Confirmed for 16w06a.

Irbis

Thanks Searge! <3

Irbis

michael

Community Consensus

CommandBlock, MobSpawner

Minecraft 15w41b, Minecraft 15w42a, Minecraft 15w43a, Minecraft 15w43b, Minecraft 15w43c, ..., Minecraft 16w05b, Minecraft 16w06a, Minecraft 16w07a, Minecraft 16w07b, Minecraft 1.9 Pre-Release 1

Minecraft 1.9 Pre-Release 2

Retrieved