HyperScript
Docs

← All of the Docs HyperCitizens

Making and removing HyperCitizens

effectcreate npc <name> at <location>HyperCitizens

Make an NPC that looks like a player

create npc "&aGuide" at player's location
effectcreate npc <name> as <kind> at <location>HyperCitizens

Make one that is a creature: "villager", "cow", "zombie" and so on

create npc "Rex" as "wolf" at player's location
effectdelete npc <npc>HyperCitizens

Remove an NPC for good

delete npc "Guide"
expressionrename npc <npc> to <name>HyperCitizens

Give it another name; colour codes work

rename npc {guide} to arg.1
effectset skin of npc <npc> to <player name>HyperCitizens

For an NPC that looks like a player: whose skin it wears

set skin of npc last created npc to "Notch"
expressionlast created npcHyperCitizens

The number of the NPC create npc made most recently

set {guide} to last created npc
Guide and examples
command /setguide:
    permission: "npcs.manage"
    players only: true
    trigger:
        create npc "&aGuide" at player's location
        set skin of npc last created npc to "Notch"
        set {guide} to last created npc
        send "&aThe guide stands here now (number %{guide}%)."

command /setcow:
    permission: "npcs.manage"
    players only: true
    trigger:
        create npc "Bessie" as "cow" at player's location

command /nameguide <name>:
    permission: "npcs.manage"
    trigger:
        rename npc {guide} to arg.1
        send "&aThe guide is now called %arg.1%."

command /removeguide:
    permission: "npcs.manage"
    trigger:
        delete npc "Guide"
SyntaxEffect
create npc <name> at <location>Make an NPC that looks like a player
create npc <name> as <kind> at <location>Make one that is a creature: "villager", "cow", "zombie" and so on
delete npc <npc>Remove an NPC for good
rename npc <npc> to <name>Give it another name; colour codes work
set skin of npc <npc> to <player name>For an NPC that looks like a player: whose skin it wears
last created npcThe number of the NPC create npc made most recently
  • <npc> is an NPC's number or its name: delete npc 3, delete npc "Guide". A name is compared without colours. The number never changes and is the safe one to keep in a variable.
  • An NPC nobody knows is reported in the console and nothing happens.
  • Run create npc once, from a command; an on load: block would make another one at every reload.