Class NPCWorldCommandBase

Direct Known Subclasses:
NPCAppearanceCommand, NPCAttackCommand.ClearAttackCommand, NPCAttackCommand.SetAttackCommand, NPCDumpCommand, NPCGiveCommand, NPCGiveCommand.GiveNothingCommand, NPCMultiSelectCommandBase, NPCPathCommand.PolygonPathCommand, NPCPathCommand.SetPathCommand, NPCRoleCommand, NPCRoleCommand.GetRoleCommand

public abstract class NPCWorldCommandBase extends AbstractWorldCommand
A command base that runs directly on the thread of the target world and provides access to an NPC entity.

The command will target an NPC entity based on the following priority:

  1. If an entity argument is provided, it will target that entity (must be an NPC)
  2. If the sender is a player, it will target the NPC entity in view (ray-cast)
  3. Otherwise, an error message is sent

This command base ensures thread safety by executing on the world thread, and provides access to the NPC entity's NPCEntity, Store, Ref, and World.

  • Constructor Details

    • NPCWorldCommandBase

      public NPCWorldCommandBase(@Nonnull String name, @Nonnull String description)
      Default Constructor for an NPCWorldCommandBase instance.
      Parameters:
      name - The name of the command.
      description - The description of the command.
    • NPCWorldCommandBase

      public NPCWorldCommandBase(@Nonnull String name, @Nonnull String description, boolean requiresConfirmation)
      Constructor for an NPCWorldCommandBase instance.
      Parameters:
      name - The name of the command.
      description - The description of the command.
      requiresConfirmation - Whether the command requires additional confirmation.
    • NPCWorldCommandBase

      public NPCWorldCommandBase(@Nonnull String description)
      This constructor is specifically only for variant commands, added with AbstractCommand.addUsageVariant(AbstractCommand).
      Parameters:
      description - The description of the command.