[SPIGOT-6494] Placing a custom spawner in survival doesn't keep custom settings Created: 06/Jun/21  Updated: 10/Jun/21

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Ryan Breuer Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: 1.15.2, 1.16.5, spigot
Environment:

Running on Windows 10 locally

Also replicated the issue on 1.15.2 build: CraftBukkit version git-Spigot-a99063f-fad2494 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT

Expected functionality on 1.14.4 build: CraftBukkit version git-Spigot-56f8471-43183ea (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)

Attached plugin's source code available here: https://github.com/haveric/TestPlugin/blob/monster-spawner/testplugin/src/main/java/haveric/testplugin/TestPlugin.java


Attachments: File TestPlugin.jar    
Version: This server is running CraftBukkit version 3092-Spigot-9fb885e-ebe18b9 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

Placing a customized monster spawner does not keep its settings when placed in survival.

Replication Steps with attached plugin:

  1. Create the customized spawners by placing dirt and stone in a crafting table and taking the resulting spawners.
    1. Expected Result is a chicken spawner with the customized settings, which is what you receive no matter what gamemode you are in. Switching gamemodes does not seem to remove the data; only placing does.
  2. Set gamemode to creative (/gamemode creative).
  3. Place Spawner
  4. Expected Result is correct and a chicken spawner is placed.
  5. Switch to survival (/gamemode survival)
  6. Place Spawner
  7. Default pig spawner is placed and all custom settings appear to be lost.

Based on the environment tests, this appears to have been changed sometime in 1.15 as it works correctly on the 1.14.4 build.



 Comments   
Comment by Brendan Butters [ 10/Jun/21 ]

Yea this has been happening for a while now. Plugins like essentials or silky spawner and other minable spawner plugins tend to have solved this issue by checking nbt data when the block is placed then updating it soon after.

Comment by Julian v.d Berkmortel [ 06/Jun/21 ]

md_5, behavior in vanilla is that only the "BlockEntityTag" is copied over from the item stack when placed in creative, not survival. I though can understand the expectation / need for this NBT tag to be copied over when placed in survival as this also happens for e.g a jukebox.

Comment by md_5 [ 06/Jun/21 ]

What is the behaviour in Vanilla?

Comment by Julian v.d Berkmortel [ 06/Jun/21 ]

I was able to reproduce this issue in the latest version. I used the command below to make it easier to reproduce.

/give @p minecraft:spawner{BlockEntityTag:{SpawnData:

{id:"zombie"}

}}

Generated at Tue Apr 15 08:35:04 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.