NPCRoleCommand
Package: com.hypixel.hytale.server.npc.commands
public class NPCRoleCommand extends NPCWorldCommandBaseImplements /npc role. Changes the role of a target NPC at runtime by queueing a role change via RoleChangeSystem.requestRoleChange(). If a role change is already pending, the command fails with an error message.
Also provides a usage variant (no role argument) that displays the NPC’s current role name.
Arguments
Section titled “Arguments”| Argument | Type | Required | Description |
|---|---|---|---|
role | BuilderInfo | yes | The new NPC role (uses NPCCommand.NPC_ROLE argument type) |
Constructor
Section titled “Constructor”public NPCRoleCommand()Registers as sub-command "role" with translation key "server.commands.npc.role.desc". Adds GetRoleCommand as a usage variant.
Sub-commands
Section titled “Sub-commands”| Variant | Class | Description |
|---|---|---|
| (no args) | NPCRoleCommand.GetRoleCommand | Displays the NPC’s current role |
Related Types
Section titled “Related Types”- NPCRoleCommand.GetRoleCommand — displays current role
- NPCWorldCommandBase — base class
- NPCCommand — parent command collection
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.