Datapack

Interactive NPC Builder

Build a lightweight NPC datapack with statements, clickable options and commands.

Base Settings

Dialogue

Statements

About the NPC generator

An NPC in vanilla Minecraft is an ordinary entity configured so it behaves like a character: it does not wander, does not take damage, carries a visible name and responds when a player interacts with it. Assembling that behaviour means combining several pieces of entity data correctly.

How to use this generator

Choose the entity to use as a base, give it a name, and select the behaviour flags that make it stationary and safe. The generator produces the summon command or datapack files needed to place the finished NPC in the world.

Things worth knowing

  • NoAI stops movement and pathfinding but the entity can still be pushed unless it is also made invulnerable.
  • Invulnerable prevents damage from every source except the void and commands.
  • Silent suppresses ambient sounds, which matters when several NPCs stand near each other.
  • Interaction responses are usually driven by a datapack function rather than by the entity itself.

The generated command is produced entirely in your browser and nothing you enter is sent to EloTiers. Paste the result into the chat bar or a command block in your own world. If a command is rejected, check that the Minecraft version selected here matches the version you are actually running — the item and entity data format changed substantially in 1.20.5.

Worked examples

A stationary villager

/summon minecraft:villager ~ ~ ~ {NoAI:1b,Invulnerable:1b,Silent:1b,PersistenceRequired:1b}

The villager stands still, cannot be damaged, stays quiet and never despawns. Add a name and a tag to turn it into a named character.

Tagging an NPC for functions

/summon minecraft:villager ~ ~ ~ {NoAI:1b,Invulnerable:1b,Tags:["npc","guide"]}

Tags let datapack functions find this exact entity later with a selector such as @e[tag=guide].

Frequently asked questions

Why can players still push my NPC?

NoAI stops movement and pathfinding, but collision still applies. Making the entity invulnerable protects it from damage, and some builders place it inside a one block alcove to stop pushing.

How do I make an NPC respond when clicked?

Vanilla entities have no built-in dialogue. Responses are usually driven by a datapack function that runs when a player interacts, with the NPC entity as the thing it attaches to.

Will the NPC survive a server restart?

Yes, as long as it is persistent. The PersistenceRequired flag keeps mobs from despawning when no player is nearby.