[SPIGOT-7567] SpawnReason for SNOWMAN is reported as BUILD_IRONGOLEM Created: 09/Jan/24  Updated: 25/Dec/24  Resolved: 09/Jan/24

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

Type: Bug Priority: Minor
Reporter: tastybento Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Attachments: File TestPlugin-1.11.2-SNAPSHOT-LOCAL.jar    
Version: This server is running CraftBukkit version 4012-Spigot-864e4ac-76931e8 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

When a snowman is created by building, the SpawnReason in CreatureSpawnEvent is wrong and reports as SpawnReason.BUILD_IRONGOLEM instead of SpawnReason.BUILD_SNOWMAN.

Minimal plugin:

public class TestPlugin extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        getLogger().info("Test plugin loaded");
        Bukkit.getPluginManager().registerEvents(this, this);
    }

    @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
    public void onCreatureSpawn(final CreatureSpawnEvent e) {
        e.setCancelled(true);
        getLogger().info(e.getSpawnReason().toString());
    }
} 

Install and build a snowman (two blocks of snow with a carved pumpkin on top).

Log output:

[17:12:43] [Server thread/INFO]: BoxManager joined the game
[17:12:43] [Server thread/INFO]: BoxManager[/127.0.0.1:57052] logged in with entity id 509 at ([bskyblock_world]-2.6607028154662307, 85.0, 802.1550866775121)
[17:12:56] [Server thread/INFO]: [TestPlugin] BUILD_IRONGOLEM


 Comments   
Comment by tastybento [ 09/Jan/24 ]

FWIW, BUILD_WITHER is correctly reported.

Generated at Sat Dec 13 11:46:49 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.