Hey how can i call an onDeath event? and is there a possibility to check wich block killed the player like lava wather or a other type of block? thx Thallo
Hi, please have a look here. If you overwrite the onEntityCombust, onEntityDamage, etc. methods you should get all the informations. Greetz Mad
sorry for such a noob question but why is the hook not called?? Code: PluginManager pm = getServer().getPluginManager(); pm.registerEvent(Event.Type.ENTITY_DEATH, (Listener) this.entityListener, Event.Priority.Normal, this); Code: public void onEntityDamage(EntityDamageEvent event) { Player player = (Player) event.getEntity(); if(event.getCause().equals("LAVA")) { player.sendMessage("Lava"); }
I believe you're trying to call onEntityDamage with an ENTITY_DEATH registerer. Try this: Code: PluginManager pm = getServer().getPluginManager(); pm.registerEvent(Event.Type.ENTITY_DAMAGED, (Listener) this.entityListener, Event.Priority.Normal, this);
sorry but this is not working .. The player doesn't get a message if he gets dmg .. I put a player.sendMessage() under Player player = (Player) event.getEntity() and tried it but no message ..
This should work, an enum is not a string: Code: if(event.getCause() == DamageCause.LAVA) { player.sendMessage("Lava"); } EDIT: According to RedMine, the event hasn't been implemented yet.