mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-12 11:21:34 +01:00
Merge pull request #381 from Blamo27/fix/npc-issue
Can't hit NPCs (Sentinel #249)
This commit is contained in:
commit
8eeab682db
@ -479,6 +479,11 @@ public void onDamageEntity(DamageEntityEvent event) {
|
||||
} else if (pvp) {
|
||||
Player defender = (Player) event.getEntity();
|
||||
|
||||
// if defender is an NPC
|
||||
if (defender.hasMetadata("NPC")) {
|
||||
return;
|
||||
}
|
||||
|
||||
canDamage = query.testBuild(target, associable, combine(event, DefaultFlag.PVP))
|
||||
&& query.queryState(playerAttacker.getLocation(), playerAttacker, combine(event, DefaultFlag.PVP)) != State.DENY
|
||||
&& query.queryState(target, playerAttacker, combine(event, DefaultFlag.PVP)) != State.DENY;
|
||||
|
Loading…
Reference in New Issue
Block a user