mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Updating onEntityDamageByEntity event listener
This commit is contained in:
parent
882a457484
commit
4f2a0b8260
@ -75,8 +75,22 @@ public class mcEntityListener implements Listener
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
//Check for mcgod mode
|
||||
if(defender instanceof Player)
|
||||
{
|
||||
Player playerDefender = (Player)defender;
|
||||
if(Users.getProfile(playerDefender).getGodMode())
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
//Make sure defender is not invincible
|
||||
if(defender instanceof LivingEntity)
|
||||
{
|
||||
LivingEntity livingDefender = (LivingEntity)defender;
|
||||
if(livingDefender.getNoDamageTicks() < livingDefender.getMaximumNoDamageTicks()/2.0F)
|
||||
Combat.combatChecks(event, plugin);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onEntityDamage(EntityDamageEvent event)
|
||||
|
Loading…
Reference in New Issue
Block a user