Class NPCMultiSelectCommandBase
- Direct Known Subclasses:
NPCDebugCommand.ClearCommand, NPCDebugCommand.DefaultsCommand, NPCDebugCommand.SetCommand, NPCDebugCommand.ShowCommand, NPCDebugCommand.ToggleCommand
If an entity argument is provided, it will target that entity (must be an NPC). Otherwise, the sender must be a player or an error is sent.
If the sender is a player, the command will select one or multiple NPC entities close to the players camera position. A "range" option is provided to limit the search distance, and an "angle" option to specify a search view cone angle. Additionally, a "roles" option is provided to filter the NPCs by their role names. A "nearest" flag is also provided to only select the nearest NPC in the view cone.
An angle of 0 degrees does a ray test directly along the players view direction. An angle of 180 degrees selects a full sphere around the player. Any other angle between 0 and 180 degrees selects a view cone with the specified angle used as half-angle for the cone.
There are also presets to simplify common use cases:
- "cone": View cone with a 30-degree angle, only nearest NPC
- "coneAll": View cone with a 30-degree angle, all NPC in view cone
- "sphere": Sphere, all NPCs in range
- "ray": Ray test hit, only the nearest NPC
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractCommand
AbstractCommand.SuggestionOverrideEntry -
Field Summary
Fields inherited from class AbstractCommand
EMPTY_STRING_ARRAY, LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionNPCMultiSelectCommandBase(String description) This constructor is specifically only for variant commands, added withAbstractCommand.addUsageVariant(AbstractCommand).NPCMultiSelectCommandBase(String name, String description) Default Constructor for anNPCMultiSelectCommandBaseinstance.NPCMultiSelectCommandBase(String name, String description, boolean requiresConfirmation) Constructor for anNPCMultiSelectCommandBaseinstance. -
Method Summary
Methods inherited from class AbstractAsyncCommand
runAsyncMethods inherited from class AbstractCommand
acceptCall, addAliases, addSubCommand, addUsageVariant, completeRegistration, countParents, getAliases, getDescription, getFullyQualifiedName, getName, getOptionalArgument, getOptionalArguments, getOwner, getPermission, getPermissionGroups, getPermissionGroupsRecursive, getRequiredArguments, getSubCommand, getSubCommands, getSuggestionOverrides, getUsageShort, getUsageString, getVariantByArgCount, getVariantCommands, hasBeenRegistered, hasPermission, isVariant, matches, putRecursivePermissionGroups, requireNoPermission, requirePermission, requirePermission, setAllowsExtraArguments, setOwner, withDefaultArg, withDefaultArg, withFlagArg, withListDefaultArg, withListOptionalArg, withListRequiredArg, withOptionalArg, withOptionalArg, withRequiredArg, withRequiredArg
-
Constructor Details
-
NPCMultiSelectCommandBase
Default Constructor for anNPCMultiSelectCommandBaseinstance.- Parameters:
name- The name of the command.description- The description of the command.
-
NPCMultiSelectCommandBase
public NPCMultiSelectCommandBase(@Nonnull String name, @Nonnull String description, boolean requiresConfirmation) Constructor for anNPCMultiSelectCommandBaseinstance.- Parameters:
name- The name of the command.description- The description of the command.requiresConfirmation- Whether the command requires additional confirmation.
-
NPCMultiSelectCommandBase
This constructor is specifically only for variant commands, added withAbstractCommand.addUsageVariant(AbstractCommand).- Parameters:
description- The description of the command.
-