[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. @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"); } } |
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. |