Skip to content

NPCRoleCommand

Package: com.hypixel.hytale.server.npc.commands

public class NPCRoleCommand extends NPCWorldCommandBase

Implements /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.

ArgumentTypeRequiredDescription
roleBuilderInfoyesThe new NPC role (uses NPCCommand.NPC_ROLE argument type)
public NPCRoleCommand()

Registers as sub-command "role" with translation key "server.commands.npc.role.desc". Adds GetRoleCommand as a usage variant.

VariantClassDescription
(no args)NPCRoleCommand.GetRoleCommandDisplays the NPC’s current role
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.