Commands - MarkusBordihn/BOs-Easy-NPC GitHub Wiki
Although most settings can be configured through the user interface, several commands are available for controlling NPCs. 🛠️ These commands can be used in dialogues, command blocks, or scripts, allowing for more complex interactions and task automation. This also makes it possible to use NPCs with other mods or plugins that can execute commands.
🔹 Note: Most commands require the NPC's UUID as the first argument. Luckily, there's an autocomplete feature, so you don't need to memorize UUIDs - just target the NPC to get an autocomplete suggestion! 🤖💡
Use /easy_npc configure <NPC> to open the configuration screen for a specific NPC.
This is a great way to fine-tune your NPC settings quickly! 📝
The debug command toggles debug mode for NPCs, helping with troubleshooting. 🔧
➡️ See the Debugging page for more details.
The delete command allows you to remove an NPC from the game:
/easy_npc delete <NPC>💥 Use this carefully - it permanently deletes the NPC!
Open a dialogue for a player with:
/easy_npc dialog open <NPC> <Player>Open a specific dialogue entry:
/easy_npc dialog open <NPC> <Player> <DialogLabel>Set a default dialogue with:
/easy_npc dialog set default <NPC> <DialogLabel>➡️ Check out the Dialogs page for more details on creating engaging conversations.
Equip your NPC with items using:
/easy_npc equipment set <NPC> <Slot> <Item>Example: Equip a dragon head! 🐲
/easy_npc equipment set <NPC> armor.head minecraft:dragon_headOr why not equip a bucket? 🪣
/easy_npc equipment set <NPC> armor.head minecraft:bucketRemove an item from a slot:
/easy_npc equipment remove <NPC> <Slot>Example: Remove the item from the head slot:
/easy_npc equipment remove <NPC_UUID> armor.head➡️ For more details, visit the Equipment page.
Make an NPC interact with a block using:
/easy_npc interact <NPC> <Block Pos>Reset NPC navigation:
/easy_npc navigation reset <NPC>Set an NPC's home position:
/easy_npc navigation set home <NPC> <Block Pos>Set an NPC's current position:
/easy_npc navigation set pos <NPC> <Block Pos>✨ Since Version 6.x
Manage NPC names, colors, and visibility settings.
Set NPC name:
/easy_npc name set <NPC> <Name>Set name with color:
/easy_npc name set <NPC> <Name> <Color>Set name with color and visibility:
/easy_npc name set <NPC> <Name> <Color> <Visibility>Change name color only:
/easy_npc name color <NPC> <Color>Change name visibility:
/easy_npc name visibility <NPC> <VisibilityType>Available colors: white, black, red, green, blue, yellow, gold, aqua,
dark_red, etc.
Visibility types: ALWAYS, NEVER, HOVER (show only when looking at NPC)
Examples:
/easy_npc name set @e[type=easy_npc:humanoid,limit=1] "Merchant Bob" gold ALWAYS
/easy_npc name visibility @e[type=easy_npc:humanoid,limit=1] HOVERManage NPC objectives with this command.
Make an NPC follow an entity:
/easy_npc objective <NPC> set follow entity <Entity>Make an NPC follow its owner:
/easy_npc objective <NPC> set follow ownerMake an NPC follow a player:
/easy_npc objective <NPC> set follow player <Player>Stop following:
/easy_npc objective <NPC> remove follow entity
/easy_npc objective <NPC> remove follow owner
/easy_npc objective <NPC> remove follow playerList current follow objectives:
/easy_npc objective <NPC> list follow➡️ More info on Objectives.
Manage the owner of an NPC.
Set an owner:
/easy_npc owner set <NPC> <Player>Remove an owner:
/easy_npc owner remove <NPC>List the owner:
/easy_npc owner get <NPC>Import or export NPC presets easily.
➡️ More info on Presets.
✨ Since Version 6.x
Reload an NPC to refresh its configuration and data:
/easy_npc reload <NPC>This command forces the NPC to reload its data, which can be useful for:
- Applying configuration changes
- Fixing rendering issues
- Refreshing NPC state
Set custom models for NPCs.
Use this to set a custom model:
/easy_npc render set entity <NPC> <EntityType>Example: Render an NPC as a spider 🕷️:
/easy_npc render set entity <NPC> "minecraft:spider"Revert to the default model:
/easy_npc render set type <NPC> DEFAULT➡️ Visit Custom Models for more info.
Respawn an NPC with:
/easy_npc respawn <NPC>✨ Since Version 6.x
Scale the entire NPC or individual body parts.
Scale uniformly (all axes):
/easy_npc scale <NPC> <ModelPart> <Scale>Scale with individual axis values:
/easy_npc scale <NPC> <ModelPart> <X> <Y> <Z>Examples:
Scale the entire NPC to 2x size:
/easy_npc scale @e[type=easy_npc:humanoid,limit=1] root 2.0Make the head larger:
/easy_npc scale @e[type=easy_npc:humanoid,limit=1] head 1.5Make arms longer (Y-axis):
/easy_npc scale @e[type=easy_npc:humanoid,limit=1] left_arm 1.0 1.5 1.0
/easy_npc scale @e[type=easy_npc:humanoid,limit=1] right_arm 1.0 1.5 1.0Available model parts: root, head, body, left_arm, right_arm, left_leg, right_leg,
and more depending on the NPC model.
➡️ More info on Scaling.
✨ Since Version 6.x
Set a default sound for an NPC:
/easy_npc sound set <NPC> <Sound Type> <ResourceLocation>Available sound types: HURT, DEATH, AMBIENT, STEP
Example: Set a hurt sound:
/easy_npc sound set <NPC> HURT minecraft:entity.zombie.hurtExample: Set ambient sound:
/easy_npc sound set <NPC> AMBIENT minecraft:entity.villager.ambient✨ Since Version 6.x
Configure spawner block parameters:
/easy_npc spawner set <BlockPos> <Parameter> <Value>Available parameters:
-
Delay- Time between spawn attempts (ticks) -
MinSpawnDelay- Minimum delay before next spawn -
MaxSpawnDelay- Maximum delay before next spawn -
SpawnCount- Number of NPCs per activation -
MaxNearbyEntities- Maximum nearby entities allowed -
RequiredPlayerRange- Player detection range -
SpawnRange- Area around spawner for spawning
Examples:
/easy_npc spawner set ~0 ~-1 ~0 Delay 1200
/easy_npc spawner set ~0 ~-1 ~0 SpawnCount 2
/easy_npc spawner set ~0 ~-1 ~0 RequiredPlayerRange 32➡️ More info on Spawner.
Manage NPC trading.
Reset trading offers:
/easy_npc trading reset <NPC>Open the trading screen:
/easy_npc trading open <NPC> <Player>➡️ For more on trading, see Trading.
These commands help you take full control of your NPCs and create a richer gameplay experience! 🚀