

If On Exit is toggled, then the command will trigger when the player ends and interaction and closes the NPC dialogue. In this case, with On Enter toggled on and the command /give gold_ingot, players would receive one gold ingot in their inventory when the dialogue box opens on dialogue initiation with the NPC. If On Enter is toggled, then the command will run when players initiate a conversation with the NPC. This command will only run if the button is pressed.įor example, we could use a combination of the command /give gold_ingot and a button labelled Money? When players click the Money? button, they receive one gold ingot into their inventory. If Button Mode is toggled on, a text box appears where you can enter text that will appear on a button.

There are settings to customize the way commands work with NPCs. For a list of commands that your NPCs can execute, see Commands. Your NPC will execute these commands in order whenever a player interacts with them and closes their dialog box.

See NPC Dialogue Command for more information. You can use behavior packs and commands to create a more advanced dialogue system for your custom NPCs. You can also use color codes to change the color of the text. This dialog box has a limit of 307 characters before the text goes off the screen. The NPC editor has a built in dialog feature to give players more information about the commands they will execute or to deliver story details. You can use color codes to change the color of the name text.
