NPCMultiSelectCommandBase
Package: com.hypixel.hytale.server.npc.commands
public abstract class NPCMultiSelectCommandBase extends NPCWorldCommandBaseAbstract base class for NPC commands that can operate on multiple NPCs simultaneously. Extends NPCWorldCommandBase with spatial selection capabilities: cone-based selection from the player’s view direction, sphere-based selection around the player, ray-based selection (single entity in crosshair), and role-based filtering.
If an explicit entity argument is provided, operates on that single NPC. Otherwise, uses the player’s position and view direction to find NPCs within a configurable cone/sphere. Supports preset selection modes and a nearest-only flag.
Constants
Section titled “Constants”protected static final float DEFAULT_CONE_ANGLE = 30.0Fprotected static final float DEFAULT_RANGE = 8.0Fprotected static final float RANGE_MIN = 0.0Fprotected static final float RANGE_MAX = 2048.0Fprotected static final float CONE_ANGLE_MIN = 0.0Fprotected static final float CONE_ANGLE_MAX = 180.0FFields
Section titled “Fields”@Nonnullprotected final OptionalArg<Float> coneAngleArgOptional cone half-angle in degrees (0—180). Default: 30.
@Nonnullprotected final OptionalArg<Float> rangeArgOptional selection range in blocks (0—2048). Default: 8.
Selection Presets
Section titled “Selection Presets”| Flag | Cone Angle | Nearest Only | Description |
|---|---|---|---|
--cone | 30 | yes | Nearest NPC in a 30-degree cone |
--coneAll | 30 | no | All NPCs in a 30-degree cone |
--sphere | 180 | no | All NPCs in a sphere |
--ray | 0 (raycast) | yes | Single NPC in crosshair |
The --roles argument accepts a comma-separated list of role names to filter results. The --nearest flag restricts to the closest matching NPC.
Constructors
Section titled “Constructors”public NPCMultiSelectCommandBase(@Nonnull String name, @Nonnull String description)public NPCMultiSelectCommandBase(@Nonnull String name, @Nonnull String description, boolean requiresConfirmation)public NPCMultiSelectCommandBase(@Nonnull String description)Methods
Section titled “Methods”@Overrideprotected void execute(@Nonnull CommandContext context, @Nonnull World world, @Nonnull Store<EntityStore> store)Performs spatial NPC selection and delegates to execute for each matched NPC, or to processEntityList for batch processing.
protected void processEntityList(@Nonnull CommandContext context, @Nonnull World world, @Nonnull Store<EntityStore> store, @Nonnull List<Ref<EntityStore>> refs)Iterates over the selected entity references and calls execute for each NPC. Subclasses may override for custom batch behavior.
Known Subclasses
Section titled “Known Subclasses”- NPCDebugCommand.ShowCommand
- NPCDebugCommand.SetCommand
- NPCDebugCommand.ToggleCommand
- NPCDebugCommand.DefaultsCommand
- NPCDebugCommand.ClearCommand
Related Types
Section titled “Related Types”- NPCWorldCommandBase — parent base class for single-NPC commands
- NPCDebugCommand — primary user of this base class