HyperScript
Docs

← All of the Docs HyperCitizens

How an NPC looks and behaves HyperCitizens

effectset tool of npc <npc> to <item>HyperCitizens

What it holds. Also offhand, helmet, chestplate, leggings and boots; to nothing empties the slot

set tool of npc {guard} to nothing
effectadd hologram line <text> to npc <npc>HyperCitizens

A line of floating text above it

add hologram line "&7Right-click to talk" to npc {guard}
effectclear hologram of npc <npc>HyperCitizens

Take that text away

clear hologram of npc {guard}
effectmake npc <npc> watch playersHyperCitizens

It turns to look at whoever comes near

make npc {guard} watch players
effectmake npc <npc> stop watchingHyperCitizens

It looks ahead again

make npc {guard} stop watching
effectmake npc <npc> follow <who>HyperCitizens

It walks after a player

make npc last created npc follow player
effectmake npc <npc> stop followingHyperCitizens

It stays where it is

make npc "Rex" stop following
effectmake npc <npc> patrol <location>, <location>HyperCitizens

It walks from place to place and round again; give two or more

make npc {guard} patrol {gate.north}, {gate.south}
effectmake npc <npc> stop patrollingHyperCitizens

It stops where it is

make npc {guard} stop patrolling
effecthide npc <npc> from <who>HyperCitizens

That player no longer sees the NPC; everybody else still does. from all players hides it from everyone who is on now

hide npc "ghost" from arg.1
expressionshow npc <npc> to <who>HyperCitizens

They see it again

show npc "ghost" to arg.1
effectmake npc <npc> swing armHyperCitizens

One swing of its arm, as when it hits something

make npc {_npc} swing arm
Guide and examples
command /setguard:
    permission: "npcs.manage"
    players only: true
    trigger:
        create npc "&cGuard" at player's location
        set {guard} to last created npc
        set tool of npc {guard} to diamond sword
        set helmet of npc {guard} to iron helmet
        set chestplate of npc {guard} to iron chestplate
        add hologram line "&7Right-click to talk" to npc {guard}
        make npc {guard} watch players

command /guardpatrol:
    permission: "npcs.manage"
    trigger:
        make npc {guard} patrol {gate.north}, {gate.south}

command /pet:
    players only: true
    trigger:
        create npc "Rex" as "wolf" at player's location
        make npc last created npc follow player

command /petstay:
    trigger:
        make npc "Rex" stop following

command /guardrest:
    permission: "npcs.manage"
    trigger:
        make npc {guard} stop patrolling
        make npc {guard} stop watching
        set tool of npc {guard} to nothing
        clear hologram of npc {guard}
SyntaxEffect
set tool of npc <npc> to <item>What it holds. Also offhand, helmet, chestplate, leggings and boots; to nothing empties the slot
add hologram line <text> to npc <npc>A line of floating text above it
clear hologram of npc <npc>Take that text away
make npc <npc> watch playersIt turns to look at whoever comes near
make npc <npc> stop watchingIt looks ahead again
make npc <npc> follow <who>It walks after a player
make npc <npc> stop followingIt stays where it is
make npc <npc> patrol <location>, <location>It walks from place to place and round again; give two or more
make npc <npc> stop patrollingIt stops where it is
hide npc <npc> from <who>That player no longer sees the NPC; everybody else still does. from all players hides it from everyone who is on now
show npc <npc> to <who>They see it again
make npc <npc> swing armOne swing of its arm, as when it hits something
  • Equipment, floating text, watching and following are kept by Citizens and are still there after a restart. A patrol is kept by HyperCitizens only while the server runs: start it again from an on server start: block.
  • An item given as equipment keeps its name; an enchanted or glowing one shimmers.