HyperScript
Docs

← All of the Docs The world

Places

expression<location> offset by <x>, <y>, <z>since 1.7.0

The place that far away

teleport player to player's location offset by 0, 10, 0
Try it
expressionlocation above <location> / location below <location>since 1.7.0

One block up or down

set block at location below player's location to stone
Try it
expressionlocation <n> blocks in front of <who>since 1.7.0

Where they are looking, that far away

set {_ahead} to location 3 blocks in front of player
Try it
expressionlocation <n> blocks behind <who>since 1.7.68

That far behind them, on the level, from where they stand. location behind <who> is one block

set {_spot} to location 2 blocks behind player
summon zombie at {_spot}
Try it
expressionlocation <n> blocks left of <who>since 1.7.68

That far to their left, likewise; right of for the other side, and location left of <who> is one block

set {_spot} to location 3 blocks left of player
place stone at {_spot}
Try it
expressionmidpoint between <a> and <b>since 1.7.0

Halfway between two places

set {_middle} to midpoint between {arena.corner1} and {arena.corner2}
Try it
expressionhighest block at <location>since 1.7.0

The top block of that column, as a location

teleport player to location above highest block at player's location
Try it
expressionbiome at <location>since 1.7.0

The biome's name, e.g. plains

send "&7Biome: &f" + biome at player's location
Try it
expressionlight level at <location>since 1.7.0

0 (dark) to 15 (bright)

if light level at player's location < 8:
    send "&7Mobs can spawn here."
Try it
expressiontarget block of <who>since 1.7.0

The block they are looking at, up to 100 blocks away, as a location

set {_looked} to target block of player
if {_looked} is set:
    strike fake lightning at {_looked}
Try it
expressionblock (below/above) <who>since 1.7.45

The kind of block under their feet, or over their head, such as gold_block. A location works in place of a player: the block one lower or higher

on player jump:
    if block below player is "slime_block":
        push player upward with force 2
Try it
expressionvehicle of <who>since 1.7.45

What they are riding, as a creature; unset if they are on foot

set {_mount} to vehicle of player
Try it
condition<location> is within <n> blocks of <location>since 1.7.0

A condition

if player's location is within 10 blocks of {spawn}:
    send "&aYou are near spawn."
Try it
condition<location> is loadedsince 1.7.0

Whether that part of the world is loaded

if {arena} is loaded:
    summon zombie at {arena}
Try it
Guide and examples

Ways to get from one location to another, and to ask about one.

on player sneak:
    set {_ahead} to location 3 blocks in front of player
    if block at {_ahead} is "air":
        set block at {_ahead} to stone
SyntaxResult
<location> offset by <x>, <y>, <z>The place that far away
location above <location> / location below <location>One block up or down
location <n> blocks in front of <who>Where they are looking, that far away
location <n> blocks behind <who>That far behind them, on the level, from where they stand. location behind <who> is one block
location <n> blocks left of <who>That far to their left, likewise; right of for the other side, and location left of <who> is one block
midpoint between <a> and <b>Halfway between two places
highest block at <location>The top block of that column, as a location
biome at <location>The biome's name, e.g. plains
light level at <location>0 (dark) to 15 (bright)
target block of <who>The block they are looking at, up to 100 blocks away, as a location
block (below/above) <who>The kind of block under their feet, or over their head, such as gold_block. A location works in place of a player: the block one lower or higher
vehicle of <who>What they are riding, as a creature; unset if they are on foot
<location> is within <n> blocks of <location>A condition
<location> is loadedWhether that part of the world is loaded

Coordinates can be written out wherever a line ends with a place: set {spawn} to 0, 64, 0 in "world".