When summoning a custom mob spawner and giving it to a player in Creative who then places it, the spawner acts as expected but if a survival player places it it will turn into a standard pig spawner and lose all its custom NBT.
Summon Command (forgot the give command)
/summon Item ~ ~ ~ {Item:{id:"minecraft:mob_spawner",Count:1b,tag:{BlockEntityTag:{RequiredPlayerRange:1,MaxNearbyEntities:0,SpawnCount:0,SpawnData:{id:"Enderman"},SpawnRange:0,Delay:0,SpawnPotentials:{Entity:{id:"Enderman"}},MinSpawnDelay:0},display:{Name:"Enderman Spawner"}}}}
Linked issues
is duplicated by 20
Comments 12
Why is this a security issue? Couldn't you just have some sort of verification thing? I'm surprised on what the server depends on (stuff like giving skin urls) and what the client depends on (sending inventory to server repeatedly).
With the new system of data-driven loot tables for blocks... is it still working as intended? if I can now make a spawner loot table with "copy_nbt" and get that block in "survival"... shouldn't i be able to place it with his current tags?
Drops were never the issue. This is part of protection against non-op players (even creative ones) executing op commands. Spawners can spawn command block minecarts, so they are in that special category, together with command blocks and signs.
But they can be placed by Creative players and keep their NBT. So is this feature not broken enough yet? 😃
Condition is "creative && permission-level >= 2". If player can run `/give` command, they already have level >= 2.
Ah, that explains it, thanks. But what's the security benefit of also checking for Creative mode? If I have permission level 2, I can also switch to Creative mode. So it's just an extra step to have to do that, it doesn't change the required permission level.
I understand this is a security fix, but it causes a lot of problems like player heads and custom items explicitly created by server admins and datapacks losing data when placed in the world by a player.
Please reopen this issue. There needs to be another way to prevent command exploitation by non-ops that doesn't erase perfectly valid data.
Why is this "works as intended"? Im trying to make a datapack where you can silk touch spawners and this completely breaks everything. So how do I place a spawner in survival without it reverting to a pig spawner?
For security reasons, the tag BlockEntityTag is ignored in survival and adventure mode when placing the block.