NPCGiveCommand
Package: com.hypixel.hytale.server.npc.commands
public class NPCGiveCommand extends NPCWorldCommandBaseImplements /npc give. Gives an item to a target NPC. If the item has an Armor configuration, it is applied as armor via RoleUtils.setArmor(). Otherwise, it is placed in the NPC’s hand via RoleUtils.setItemInHand().
Also provides a nothing sub-command to clear the NPC’s held item.
Arguments
Section titled “Arguments”| Argument | Type | Required | Description |
|---|---|---|---|
item | Item | yes | The item asset to give to the NPC |
Constructor
Section titled “Constructor”public NPCGiveCommand()Registers as sub-command "give" with translation key "server.commands.npc.give.desc". Adds GiveNothingCommand as a sub-command.
Sub-commands
Section titled “Sub-commands”| Sub-command | Class |
|---|---|
nothing | NPCGiveCommand.GiveNothingCommand |
Related Types
Section titled “Related Types”- NPCGiveCommand.GiveNothingCommand — clears the NPC’s held item
- 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.