Hello everybody, i have a small question to the DamageCauses.... When i kill a mob with an void in my plugin (target.damage() ) i can't get the Cause.... Why? And how can i get the DamageCause?
It doens't work! At the moment i have following: Code:java pTarget.damage(dmg); EntityDamageEvent evt= new EntityDamageEvent(pTarget, EntityDamageEvent.DamageCause.ENTITY_ATTACK,dmg); pTarget.setLastDamageCause(evt); With this i made the damage at the Entity! Then at a working listener: Code:java Entity deadE = event.getEntity(); DamageCause cause = ((EntityDamageEvent) event.getEntity().getLastDamageCause()).getCause(); I got a NullPointerException at this line: DamageCause cause = ((EntityDamageEvent) event.getEntity().getLastDamageCause()).getCause(); Why? I set the last DamageCause with the new Event or?