[SPIGOT-1166] Entity damaged by block event Created: 04/Sep/15 Updated: 04/May/24 Resolved: 04/May/24 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Leon | Assignee: | Doc |
Resolution: | Fixed | Votes: | 1 |
Labels: | None |
Attachments: |
![]() |
||||||||
Issue Links: |
|
||||||||
Plugin: | The one I coded myself |
Description |
in the newest spigot, in EntityDamageByBlockEvent, the getDamager() which return the block that damaged them only returns null |
Comments |
Comment by Frank Wu [ 02/Feb/21 ] |
Made a test plugin with a simple listener (uploaded in attachments):
@EventHandler public void onBedExplode(EntityDamageByBlockEvent event) { Bukkit.broadcastMessage("EntityDamageByBlockEvent"); Bukkit.broadcastMessage(event.getDamager().toString()); } Code throws exception at second broadcast because event.getDamager() returns null.
|
Comment by Connor Smith [ 11/Dec/20 ] |
This issue still exists in the latest version of spigot, specifically for Block Explosion damage (beds and respawn anchors). |
Comment by Black Hole [ 04/Sep/15 ] |
Looking at the code, a block is returned for DamageCause.CONTACT only. I don't understand, why DamageCause.VOID returns EntityDamageByBlockEvent. |
Comment by SpigotMC [ 04/Sep/15 ] |
Your build is not the latest and therefore may be the reason you are having this issue. Spigot is 4 version(s) behind. CraftBukkit is 5 version(s) behind. This message was automatically generated and is not guaranteed to be a solution to your issue. |