mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-08 11:59:43 +01:00
Fix Sentinel #249 issue (Can't hit NPCs)
https://github.com/mcmonkey4eva/Sentinel/issues/249 => Can't hit NPCs
This commit is contained in:
parent
95b88ea64b
commit
2ae6f39a09
@ -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