Completly stop hurting entity

Discussion in 'Plugin Development' started by Bl4ckEmp1re, May 3, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Bl4ckEmp1re

    Hi,
    which ways I have to "hurt" entities?

    At this time I have this:
    Code:
    @EventHandler
        public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
            if (event.getDamager() instanceof Player) {
                event.setCancelled(true);
            }
        }
    But this include not harming potion and this things.
     
  2. EntityDamageEvent, it gets all damage to an entity.
     
  3. Offline

    Bl4ckEmp1re

    But I only want to stop damage caused my a player.
     
Thread Status:
Not open for further replies.

Share This Page