-
-
Notifications
You must be signed in to change notification settings - Fork 8
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.
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.
Each action has options to customize how it works.
The action type decides what the action will do. For example, the command action lets you define the command and who it targets.
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 the dialog screen after the action is completed.
Trigger an interaction with a block from the NPC.
Open the trading screen for the NPC.
Open the default dialog for the NPC.
Open a specific dialog for the NPC, the dialog name will be validated.
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 |
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 ~
Explore the different types of actions you can set up for your NPC:
Set up basic actions like player interaction, NPC getting hurt, or NPC dying.
Define actions for dialog entries, like opening or closing the dialog screen, or clicking on a dialog button.
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.
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.