Skip to content

Commit

Permalink
Add preliminary "on attack" action that triggers when the NPC starts …
Browse files Browse the repository at this point in the history
…attacking a target. (as opposed to triggering on every attack)
  • Loading branch information
davidcernat committed Mar 8, 2013
1 parent 3c93523 commit 1f81d8d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/net/aufdemrand/denizen/tags/core/NPCTags.java
Expand Up @@ -124,6 +124,8 @@ public void navBegin(NavigationBeginEvent event) {
if (!event.getNPC().hasTrait(AssignmentTrait.class)) return;
dNPC npc = DenizenAPI.getDenizenNPC(event.getNPC());
npc.action("begin navigation", null);
if (event.getNPC().getNavigator().getEntityTarget().isAggressive())
npc.action("attack", null);
previousLocations.put(event.getNPC().getId(), npc.getLocation());
}

Expand Down

0 comments on commit 1f81d8d

Please sign in to comment.