mojira.dev
MC-92282

Mob spawner block_entity_data does not copy SpawnData data to missing SpawnPotentials

When using /setblock to create a spawner with only "SpawnData" supplied, that data is automatically copied into "SpawnPotentials" such that the same entity will always spawn.

For example, the following /setblock command shows the intended behavior:

/setblock ~ ~ ~ spawner{SpawnData:{entity:{id:zombie}}}

A rough example of what the spawner's data becomes, indicating that the list of entities to spawn is only that which was defined in SpawnData:

{SpawnData:{entity:{id:"minecraft:zombie"}},SpawnPotentials:[{weight:1,data:{entity:{id:"minecraft:zombie"}}}]}

However, the block_entity_data component does not cause this copy to happen. Instead, given the following /give command (which is expected to have the exact same result as /setblock when placed):

/give @s spawner[block_entity_data={id:spawner,SpawnData:{entity:{id:zombie}}}]

The data becomes:

{SpawnData:{entity:{id:"minecraft:zombie"}},SpawnPotentials:[]}

The difference being that the SpawnPotentials did not copy the zombie over like it does with /setblock.

Linked issues

MC-100058 Mob Spawner BUG Resolved MC-111814 Spawners turning back into pig spawners Resolved MC-112515 custom mob_spawner placed manually turn into pig spawner after 1 mob spawn. Resolved MC-121071 Given spawner Resolved MC-124783 Mob Spawner Deletes Initial Index without Checks Resolved

Comments 25

[Mod] redstonehelper

Confirmed, but probably invalid because mob spawners are not supposed to be available in item form (MC-80597).

redstonehelper, mob spawners as item are commonly used in servers, so disabling it would be bad for them. The bug you linked to is no longer counting mob spawner.
This bug is not invalid and in my opinion should be fixed.=]

redstonehelper: You could argue that the entire BlockEntityTag is invalid with that argument.

[Mod] redstonehelper

Yes, I could have.

Confirmed for 1.9-pre2

15 more comments

CreeperMagnet, how is what you say possible? I don't get it.

If a player isn't op, then how do they get a spawner unless a server intentionally adds a method to give them one?

And if they do get one, how do they make it spawn thousands of mobs a minute unless they're given a spawner with higher rates? With default rates you'd need 50+ spawners to get even close to 1000 mobs per minute right?

It seems to me that even if non-op spawner placing was possible, it's still totally up to the server owners what they allow players to get their hands on - as it should be.

And if there are security exploits that allow non-op players to modify spawners to cause massive destruction, then those are bugs that should be fixed properly.

 

CreeperMagnet_

Players without OP can use creative mode’s saved toolbars. That is working as intended, and it will always be that way.

However, saved toolbars can be saved in any other world where the player has OP and can obtain spawners with modified NBT using /give—with modified spawnlimits, and delays so that it can spawn tickly, without a limit.

Then, if they were able to place these without OP, in any OTHER server, it would cause issues.

Being able to load toolbars without OP isn’t going to change. That’s a major purpose of toolbars, to be able to transfer items between worlds. However, the downside of this is non-OP players not being able to place custom spawners.

Would you rather be able to place some random spawners, or be able to keep your block palettes throughout worlds?

Ok I didn't know about that issue.
I don't play creative so have never really used a saved toolbar.

But isn't that issue part of a bigger exploit problem with saved toolbars that should be fixed properly?

Perhaps by not loading items you can't get via the creative inventory, or that's black listed on the server?
It's obviously not that simple I guess.

Confirmed in 1.16. The first command no longer works; it should be:

/setblock ~ ~ ~ spawner{SpawnData:{id:zombie}}

Can confirm in 21w05b.

Skylinerw

(Unassigned)

Confirmed

Platform

Low

Commands

Minecraft 15w45a, Minecraft 15w46a, Minecraft 15w47a, Minecraft 15w47b, Minecraft 15w47c, ..., 1.21.3, 1.21.5, 1.21.6, 1.21.7, 1.21.8

Minecraft 16w32a

Retrieved