HyperScript
Docs

← All of the Docs HyperCitizens

The nearest NPC, and its name HyperCitizens

expressionnearest npc to <location>HyperCitizens

The NPC closest to that place, in the same world, among those that are in the world right now; unset if there is none

set {_npc} to nearest npc to player's location
expressionnpcs within <n> blocks of <location>HyperCitizens

The NPCs that near a place, the nearest first

for each {_npc} in npcs within 8 blocks of player's location:
    make npc {_npc} swing arm
expressiondespawn npc <npc>HyperCitizens

Take it out of the world without deleting it: it keeps its name, its skin and everything it was told

despawn npc arg.1
effectspawn npc <npc> at <location>HyperCitizens

Put it back in the world. Without at, where it was; one that is in the world already is moved to the place

spawn npc arg.1 at player's location
expressionnpc spawned <npc>HyperCitizens

True while it is in the world

if npc spawned arg.1:
    despawn npc arg.1
    send "&7The NPC is resting."
effecthide name of npc <npc>HyperCitizens

The name over its head is no longer shown, for an NPC that has a hologram instead, or is to pass for a player

hide name of npc arg.1
expressionshow name of npc <npc>HyperCitizens

The name is shown again

show name of npc arg.1
Guide and examples
command /whoisthat:
    trigger:
        set {_npc} to nearest npc to player's location
        if {_npc} is not set:
            send "&7There is no NPC in this world."
            stop
        send "&7The nearest NPC is &f%name of npc {_npc}%&7."
        make npc {_npc} look at player's location

command /rest <npc>:
    permission: "npc.admin"
    trigger:
        if npc spawned arg.1:
            despawn npc arg.1
            send "&7The NPC is resting."
        else:
            spawn npc arg.1 at player's location
            send "&aThe NPC is back, here."

command /wave:
    trigger:
        for each {_npc} in npcs within 8 blocks of player's location:
            make npc {_npc} swing arm

command /nameless <npc>:
    permission: "npc.admin"
    trigger:
        hide name of npc arg.1

command /named <npc>:
    permission: "npc.admin"
    trigger:
        show name of npc arg.1
SyntaxEffect
nearest npc to <location>The NPC closest to that place, in the same world, among those that are in the world right now; unset if there is none
npcs within <n> blocks of <location>The NPCs that near a place, the nearest first
despawn npc <npc>Take it out of the world without deleting it: it keeps its name, its skin and everything it was told
spawn npc <npc> at <location>Put it back in the world. Without at, where it was; one that is in the world already is moved to the place
npc spawned <npc>True while it is in the world
hide name of npc <npc>The name over its head is no longer shown, for an NPC that has a hologram instead, or is to pass for a player
show name of npc <npc>The name is shown again