HyperScript
Docs

← All of the Docs The world

Worlds and regions

effectset time in world <name> to <ticks>since 1.4.0

Time of day: 0 is sunrise, 1000 day, 6000 noon, 13000 night, 18000 midnight

set time in world "%player.world%" to 1000
Try it
effectset weather in world <name> to <weather>since 1.4.0

clear, rain or thunder

set weather in world "%player.world%" to clear
Try it
effectset block at <position> to <block>since 1.5.5

Replace the block there. The block is a Minecraft block name in plain words (gold block, oak planks, air), checked when the script loads, or any value holding one

set block at player's location to air
Try it
effectset <variable> to <block name>since 1.7.65

Keep a kind of block in a variable, by its name in plain words: set {_block} to red concrete. Capitals do not matter, and the name is checked when the script loads. set block at {_spot} to {_block} then places it

command /rainbow:
    trigger:
        set {_block1} to Red concrete
        set {_block2} to Orange concrete
        set {_block3} to Yellow concrete
        set {_spot} to player's location
        set block at {_spot} to {_block1}
        wait 1 second
        set block at {_spot} to {_block2}
        wait 1 second
        set block at {_spot} to {_block3}
Try it
expressionplace <block> at <position>since 1.7.67

Another way to say set block at <position> to <block>: place stone at {_loc}

set {_loc} to location below player's location
place gold block at {_loc}
Try it
expressionblock data at <position>since 1.7.67

The block that is there with its details: which way stairs face, whether a door is open, which half a slab is. Keep it in a variable and set block at {_loc} to {_data} puts the same block back, the same way round. What is inside a chest and what a sign says are not part of it

command /turnback:
    trigger:
        set {_loc} to location below player's location
        set {_data} to block data at {_loc}
        set block at {_loc} to air
        wait 3 seconds
        set block at {_loc} to {_data}
Try it
expressionblock at <position>since 1.5.5

The type of block that is there now, as Minecraft names it: stone, gold_block. Comparing takes "gold block" and "gold_block" for the same name

if block at player's location is "water":
    send "&bYou are standing in water."
Try it
effectcreate region <name> from <location> to <location>since 1.4.0

Define (or redefine) a region by two opposite corners; both corner blocks are included

create region "spawn_protection" from -20, 0, -20 to 20, 255, 20 in "world"
Try it
effectdelete region <name>since 1.4.0

Remove it

delete region "spawn"
Try it
effectspawn firework at <location>since 1.7.1

Launch a firework; add colored red, blue, shaped star and with power 2 as wanted

spawn firework at player's location colored red, yellow shaped star with power 1
Try it
effectplay effect <name> at <location>since 1.7.1

A built-in visual such as smoke, ender_signal or mobspawner_flames

play effect ender_signal at player's location
Try it
effectset line <n> of sign at <location> to <text>since 1.7.1

Write on a sign; line <n> of sign at <location> reads it

set line 1 of sign at {shop.sign} to "&a[Open]"
Try it
expressionitems in chest at <location>since 1.7.1

A list of the items in a chest or other container

for each {_item} in items in chest at {reward.chest}:
    give {_item} to player
Try it
effectadd <item> to chest at <location> / clear chest at <location>since 1.7.1

Put items in a container, or empty it

clear chest at {reward.chest}
add 3 diamond to chest at {reward.chest}
Try it
effectremove <item> from chest at <location>since 1.7.44

Take items of that kind out of a container: as many as are asked for, and no more than there are. remove 5 diamond from chest at {_chest}

remove 5 gold ingot from chest at {_chest}
Try it
expressionnumber of <item> in chest at <location>since 1.7.44

How many of that item the container holds, over all its slots

set {_gold} to number of gold ingot in chest at {_chest}
Try it
expressionchest slot <n> at <location>since 1.7.44

The item in one slot of a container, counting from 1; unset for an empty slot. It can be set: set chest slot 1 at {_chest} to diamond sword, and emptied with delete chest slot 1 at {_chest}

delete chest slot 3 at {_chest}
Try it
effectset gamerule <name> of world <name> to <value>since 1.7.1

Change a game rule; gamerule <name> of world <name> reads it. Old and new rule names both work on every version: keepInventory or keep_inventory, doDaylightCycle or advance_time

set gamerule keepInventory of world "world" to true
Try it
effectset difficulty of world <name> to <level>since 1.7.1

peaceful, easy, normal or hard; difficulty of world <name> reads it

set difficulty of world "world" to hard
Try it
effectset pvp of world <name> to <true or false>since 1.7.1

Whether players can hurt each other in that world

set pvp of world "world" to false
Try it
effectset pvp of region <name> to <true or false>since 1.7.1

The same for one region; HyperScript stops the fighting itself

on load:
    set pvp of region "spawn" to false
Try it
effectset build of region <name> to <true or false>since 1.7.1

Whether blocks can be broken and placed in a region

on load:
    set build of region "spawn" to false
Try it
expressionplayers in region <name>since 1.7.1

A list of the names of the players inside

for each {_name} in players in region "arena":
    send "&cThe match starts now!" to {_name}
Try it
expressionentities in region <name>since 1.7.44

A list of the creatures inside, players not among them

set {_inside} to size of entities in region "arena"
Try it
expressionrandom location in region <name>since 1.7.44

A place somewhere inside the region, in the middle of a block; unset if there is no such region

set {_spot} to random location in region "arena"
Try it
effectspawn of world <name>since 1.7.1

The world's spawn point, as a location

teleport player to spawn of world "world"
Try it
effectcreate hologram <name> at <location> with lines <text>, <text>since 1.7.2

Floating text. Creating one under a name that exists replaces it, which is also how to move it

command /sethologram:
    permission: "holograms.manage"
    trigger:
        create hologram "welcome" at player's location with lines "&6&lWelcome", "&7Type &f/help &7to begin"
Try it
effectset line <n> of hologram <name> to <text>since 1.7.2

Rewrite one line; a line past the end is added

every 1 minute:
    set line 2 of hologram "welcome" to "&7Online: &f%server.online_players%"
Try it
effectdelete hologram <name>since 1.7.2

Take a hologram away

delete hologram "welcome"
Try it
expressionhologramssince 1.7.2

A list of the names of every hologram

send "&7Holograms: &f" + join holograms with ", "
Try it
effectset fake block at <position> to <block>since 1.7.13

Show one player a block that is not really there. Only their game is told; the world is not changed, and nobody else sees it. Add for <who> or for all players to show someone else

on right click:
    if event.block is "stone":
        set fake block at event's location to gold block
        send "&6Only you can see that."
Try it
effectclear fake block at <position>since 1.7.13

Show the player what is really there again; for <who> as above

command /reveal:
    players only: true
    trigger:
        set fake block at player to glass
        wait 5 seconds
        clear fake block at player
Try it
effectset fake blocks from <location> to <location> to <block>since 1.7.14

A whole box of fake blocks, between two opposite corners; for <who> as above. Up to 32768 at once

command /cage:
    trigger:
        set {_a} to player's location offset by -1, 0, -1
        set {_b} to player's location offset by 1, 2, 1
        set fake blocks from {_a} to {_b} to glass
        send "&7A cage only you can see."
Try it
effectclear fake blocks from <location> to <location>since 1.7.14

Shows what is really in that box again

command /uncage:
    trigger:
        set {_a} to player's location offset by -1, 0, -1
        set {_b} to player's location offset by 1, 2, 1
        clear fake blocks from {_a} to {_b}
Try it
effectclear all fake blockssince 1.7.14

Every fake block scripts have shown the player, wherever it is; for <who> or for all players likewise

on world change:
    clear all fake blocks
Try it
effectstrike lightning at <location>since 1.7.0

A real bolt; strike fake lightning at only looks like one

strike lightning at player's location
Try it
effectcreate explosion at <location> [with power <n>]since 1.7.0

Power 4 is TNT. Add without breaking blocks and with fire as needed

create explosion at player's location with power 3 without breaking blocks
Try it
effectfill from <location> to <location> with <block>since 1.7.0

Set every block in a box, up to 32,768 at once

fill from 0, 64, 0 in "world" to 4, 64, 4 in "world" with stone
Try it
effectfill from <location> to <location> with <block> replacing <block>since 1.7.67

Only the blocks of that kind are changed, the rest of the box stays: fill from {_a} to {_b} with air replacing stone

fill from {arena.a} to {arena.b} with air replacing stone
Try it
effectfill from <location> to <location> with <block> hollowsince 1.7.67

Only the outside of the box: walls, floor and roof, with what is inside left as it is. Goes together with replacing

fill from {room.a} to {room.b} with glass hollow
Try it
effectbreak blocks from <location> to <location>since 1.7.67

Break every block of a box, 4,096 at most, each the way break block at does. over <duration>, without particles and without drops work here too; with more than 256 blocks the cracks and the crumbs are left out

break blocks from {wall.a} to {wall.b} over 3 seconds without drops
Try it
expressionshow cracks <n> on block at <location>since 1.7.67

The block looks that broken, from 1 to 10, to everybody within 64 blocks; it is not harmed. The game lets cracks fade after about twenty seconds, so show them again to keep them. Needs a Paper server, or Spigot 1.19.4 or newer

set {_loc} to location below player's location
show cracks 7 on block at {_loc}
Try it
effectclear cracks on block at <location>since 1.7.67

Take them away again

set {_loc} to location below player's location
clear cracks on block at {_loc}
Try it
effectdrop block <block> at <location>since 1.7.67

The block falls from there the way sand does, and settles where it lands. drop falling <block> at <location> says the same

drop block sand at location above player's location
Try it
expressioncopy blocks from <location> to <location> as <name>since 1.7.15

Remember every block in a box under a name, up to 250,000 of them. copy region <name> as <name> does the same for a region made with create region

command /savearena:
    permission: arena.admin
    trigger:
        copy region "arena" as "arena-clean"
        send "&aThe arena as it is now was saved."
Try it
expressionpaste <name>since 1.7.15

Put the blocks back where they were copied from, or somewhere else with at <location>, which becomes the lowest corner

command /resetarena:
    permission: arena.admin
    trigger:
        paste "arena-clean"
        broadcast "&7The arena was reset."
Try it
effectdelete copy <name>since 1.7.15

Forget a copy

command /forgetarena:
    permission: arena.admin
    trigger:
        delete copy "arena-clean"
Try it
effectbreak block at <location>since 1.7.0

As if mined: it drops what it would, with the crumbs and the sound of a block breaking

break block at location below player's location
Try it
effectbreak block at <location> over <duration>since 1.7.66

The block cracks the way one being mined does, a little more all the time, and breaks when the time is up: break block at {_loc} over 5 seconds. The lines after it run at once; they do not wait. A block that somebody mines or changes in the meantime is left alone. without particles may be added. The cracks need a Paper server, or Spigot 1.19.4 or newer; elsewhere the block simply breaks when the time is up

set {_loc} to location below player's location
break block at {_loc} over 5 seconds
send "&7The floor will not hold much longer."
Try it
effectbreak block at <location> without dropssince 1.7.66

The block breaks and leaves nothing lying there. Goes together with the others: break block at {_loc} over 3 seconds without drops, break block at {_loc} without particles and drops

set {_loc} to location below player's location
break block at {_loc} without drops
Try it
effectbreak block at <location> without particlessince 1.7.65

The same, but silently and without the crumbs: the block is gone and its drops lie there

set {_loc} to location below player's location
break block at {_loc} without particles
Try it
effectgrow tree at <location>since 1.7.0

Needs dirt below and room above

grow tree at player's location
Try it
effectdrop <item> at <location>since 1.7.0

Put an item on the ground

drop 1 diamond at event's location
Try it
effectdrop loot <table> at <location>since 1.7.20

Drop what one of the game's own loot tables gives, such as "entities/zombie" or "chests/simple_dungeon"

command /dungeonloot:
    permission: loot.admin
    trigger:
        drop loot "chests/simple_dungeon" at player's location
Try it
effectfill chest at <location> with loot <table>since 1.7.20

Put what a loot table gives into the chest, barrel or other container there, spread over its slots as the game does

command /restock:
    permission: loot.admin
    trigger:
        fill chest at target block of player with loot "chests/village/village_weaponsmith"
        send "&aRestocked."
Try it
effectcreate world <name>since 1.7.6

Make a new world, or load it if it was made before. Add any of flat, void, amplified, large biomes, nether, end, with seed <value> and without structures. Making a world takes the server a few seconds

command /makearena:
    permission: "worlds.manage"
    trigger:
        send "&7Making the arena..."
        create world "arena" flat without structures
        teleport player to spawn of world "arena"
Try it
expressionload world <name> / unload world <name>since 1.7.6

Bring a world into memory, or let go of it. Players inside are sent to the main world first. unload world <name> without saving throws away what changed since it was last saved

command /closearena:
    permission: "worlds.manage"
    trigger:
        unload world "arena"
        send "&7The arena is closed."
Try it
effectdelete world <name>since 1.7.6

Unload a world and delete its files for good. Only worlds a script made can be deleted

command /resetarena:
    permission: "worlds.manage"
    trigger:
        confirm "&cDelete the arena world and everything in it?":
            delete world "arena"
            create world "arena" flat without structures
            send "&aThe arena is new again."
Try it
expressioncreated worldssince 1.7.6

A list of the names of the worlds scripts have made or brought in with load world, loaded or not

send "&7Worlds made here: &f" + join created worlds with ", "
Try it
expressionworld <name> existssince 1.7.36

Whether there is a world of that name: one that is loaded, or one whose folder is on the server and can be loaded

if world "arena" exists:
    teleport player to spawn of world "arena"
Try it
effectset spawn of world <name> to <location>since 1.7.0

Where new players and bedless respawns appear

set spawn of world "world" to player's location
Try it
effectset world border of world <name> to <size> [over <duration>]since 1.7.0

Width in blocks; over makes it move there gradually

set world border of world "world" to 500 over 5 minutes
Try it
expressionregion at <location>since 1.4.0

A list of the names of every region containing that location

if region at event's location contains "spawn_protection":
    if player does not have permission "hyperscript.admin":
        cancel event
        send "&cYou cannot break blocks inside the spawn region!"
        play sound "block.anvil.land" with pitch 0.5 and volume 1.0 at player's location
Try it
expressionevent's locationsince 1.4.0

The block an event is about: the block being broken or clicked

if block at event's location is "bedrock":
    cancel event
Try it
Guide and examples

Time and weather

set time in world "%player.world%" to 1000
set weather in world "%player.world%" to clear
StatementEffect
set time in world <name> to <ticks>Time of day: 0 is sunrise, 1000 day, 6000 noon, 13000 night, 18000 midnight
set weather in world <name> to <weather>clear, rain or thunder

Blocks

set block at 0, 64, 0 in "world" to gold block
set block at player's location to air
set block at {%player%.home} to "oak_planks"
if block at event's location is "bedrock":
    cancel event
SyntaxMeaning
set block at <position> to <block>Replace the block there. The block is a Minecraft block name in plain words (gold block, oak planks, air), checked when the script loads, or any value holding one
set <variable> to <block name>Keep a kind of block in a variable, by its name in plain words: set {_block} to red concrete. Capitals do not matter, and the name is checked when the script loads. set block at {_spot} to {_block} then places it
place <block> at <position>Another way to say set block at <position> to <block>: place stone at {_loc}
block data at <position>The block that is there with its details: which way stairs face, whether a door is open, which half a slab is. Keep it in a variable and set block at {_loc} to {_data} puts the same block back, the same way round. What is inside a chest and what a sign says are not part of it
block at <position>The type of block that is there now, as Minecraft names it: stone, gold_block. Comparing takes "gold block" and "gold_block" for the same name

A position is player, player's location, event's location, a variable holding a location, or <x>, <y>, <z> followed by in "<world>" (without it, the player's world is used).

Whether a world is there can be asked before it is used:

command /arena:
    trigger:
        if world "arena" exists:
            teleport player to spawn of world "arena"
        else:
            send "&cThe arena has not been made yet."
  • at player and at player's location mean the block the player's feet are in.
  • Changing a block happens at once and drops nothing. Changing many blocks in one go is slow; do a few at a time and wait between them.
  • block at reads the world, which is only safe on the server thread: inside async: put it in a sync: block.

Regions are named boxes in a world. HyperScript only keeps track of where they are; what happens inside one is up to your scripts.

create region "spawn_protection" from -20, 0, -20 to 20, 255, 20 in "world"

Once a region exists, any trigger can ask which regions a location is in:

on block break:
    if region at event's location contains "spawn_protection":
        if player does not have permission "hyperscript.admin":
            cancel event
            send "&cYou cannot break blocks inside the spawn region!"
            play sound "block.anvil.land" with pitch 0.5 and volume 1.0 at player's location
SyntaxMeaning
create region <name> from <location> to <location>Define (or redefine) a region by two opposite corners; both corner blocks are included
delete region <name>Remove it
spawn firework at <location>Launch a firework; add colored red, blue, shaped star and with power 2 as wanted
play effect <name> at <location>A built-in visual such as smoke, ender_signal or mobspawner_flames
set line <n> of sign at <location> to <text>Write on a sign; line <n> of sign at <location> reads it
items in chest at <location>A list of the items in a chest or other container
add <item> to chest at <location> / clear chest at <location>Put items in a container, or empty it
remove <item> from chest at <location>Take items of that kind out of a container: as many as are asked for, and no more than there are. remove 5 diamond from chest at {_chest}
number of <item> in chest at <location>How many of that item the container holds, over all its slots
chest slot <n> at <location>The item in one slot of a container, counting from 1; unset for an empty slot. It can be set: set chest slot 1 at {_chest} to diamond sword, and emptied with delete chest slot 1 at {_chest}
set gamerule <name> of world <name> to <value>Change a game rule; gamerule <name> of world <name> reads it. Old and new rule names both work on every version: keepInventory or keep_inventory, doDaylightCycle or advance_time
set difficulty of world <name> to <level>peaceful, easy, normal or hard; difficulty of world <name> reads it
set pvp of world <name> to <true or false>Whether players can hurt each other in that world
set pvp of region <name> to <true or false>The same for one region; HyperScript stops the fighting itself
set build of region <name> to <true or false>Whether blocks can be broken and placed in a region
players in region <name>A list of the names of the players inside
entities in region <name>A list of the creatures inside, players not among them
random location in region <name>A place somewhere inside the region, in the middle of a block; unset if there is no such region
spawn of world <name>The world's spawn point, as a location
create hologram <name> at <location> with lines <text>, <text>Floating text. Creating one under a name that exists replaces it, which is also how to move it
set line <n> of hologram <name> to <text>Rewrite one line; a line past the end is added
delete hologram <name>Take a hologram away
hologramsA list of the names of every hologram
set fake block at <position> to <block>Show one player a block that is not really there. Only their game is told; the world is not changed, and nobody else sees it. Add for <who> or for all players to show someone else
clear fake block at <position>Show the player what is really there again; for <who> as above
set fake blocks from <location> to <location> to <block>A whole box of fake blocks, between two opposite corners; for <who> as above. Up to 32768 at once
clear fake blocks from <location> to <location>Shows what is really in that box again
clear all fake blocksEvery fake block scripts have shown the player, wherever it is; for <who> or for all players likewise
strike lightning at <location>A real bolt; strike fake lightning at only looks like one
create explosion at <location> [with power <n>]Power 4 is TNT. Add without breaking blocks and with fire as needed
fill from <location> to <location> with <block>Set every block in a box, up to 32,768 at once
fill from <location> to <location> with <block> replacing <block>Only the blocks of that kind are changed, the rest of the box stays: fill from {_a} to {_b} with air replacing stone
fill from <location> to <location> with <block> hollowOnly the outside of the box: walls, floor and roof, with what is inside left as it is. Goes together with replacing
break blocks from <location> to <location>Break every block of a box, 4,096 at most, each the way break block at does. over <duration>, without particles and without drops work here too; with more than 256 blocks the cracks and the crumbs are left out
show cracks <n> on block at <location>The block looks that broken, from 1 to 10, to everybody within 64 blocks; it is not harmed. The game lets cracks fade after about twenty seconds, so show them again to keep them. Needs a Paper server, or Spigot 1.19.4 or newer
clear cracks on block at <location>Take them away again
drop block <block> at <location>The block falls from there the way sand does, and settles where it lands. drop falling <block> at <location> says the same
copy blocks from <location> to <location> as <name>Remember every block in a box under a name, up to 250,000 of them. copy region <name> as <name> does the same for a region made with create region
paste <name>Put the blocks back where they were copied from, or somewhere else with at <location>, which becomes the lowest corner
delete copy <name>Forget a copy
break block at <location>As if mined: it drops what it would, with the crumbs and the sound of a block breaking
break block at <location> over <duration>The block cracks the way one being mined does, a little more all the time, and breaks when the time is up: break block at {_loc} over 5 seconds. The lines after it run at once; they do not wait. A block that somebody mines or changes in the meantime is left alone. without particles may be added. The cracks need a Paper server, or Spigot 1.19.4 or newer; elsewhere the block simply breaks when the time is up
break block at <location> without dropsThe block breaks and leaves nothing lying there. Goes together with the others: break block at {_loc} over 3 seconds without drops, break block at {_loc} without particles and drops
break block at <location> without particlesThe same, but silently and without the crumbs: the block is gone and its drops lie there
grow tree at <location>Needs dirt below and room above
drop <item> at <location>Put an item on the ground
drop loot <table> at <location>Drop what one of the game's own loot tables gives, such as "entities/zombie" or "chests/simple_dungeon"
fill chest at <location> with loot <table>Put what a loot table gives into the chest, barrel or other container there, spread over its slots as the game does
create world <name>Make a new world, or load it if it was made before. Add any of flat, void, amplified, large biomes, nether, end, with seed <value> and without structures. Making a world takes the server a few seconds
load world <name> / unload world <name>Bring a world into memory, or let go of it. Players inside are sent to the main world first. unload world <name> without saving throws away what changed since it was last saved
delete world <name>Unload a world and delete its files for good. Only worlds a script made can be deleted
created worldsA list of the names of the worlds scripts have made or brought in with load world, loaded or not
world <name> existsWhether there is a world of that name: one that is loaded, or one whose folder is on the server and can be loaded
set spawn of world <name> to <location>Where new players and bedless respawns appear
set world border of world <name> to <size> [over <duration>]Width in blocks; over makes it move there gradually
region at <location>A list of the names of every region containing that location
event's locationThe block an event is about: the block being broken or clicked

Where somebody stands and what they look at:

on player jump:
    if block below player is "slime_block":
        push player upward with force 2
        play sound "entity.slime.jump" for players within 10 blocks of player's location
    if block above player is "glass":
        send action bar "&7Mind your head." to player

command /scan <player>:
    trigger:
        if player is looking at arg.1:
            send "&aYou have %arg.1% in your sights."
        if player is not looking at target block of player:
            send "&7You are looking at nothing in reach."
        if player is riding:
            set {_mount} to vehicle of player
            send "&7You are riding something."
        if player is in biome "desert":
            send "&eIt is hot here."
        if level of player is even:
            send "&7An even level."
        if level of player is odd:
            send "&7An odd level."
        if level of player is divisible by 5:
            give 1 diamond to player or drop
        chance of 10%:
            give player 1 emerald
            send "&aLucky!"

Containers, the creatures around, and regions:

command /bank:
    trigger:
        set {_chest} to target block of player
        set {_gold} to number of gold ingot in chest at {_chest}
        send "&7This chest holds &6%{_gold}% &7gold."
        if {_gold} is at least 5:
            remove 5 gold ingot from chest at {_chest}
            add 1 diamond to chest at {_chest}
        set chest slot 1 at {_chest} to paper named "&fReceipt"
        if chest slot 2 at {_chest} is not set:
            send "&7The second slot is empty."
        delete chest slot 3 at {_chest}

on inventory open:
    # A chest somebody locked with /lock opens for them alone.
    if nbt "owner" of block at event's location is set:
        if nbt "owner" of block at event's location is not player.name:
            cancel event
            send "&cThis chest is locked."

command /sweep:
    permission: "sweep.use"
    trigger:
        for each {_mob} in entities of zombie within 20 blocks of player:
            kill {_mob}
        set {_left} to size of entities within 20 blocks of player
        send "&7%{_left}% creatures are left around you."
        set {_friend} to nearest other player to player
        if {_friend} is set:
            send "&7Closest to you: &f%{_friend}%"
        set {_threat} to nearest zombie to player
        if {_threat} is set:
            make player look at location of {_threat}
        set {_any} to nearest entity to player's location

command /arena:
    trigger:
        set {_spot} to random location in region "arena"
        if {_spot} is set:
            teleport player to {_spot}
        set {_inside} to size of entities in region "arena"
        send "&7%{_inside}% creatures are in the arena."
        set {_far} to horizontal distance between player's location and {_spot}

command /restart-in <minutes>:
    permission: "restart.use"
    trigger:
        if time until schedule "restart" is set:
            set {_left} to time until schedule "restart"
            send "&cA restart is already coming in %{_left}%."
            stop
        schedule stop_server() in arg.1 * 60 seconds as "restart"

function stop_server():
    execute console command "stop"

A location here is player's location, event's location, a variable holding a location, or <x>, <y>, <z> followed by in "<world>" (without it, the player's world is used).

Whether a world is there can be asked before it is used:

command /arena:
    trigger:
        if world "arena" exists:
            teleport player to spawn of world "arena"
        else:
            send "&cThe arena has not been made yet."
  • Holograms are saved: one made by a command is still there after a restart, and is listed in plugins/HyperScript/holograms.yml. A hologram a script keeps up to date is best made in on load:, which simply replaces the old one.
  • Copies are for putting a place back the way it was: copy an arena once, and paste it after every round. A copy is the blocks themselves, with which way they face and whether they are open or lit; what is *inside* chests, and what is written on signs, is not kept. It is saved in plugins/HyperScript/copies/ and stays until it is deleted. Pasting sets every block at once, so a large copy makes the server pause for a moment; nothing falls or flows because of it.
  • Fake blocks exist only on one player's screen. The server still has the real block, so the player cannot stand on a fake one over air, and the real block comes back by itself when they click it, when it changes, or when they leave the area and return. They are for showing things: a path to follow, an outline, a block that looks mined out. position is written as for set block: at player, at event's location, at 10, 64, -5 in "world".
  • Worlds of your own. create world "skyblock" void makes a world and remembers it: it is listed in plugins/HyperScript/worlds.yml and loaded again every time the server starts (unless it was last let go with unload world), before any script runs, so locations saved in it stay good. A world is one of normal (the default), flat, void (nothing but one block to stand on), amplified or large biomes, in the overworld, the nether or the end. Everything that works on a world works on these: teleport player to spawn of world "skyblock", game rules, difficulty, time, weather, borders and regions. Creating one that exists does nothing, so an on load: block may do it every time.
  • Region rules. set pvp of region "spawn" to false and set build of region "spawn" to false make HyperScript itself stop fighting and building there, so a script does not have to cancel events. Players with the permission hyperscript.region.bypass (operators by default) may still build. The rules are saved; set them once, for example in on load:.
  • region at ... gives a list because regions may overlap; test it with contains.
  • For block events, check event's location rather than player's location. The player can stand outside a region and still reach a block inside it.
  • Region names ignore case. Regions are saved with the other variable data and survive restarts.
  • This is HyperScript's own region list. It does not read WorldGuard regions.