Actions - MarkusBordihn/BOs-Easy-NPC GitHub Wiki
Actions 🎮
Make your NPC more interactive with powerful actions. Here are some basic examples:
/say Hello, ...
👋/give @initiator stone
🎁/scoreboard players add @initiator close 5
📊/tp @initiator -28 63 399
🚀
Default permissions limit certain actions, so regular players can't use commands like /give
or
/tp
.
Actions can be triggered by specific events such as interacting with a player, NPC getting hurt, NPC
dying, player getting close to the NPC, or even opening and closing dialogs.
Action List 📜
You can set up multiple actions for an event or a dialog button. Actions are performed in the order you list them.
You can change the order by using the up and down buttons.
Action Entry 🛠️
Each action has options to customize how it works.
Action Type
The action type decides what the action will do. For example, the command action lets you define the command and who it targets.
Command
Run a command with a specified target.
- Check
Execute as player
to run commands using the player's permission level. - Turn on
Debug
to get insights into errors and more while testing.
Close Dialog
Close the dialog screen after the action is completed.
Interact Block
Trigger an interaction with a block from the NPC.
Open Trading Screen
Open the trading screen for the NPC.
Open Default Dialog
Open the default dialog for the NPC.
Open Named Dialog
Open a specific dialog for the NPC, the dialog name will be validated.
Action Placeholders 🧩
You can use placeholders in actions for a personal touch:
Placeholder | Description |
---|---|
@npc | Name of the NPC |
@npc-uuid | UUID of the NPC |
@initiator | Name of the player who started the dialog |
@initiator-uuid | UUID of the player who started the dialog |
NPC-Specific Commands 🤖
Use NPC-specific commands for more advanced actions. For example, you can open a trading screen during a dialog, open a specific dialog, or interact with a block.
Examples:
/easy_npc trading open @npc
/easy_npc dialog open @npc @initiator <dialog-name>
/easy_npc interact block @npc-uuid ~1 ~1 ~
Action Types 🚀
Explore the different types of actions you can set up for your NPC:
Basic Actions 🔄
Set up basic actions like player interaction, NPC getting hurt, or NPC dying.
Dialog Actions 💬
Define actions for dialog entries, like opening or closing the dialog screen, or clicking on a dialog button.
Distance Actions 📏
Trigger actions based on how close the player is:
- Near (within 16 Blocks)
- Close (within 8 Blocks)
- Very Close (within 4 Blocks)
- In Touch (within 1 Block)
Actions trigger once when in range, but can reset and trigger again if the player leaves and re-enters.
Default Interaction Actions 🎯
When players interact with an NPC, it automatically includes the Open Default Dialog
and
Open Trading
actions by default.
These actions will only be triggered if a dialog or trading screen is set up for the NPC.
If you prefer not to use these default actions, you can easily remove them under Actions -> Basic Actions -> On Interaction
They are only added when the NPC is first spawned and won't be re-added once removed.