[SPIGOT-4360] Entities are still affected/destroyed by instances of EntityDamageEvent even when canceled. Created: 09/Sep/18  Updated: 09/Sep/18  Resolved: 09/Sep/18

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

Type: Bug Priority: Minor
Reporter: Brian Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: 1.13.1, entitydamageevent, event, explosions
Environment:

CentOS 7, latest Spigot.


Version: 1.13.1
Guidelines Read: Yes

 Description   

I am currently listening for EntityDamageEvent and in the case that either of these is true:

entityDamageEvent.getCause() == EntityDamageEvent.DamageCause.ENTITY_EXPLOSION
entityDamageEvent.getCause() == EntityDamageEvent.DamageCause.BLOCK_EXPLOSION

I am canceling the event. Despite this, primed TNT and creepers still destroy entities (e.g. boats) and knock back entities (e.g. falling blocks). This can be abused in the case that a player manages to launch TNT or lure a creeper into a protected area, thus causing destruction of various entities that would otherwise be protected from a player simply punching them.

Additional Note: WorldGuard is also unable to protect entities from explosion. Of course, blocks are protected by canceling EntityExplodeEvent.



 Comments   
Comment by md_5 [ 09/Sep/18 ]

Boats have a special:
VehicleDamageEvent
VehicleDestroyEvent

Falling block knockback isn't affected by the damage event due to SPIGOT-506. There's no real way to fix that (how do you actually end up exploding TNT into falling blocks, if your goal is to prevent TNT damaging the landscape then there's more appropriate events).

Generated at Tue Apr 08 02:45:44 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.