[SPIGOT-3912] Cancelling EntityDamageEvent / EntityCombustEvent still despawns item. Created: 22/Apr/18 Updated: 28/Apr/18 Resolved: 28/Apr/18 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | 7kasper | Assignee: | Unassigned |
Resolution: | Cannot Reproduce | Votes: | 0 |
Labels: | cancel, damage, despawn, fire, item | ||
Environment: |
Spigot plugin 1.12.2 |
Description |
Cancelling EntityDamageEvent or EntityCombustEvent when an item is burned does not prevent the removal of the item. |
Comments |
Comment by md_5 [ 28/Apr/18 ] |
Cannot reproduce, both of these code blocks work independently. @EventHandler public void test(EntityDamageEvent e) { if ( e.getEntity() instanceof Item ) { e.setCancelled( true ); } } @EventHandler public void test(EntityCombustEvent e) { if ( e.getEntity() instanceof Item ) { e.setCancelled( true ); } } |
Comment by Wyatt J Herkamp [ 24/Apr/18 ] |
That is why some code was failing. I was trying to make a plugin to stop spawners from being burned and I couldn't get it to work. I am guessing https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/nms-patches/Entity.patch#191 |