Create a Custom NPC

Not-Histrion Characters (NPCs) are characters in Minecraft that are not controlled past the player. NPCs can perform commands and deliver dialog when players collaborate with them, making them excellent tools for creating amazing narrative and gameplay experiences in Minecraft.

Image showing a custom NPC and dialogue box

In this tutorial, yous volition learn the post-obit:

  • How to create an NPC.
  • How to modify NPC skins.
  • How to add commands to an NPC.
  • How to add buttons to an NPC.

Create an NPC

To create NPCs, make sure that you are playing in Creative mode with cheats enabled and that you have Operator permissions for your world. To collaborate with your custom NPCs, you will need to switch from Creative mode to Survival mode or Hazard mode.

To create a custom NPC, follow these instructions:

  1. Obtain an NPC spawn egg from the creative menu or past using the command /requite @p spawn_egg one 51.
  2. Correct-click to place an NPC on your desired cake. If yous misplace an NPC, you can left-click to despawn them.
  3. Right-click your new NPC to open the NPC interface.
  4. Enter a name for your NPC. Names are limited to 32 characters. Yous can use color codes to change the color of the name text.

NPC Editor Interface

The NPC editor has a congenital in dialog characteristic to give players more information about the commands they will execute or to evangelize story details.

This dialog box has a limit of 307 characters before the text goes off the screen. You lot tin can also employ colour codes to change the color of the text.

You can utilize behaviour packs and commands to create a more avant-garde dialogue system for your custom NPCs. Run into NPC Dialogue Command for more information.

Change NPC skins

You can choose from a list of skins to customize the advent of your NPC.

To alter an NPC's skin, follow these instructions:

  1. Right-click the NPC yous want to edit.
  2. In the Appearance section, click the skin that you want to use for your NPC. You lot tin employ the left and right arrow buttons to see more skins.

Add commands to an NPC

You can add commands to an NPC that the NPC will execute after a player closes their dialog window. Different a Command Cake, a unmarried NPC can execute multiple commands.

To add commands to an NPC, follow these instructions:

  1. Right-click the NPC you want to edit.
  2. Click Advanced Settings.
  3. Enter the Command y'all want to execute. Make sure you only enter one command in this field.
  4. If you want to add more commands, click the Add together Control push button and enter the commands you want to enter.

NPC Command Interface

Your NPC will execute these commands in order whenever a player interacts with them and closes their dialog box. For a list of commands that your NPCs tin execute, see Commands.

Add together buttons to an NPC

You can also add buttons to an NPC. If you apply the Button Mode setting, an NPC command will be displayed as a button in the NPC's dialog box. Players who interact with that NPC can click the appropriate button to execute that control.

To add buttons to an NPC, follow these instructions:

  1. Right-click the NPC yous want to edit.
  2. Click Advanced Settings.
  3. Enter the Command y'all want to execute. Make sure you only enter one command in this field.
  4. Activate Push button Mode and enter the button text in the new field. NPC Button Mode
  5. If you want to add more buttons, click the Add Command button and repeat this process.

Once you have added your push button commands, your NPC volition display the command buttons in social club after their dialog when players interact with them.

NPC Interaction

What'due south Next?

With the NPC created and the first dialogue box has been created, you lot can learn how to create branching dialogue boxes to pattern your own custom narrative driven content.