Actions - MarkusBordihn/BOs-Easy-NPC GitHub Wiki
Actions 🎮
Enhance the interactivity of your NPC with powerful actions beyond the confines of this mod. Dive into some basic examples:
/say Hello, ...
👋/give @initiator stone
🎁/scoreboard players add @initiator close 5
📊/tp @initiator -28 63 399
🚀
Default permissions restrict certain actions, ensuring standard users can't wield commands
like /give
or /tp
. Actions can trigger in response to specific events such as player
interaction, NPC damage, NPC demise, player-NPC proximity, or even the opening and closing of
dialogs.
Action Options 🛠️
The Action Options screen empowers you with the following customization:
- Check
Execute as player
to run commands with the interacting player's permission level. - Activate
Debug
for debug mode, providing insights into script errors and more.
Action Placeholders 🧩
The action text embraces placeholders for a personalized touch:
Placeholder | Description |
---|---|
@npc | Name of the NPC |
@npc-uuid | UUID of the NPC |
@initiator | Name of the initiator of the dialog |
@initiator-uuid | UUID of the initiator of the dialog |
NPC-Specific Commands 🤖
Unlock NPC-specific commands for more intricate actions. For instance, open a trading screen during a dialog action using:
/easy_npc trading open @npc-uuid
Action Types 🚀
Explore various action types available for your NPC:
Basic Actions 🔄
Define fundamental actions such as player interaction, NPC injury, and NPC demise.
Dialog Actions 💬
Specify actions for each dialog entry, like opening or closing the dialog screen, or clicking on a dialog button.
Distance Actions 📏
Set actions based on player proximity:
- Near (distance <= 16 Blocks)
- Close (distance <= 8 Blocks)
- Very Close (distance <= 4 Blocks)
- In Touch (distance <= 1 Block)
Actions trigger only once within range, with the potential for re-triggering upon player re-entry.