From a4477ea318e2fabc97784a9f0f2fa02cd988b103 Mon Sep 17 00:00:00 2001 From: Alex 'mcmonkey' Goodwin Date: Sat, 30 May 2020 13:17:06 -0700 Subject: [PATCH] tweak attack command meta to avoid confusion --- .../denizenscript/denizen/objects/NPCTag.java | 4 ++- .../commands/entity/AttackCommand.java | 27 ++++++++----------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/NPCTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/NPCTag.java index 85f02e47c3..720947b6d2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/NPCTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/NPCTag.java @@ -1060,6 +1060,7 @@ else if (attribute.startsWith("list", 2)) { // @returns ElementTag // @description // Returns the NPC's current navigator attack strategy. + // Not related to Sentinel combat. // --> registerTag("attack_strategy", (attribute, object) -> { return new ElementTag(object.getNavigator().getLocalParameters().attackStrategy().toString()); @@ -1112,7 +1113,8 @@ else if (attribute.startsWith("list", 2)) { // @attribute // @returns ElementTag(Boolean) // @description - // Returns whether the NPC is in combat. + // Returns whether the NPC is currently targeting an entity for the Citizens internal punching pathfinder. + // Not compatible with Sentinel. // --> registerTag("is_fighting", (attribute, object) -> { return new ElementTag(object.getNavigator().getEntityTarget() != null && object.getNavigator().getEntityTarget().isAggressive()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AttackCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AttackCommand.java index 75a61326fe..8412a85410 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AttackCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AttackCommand.java @@ -19,25 +19,24 @@ public class AttackCommand extends AbstractCommand { public AttackCommand() { setName("attack"); - setSyntax("attack (|...) (target:/cancel)"); + setSyntax("attack [|...] (target:/cancel)"); setRequiredArguments(0, 2); isProcedural = false; } // <--[command] // @Name Attack - // @Syntax attack (|...) (target:/cancel) + // @Syntax attack [|...] (target:/cancel) // @Required 0 // @Maximum 2 // @Short Makes an entity, or list of entities, attack a target. // @Group entity // // @Description - // By itself, the 'attack' command will act as an NPC command in the sense that an attached - // NPC will attack the attached player, or specified target. It can also accept a specified entity, - // or list of entities, to fulfill the command, just specify a 'fetchable' entity object. This includes - // player objects (dPlayers) and NPC objects (dNPCs). To specify the target, prefix the entity - // object with 'target:' or 't:'. + // The attack command causes a mob entity to attack a target mob entity or player. + // + // This technically can be used on an NPC, but it will trigger the Citizens internal punching-pathfinder. + // This attack mode doesn't work well. If you want NPC combat, consider using Sentinel instead. // // To cancel an attack, use the 'cancel' argument instead of specifying a target. // @@ -47,20 +46,16 @@ public AttackCommand() { // // // @Usage - // Use to make an NPC attack a player in an interact script. - // - attack - // - // @Usage - // Use to make an NPC attack a nearby entity. - // - attack target: + // Use to make the player's target entity attack a nearby entity. + // - attack target: // // @Usage - // Use to make a specific entity attack an entity, including players or npcs. + // Use to make a random nearby entity attack a player. // - attack target: // // @Usage - // Use to stop an attack - // - attack stop + // Use to stop an entity from attacking. + // - attack <[entity]> stop // --> @Override