[SPIGOT-7307] Cancelling EntityCombustEvent does not prevent items from combusting Created: 22/Mar/23  Updated: 25/Dec/24

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

Type: Bug Priority: Minor
Reporter: Sivert Paulsen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: bug, spigot

Version: [11:34:59] [Server thread/INFO]: This server is running CraftBukkit version 3682-Spigot-41150f3-dbc32ff (MC: 1.19.4) (Implementing API version 1.19.4-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

When cancelling EntityCombustEvent it should not combust.
It should also be called when throwing items into Lava, but does not currently

@EventHandler
public void test(EntityCombustEvent event) {
    if (event.getEntity() instanceof Item) {
        event.setCancelled(true);
        Bukkit.broadcastMessage("EntityCombustEvent");
    }
}

@EventHandler
public void test(EntityCombustByBlockEvent event) {
    if (event.getEntity() instanceof Item) {
        event.setCancelled(true);
        Bukkit.broadcastMessage("EntityCombustByBlockEvent");
    }
} 

https://user-images.githubusercontent.com/62521371/226876129-a23ab38c-f148-4835-965c-d7cffd8609dc.mp4



 Comments   
Comment by md_5 [ 25/Mar/23 ]

This misunderstands the event. The combust event triggers when something catches fire. In both instances the entity is not dying because it is catching fire, it is dying because the block is damaging it.

 

You also need to handle EntityDamageEvent.

Generated at Sat Apr 05 10:22:43 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.