Create a Custom NPC

Non-Player Characters (NPCs) are characters in Minecraft that are non controlled by the player. NPCs can perform commands and deliver dialog when players interact with them, making them excellent tools for creating astonishing narrative and gameplay experiences in Minecraft.

Image showing a custom NPC and dialogue box

In this tutorial, y'all will learn the following:

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

Create an NPC

To create NPCs, make certain that yous are playing in Creative mode with cheats enabled and that you lot have Operator permissions for your world. To collaborate with your custom NPCs, y'all will demand to switch from Creative mode to Survival way or Adventure way.

To create a custom NPC, follow these instructions:

  1. Obtain an NPC spawn egg from the creative menu or by using the command /give @p spawn_egg i 51.
  2. Right-click to place an NPC on your desired block. If you misplace an NPC, you lot 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 express to 32 characters. Y'all tin apply color codes to modify the color of the name text.

NPC Editor Interface

The NPC editor has a built in dialog feature to give players more than information well-nigh the commands they volition execute or to evangelize story details.

This dialog box has a limit of 307 characters before the text goes off the screen. Yous can likewise utilise colour codes to modify the colour of the text.

You can use behaviour packs and commands to create a more advanced dialogue arrangement for your custom NPCs. See NPC Dialogue Control for more information.

Alter NPC skins

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

To change an NPC's peel, follow these instructions:

  1. Right-click the NPC you lot want to edit.
  2. In the Appearance department, click the skin that you want to use for your NPC. You can employ the left and correct 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 role player closes their dialog window. Unlike a Command Cake, a single 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 Control you want to execute. Make sure you only enter one command in this field.
  4. If you want to add more commands, click the Add Command button and enter the commands yous want to enter.

NPC Command Interface

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

Add buttons to an NPC

You tin can also add buttons to an NPC. If you use the Button Mode setting, an NPC command volition be displayed as a button in the NPC'south dialog box. Players who collaborate with that NPC can click the appropriate button to execute that control.

To add buttons to an NPC, follow these instructions:

  1. Correct-click the NPC you want to edit.
  2. Click Avant-garde Settings.
  3. Enter the Control you want to execute. Brand sure you only enter one command in this field.
  4. Activate Push button Manner and enter the push text in the new field. NPC Button Mode
  5. If you want to add more buttons, click the Add Command push and repeat this process.

Once y'all have added your push button commands, your NPC volition display the command buttons in club after their dialog when players collaborate with them.

NPC Interaction

What's Adjacent?

With the NPC created and the get-go dialogue box has been created, y'all can learn how to create branching dialogue boxes to design your own custom narrative driven content.