Skip to content

Commit a19b5a9

Browse files
committed
Add damagertype to damage event data
1 parent 6e7f5d2 commit a19b5a9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/laytonsmith/core/events/drivers/EntityEvents.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ public String docs() {
839839
+ " | cause: The type of damage | amount | finalamount: health entity will lose after modifiers"
840840
+ " | damager: If the source of damage is a player this will contain their name, otherwise it will be"
841841
+ " the entityID of the damager (only available when an entity causes damage)"
842+
+ " | damagertype: The type of entity that caused the damage, if there's a damager."
842843
+ " | shooter: The name of the player who shot, otherwise the entityID"
843844
+ " (only available when damager is a projectile)}"
844845
+ " {amount: raw amount of damage (in half hearts)}"
@@ -1766,6 +1767,7 @@ public static Map<String, Mixed> parseEntityDamageEvent(MCEntityDamageEvent even
17661767
} else {
17671768
map.put("damager", new CString(damager.getUniqueId().toString(), Target.UNKNOWN));
17681769
}
1770+
map.put("damagertype", new CString(damager.getType().name(), Target.UNKNOWN));
17691771
if(damager instanceof MCProjectile) {
17701772
MCProjectileSource shooter = ((MCProjectile) damager).getShooter();
17711773
if(shooter instanceof MCPlayer) {

0 commit comments

Comments
 (0)