effectcreate npc <name> at <location>since 1.7.23example
Make a character there, a villager unless said otherwise. With a name that is taken, the character is moved. Colours in the name are shown; it is known by the name without them, in lower case
command /setguide:
permission: npc.admin
players only: true
trigger:
create npc "&aGuide" at player's location
send "&aThe guide stands here now."
The creature itself, for what works on a creature: set name of npc "guide" to "...", make player ride npc "guide", remove entity npc "guide". To move a character, create npc it again at the new place
command /announce:
permission: npc.admin
trigger:
make npc "guide" say "The event starts in five minutes!"
A character is a creature that stands where you put it, cannot be hurt or pushed, and runs a block of your script when a player clicks it: a shopkeeper, a quest giver, a guide.
on load:
create npc "&aGuide" at 10.5, 64, -3.5 in "world"
on npc click "guide":
send "&aGuide: &fWelcome, %player%! The shop is to your left."
Syntax
Meaning
create npc <name> at <location>
Make a character there, a villager unless said otherwise. With a name that is taken, the character is moved. Colours in the name are shown; it is known by the name without them, in lower case
create npc <name> as <entity> at <location>
The same as another creature: as iron golem, as armor stand
delete npc <name>
Take a character away
on npc click <name>:
At the left margin: runs when a player right-clicks that character; without a name, any character. {_npc} is its name
npc <name>
The creature itself, for what works on a creature: set name of npc "guide" to "...", make player ride npc "guide", remove entity npc "guide". To move a character, create npc it again at the new place
all npcs
A list of the names of every character
Characters are remembered: they are still there, and still known by their names, after a restart. Making one in on load: is safe, because making it again only moves it.
A character here cannot look like a player. That takes the Citizens plugin and the HyperCitizens addon, which also give characters that walk routes and follow players. With HyperCitizens installed, create npc and on npc click are its, and make Citizens characters.