<amount> in frontsince 1.3.0How many; the default is 1
give 16 bread to playerTry itEverything HyperScript can do, by subject. Type to filter instantly, pick a subject below, or say on the left what kind of thing you are looking for. Click any entry for an example.
Nothing matches. Try fewer words, or clear the filters.
How a script is laid out, and the handful of things every script is made of.
How syntax is written on these pages. <name> stands for a value you put there. Something in square brackets, such as [or drop], may be left out. Round brackets with a slash, such as (below/above), mean one of those words. Everything else is written as it stands.
A script is a list of commands, event handlers, timers and functions. Blocks are formed by indentation (spaces or tabs, as long as you are consistent), and every line that opens a block ends with :.
A line that ends with a backslash carries on with the next one, so long text or a long condition can be spread over several lines:
on player join:
send "&7Welcome to the server. Read the rules, " + \
"be kind to each other, and have fun."
# starts a comment: everything after it on the line is ignored, so it is where you leave notes for yourself and for whoever edits the script next. A # inside quotes is ordinary text.
# Notes
# - The reward is the number in /daily. Change it there.
options:
<name>: <value>
function <name>(<locals>):
<statements>
on load:
<statements>
on <event>:
<statements>
command /<name> [<argument description>]:
<options>
trigger:
<statements>
every <duration>:
<statements>
on discord command "/<name>":
<statements>
on load: is not a server event. Its block runs once each time the file is loaded: when the server starts, on /hyperscript reload, and when the file is saved with hot reloading on. It runs with no player, like a console command, and after every script has been loaded, so it may call functions from other files. It is the place to set defaults and create teams:
on load:
if {motd} is not set:
set {motd} to "&aWelcome!"
There are two kinds of variable, told apart by the first character of the name.
| Kind | Written as | Lifetime | Example |
|---|---|---|---|
| Global | {name} | Saved, and shared by every script | {event_active} |
| Local | {_name} | One run of one trigger; never saved | {_tempDamage} |
set {event_active} to true
set {_tempDamage} to 4.5
set {%player%.coins} to 100
delete {%player%.coins}
true and false, items, durations, locations, or a list of any of those. See Value types.{name} is global: one saved value that any script can read and change.{_name} is local: a name that begins with an underscore. It exists for one run of the command, event handler or function it appears in, starts unset every time, and nothing else can see it, not even another trigger in the same file._name. It is the same variable either way, and a script may use both. The braces are how these pages write it, because every other variable has them too; scripts written the shorter way keep working as they are.{_data.name} and {_data.kills} are named values inside the local {_data}. The whole table can be handed to a function, returned from one, and looped over with for each {_key}, {_value} in {_data}:. Like any local it is never saved._, - and ..{%player%.coins} is the coins of the player of this trigger, {%arg.1%.coins} the coins of whoever was named in the command, and {%loop-player%.coins} the coins of each player in a loop all players. Everybody has their own value, it is stored with their account so it survives a name change, and it can be read and changed while they are offline.{warp.%arg.1%} rather than {%arg.1%.warp}.{%player%.<name>} when there is no player (a console command, a timer) gives unset; writing it is a runtime error.{player.coins}, without the percent signs, is one global shared by everyone. The word player in a variable name is just part of the name; it is %player% that stands for the player.{%player%:role} is the same variable as {%player%.role}, and {stats::kills} the same as {stats.kills}.set {_home.name} to "base", set {_home.spot} to player's location, append _home to {%player%.homes}. Looping gives each one back as a table: for each {_home} in {%player%.homes}: then {_home.name} and {_home.spot}. The list holds its own copy, so the local can be changed and used again for the next one.storage.shared-variables on, a variable whose name starts with shared. is the same on every server that uses the database; see The database.set {%player%.boost} to 2 for 10 minutes sets it and unsets it again by itself when the time is up. The time keeps counting while the server is off, and a variable whose time ran out then is gone when the server starts. Setting it for another time starts the time anew; setting it without for changes the value but not when it ends. This is for saved variables; a local one ends with its trigger anyway.temp. is never saved. {temp.round} lasts until the server stops, and a player's own, {%player%.temp.combat}, is forgotten the moment they leave. Use them for things that should not outlive a session, such as "is in a fight" or "has a menu open", and there is nothing to tidy up when a player joins.0 in math, as nothing when joined to text with +, and as false in conditions, so counters need no setup: add 1 to {%player%.joins} works the first time. Test for it explicitly with is set / is not set.{%player%.coins} and {event.start_time} are fine; {player.name} is refused, because player.name is built in. The same name after %player%. is allowed: {%player%.name} is simply a per-player variable."%{%player%.coins}%" and "%{_reward}%"."Mined: %quest progress "miner"%", "You have %plural({_n}, "home")%.". So inside text, %{...}% is a variable and %...% without braces is a placeholder."You have %size of {_list}% items", "That is %round({_n})% coins". Something that does not read as a value is shown as it was written, so "50% off, 20% more" stays what it is. Text in quotes cannot stand inside it; put that in a local variable first.Settings that a script uses in several places can be named once, at the top of the file, and used anywhere in it as {@name}:
options:
prefix: "&8[&6Shop&8] "
price: 50
wait: 10 minutes
command /buy:
cooldown: {@wait}
trigger:
if {%player%.coins} < {@price}:
send "{@prefix}&cThat costs {@price} coins."
stop
subtract {@price} from {%player%.coins}
give 1 diamond to player
send "{@prefix}&aBought a diamond."
options: block stands at the left margin, like a command. Each line in it is name: value.{@name} in it is replaced by the option's value exactly as written, so an option can be a number, a duration, text, an item, a permission, or part of a header such as every {@interval}:."{@prefix}&aBought" works.Saying which version a script needs. A comment # Requires: 1.5.7 among the notes at the top of a file makes an older plugin refuse the file with one clear message, "This script needs HyperScript 1.5.7 or newer", instead of an error about whichever line it does not understand. The scripts on the website's Scripts page all carry one.
<amount> in frontsince 1.3.0How many; the default is 1
give 16 bread to playerTry itnamed <text>Custom display name; & colour codes work
set {%player%.backpack.item} to diamond sword named "Storage"Try itfireworksince 1.7.65Short for firework rocket, wherever an item is named: give 3 firework to player
command /party:
trigger:
give 3 firework to player
send "&dLight them up!"Try itowned by <name>since 1.7.3For a player head: whose head it is, so it shows their skin
open gui with title "&8Online" with 1 rows for player:
slot 1 is "player_head" owned by player.name named "&f%player.name%"Try ittextured <value>since 1.7.64For a player head: a skin of its own, for heads that are decoration and nobody's face. The value is what such heads are passed around as: the address of the skin on textures.minecraft.net, the code at its end, or the long text websites with heads give. Needs Minecraft 1.18.1 or newer; on an older server the head stays plain
command /globe:
trigger:
give 1 player head textured "b1dd4fe4a429abd665dfdb3e21321d6efa6a6b5e7b956db9c5d59c9efab25" named "&bGlobe" to playerTry itwith potion <kind>since 1.7.3For a potion, splash potion, lingering potion or tipped arrow: what it holds. Kinds are the game's own: strength, long_swiftness, strong_healing and so on
give 1 splash potion with potion strong_healing to playerTry itwith lore <text>, <text>, ...since 1.3.0Description lines, one per text
give player 1 diamond sword named "&6Excalibur" with lore "&7A fine blade", "&7Handle with care"Try itenchanted with <enchantment> <level>, ...since 1.7.27Enchantments, the game's or your own: enchanted with sharpness 5, unbreaking 3
set {reward} to 1 bow enchanted with power 3Try itunbreakablesince 1.7.27It never wears out
set nbt of tool of player to "{Unbreakable:1b}"Try itglowingsince 1.7.27It shimmers as an enchanted item does, without being enchanted
give player 1 stick glowingTry ittagged <text>since 1.7.27A hidden mark scripts can tell it by
give 1 blaze rod named "&dMagic wand" tagged "wand" to playerTry itmodel <number>since 1.7.27The custom model number a resource pack draws it with
give 1 paper named "&6Ticket" model 12 to playerTry ittype of <item>since 1.7.1An item's material, e.g. diamond_sword; an entity's kind · type of tool of player
set {_held} to tool of player
if type of {_held} is "diamond_sword":
send "&bA fine blade."Try itamount of <item>since 1.7.1How many are in the stack · amount of tool of player
set {_held} to tool of player
send "&7You are holding " + amount of {_held} + " item(s)."Try itamount of <item> in inventory of <who>since 1.7.58How many of them the player carries, all stacks together; 0 for none · amount of diamond in inventory of player
command /diamonds:
trigger:
set {_n} to amount of diamond in inventory of player
send "&bYou carry &f%{_n}% &bdiamonds."Try itx of <location>, y of <location>, z of <location>since 1.5.4One coordinate, as a number · y of player's location
set {_height} to y of player's locationTry itworld of <location>since 1.5.4The world's name · world of {spawn}
send "Your home is in " + world of {%player%.home}Try itset y of <variable> to <number>since 1.5.4Change one part; add and subtract work too · add 5 to y of {_spot}
set {_loc} to player's location
add 10 to y of {_loc}
teleport player to {_loc}Try itA variable holds whatever you put in it. Besides numbers, text, booleans and lists there are richer kinds of value: durations, locations and items, described here, and dates, which have a part of their own, Dates and times. All of them are saved with the rest of the variable data.
| Type | Written as | Prints as |
|---|---|---|
| Item | diamond sword, 3 golden apple, diamond sword named "&6Excalibur" with lore "line 1", "line 2" | 3 golden apple, diamond sword named &6Excalibur |
| Duration | 30 minutes, 2 hours, 1 hour 30 minutes, 5 ticks | 30 minutes, 1 hour 30 minutes |
| Location | player's location | world 10.5, 64, -3.25 |
set {%player%.backpack.item} to diamond sword named "Storage"
set {event.start_time} to 30 minutes
set {%player%.home} to player's location
give {%player%.backpack.item} to player
teleport player to {%player%.home}
Items are Minecraft material names written as plain words, with spaces instead of underscores. The name is checked when the script loads, so a misspelt item is reported straight away.
| Part | Meaning |
|---|---|
<amount> in front | How many; the default is 1 |
named <text> | Custom display name; & colour codes work |
firework | Short for firework rocket, wherever an item is named: give 3 firework to player |
owned by <name> | For a player head: whose head it is, so it shows their skin |
textured <value> | For a player head: a skin of its own, for heads that are decoration and nobody's face. The value is what such heads are passed around as: the address of the skin on textures.minecraft.net, the code at its end, or the long text websites with heads give. Needs Minecraft 1.18.1 or newer; on an older server the head stays plain |
with potion <kind> | For a potion, splash potion, lingering potion or tipped arrow: what it holds. Kinds are the game's own: strength, long_swiftness, strong_healing and so on |
with lore <text>, <text>, ... | Description lines, one per text |
enchanted with <enchantment> <level>, ... | Enchantments, the game's or your own: enchanted with sharpness 5, unbreaking 3 |
unbreakable | It never wears out |
glowing | It shimmers as an enchanted item does, without being enchanted |
tagged <text> | A hidden mark scripts can tell it by |
model <number> | The custom model number a resource pack draws it with |
An item value can be given with give, shown in a GUI slot (slot 5 is {%player%.backpack.item}), kept in a list, or adjusted when used: give player 5 {%player%.backpack.item} gives five of it. Items carry a material, amount, name, lore, enchantments, the unbreakable and glowing marks, a hidden tag, a custom model number, a head's owner and a potion's kind. How worn an item is, is not kept.
Durations are a number followed by ticks, seconds, minutes, hours or days (the unit must be written out in full inside a script line), and may be chained: 1 hour 30 minutes.
30 minutes > 60 is true and server.time + 30 minutes is the moment half an hour from now.for 10 seconds, for 2 minutes.Locations remember a world and a position. player's location is where the player stands. A location can be used anywhere a position is expected: teleport player to {%player%.home}, spawn particle "flame" at {%player%.home}.
The parts of a location can be read and changed one at a time:
set {_loc} to player's location
add 1 to y of {_loc}
set x of {_loc} to 0
send "Going to %{_loc}%"
teleport player to {_loc}
| Syntax | Meaning | Example |
|---|---|---|
type of <item> | An item's material, e.g. diamond_sword; an entity's kind | type of tool of player |
amount of <item> | How many are in the stack | amount of tool of player |
amount of <item> in inventory of <who> | How many of them the player carries, all stacks together; 0 for none | amount of diamond in inventory of player |
x of <location>, y of <location>, z of <location> | One coordinate, as a number | y of player's location |
world of <location> | The world's name | world of {spawn} |
set y of <variable> to <number> | Change one part; add and subtract work too | add 5 to y of {_spot} |
Mixing types up. Each kind of value can only do what makes sense for it. Adding a number to a whole location, or doing math on an item, stops the trigger and writes a warning to the log that names the script, the line and both kinds of value:
[HyperScript] kits.hs:14 Cannot add a number to a location (world 10.5, 64, -3.25). To change one coordinate, name it: add 1 to y of <variable>
These warnings are on by default. log-script-errors: false in config.yml hides them; the trigger still stops at the mistake, so leave them on unless the log is being flooded.
==Equal · player.world == "world_nether"
if size of {_names} == 0:
send "&7There are no notes."
stopTry it!=Not equal · arg.1 != "off"
if args.count != 1:
send "&cUsage: /lookup <player>"
reset cooldown
stopTry it> < >= <=Numeric comparison · player.health <= 5
if {%player%.coins} >= 100:
send "&aYou can afford it."Try itcontainsLeft text includes right text, or left list includes right value; does not contain is the opposite · message contains "help"
if {winners} contains player.name:
send "You already won."Try itis between <a> and <b>since 1.7.0A number is in that range, ends included · player.y is between 0 and 64
if player.y is between 0 and 16:
send "&bDiamond level!"Try itis in <list>since 1.7.0The list contains the value · arg.1 is in ["on", "off"]
if arg.1 is in ["on", "off"]:
send "&aOK."Try itis emptysince 1.7.0Unset, empty text or an empty list · {queue} is empty
if {queue} is empty:
send "&7Nobody is waiting."Try itis a list / a location / an item / a date / an entity / a table / textsince 1.7.0What kind of value it is · {home} is a location
if {%player%.home} is a location:
teleport player to {%player%.home}Try itis a playersince 1.7.0The name of someone who is online · arg.1 is a player
if arg.1 is not a player:
send "&c%arg.1% is not online."Try itis alphanumericsince 1.7.0Only letters and digits · arg.1 is alphanumeric
if arg.1 is not alphanumeric:
send "&cUse letters and digits only."Try itis sneaking / sprinting / swimming / blocking / sleeping / on ground / in watersince 1.7.0What a player is doing · player is sneaking
on right click:
if player is sneaking:
send "&7A sneaky click."Try it<who> is [not] ridingsince 1.7.45They sit on or in something: a horse, a boat, a minecart. vehicle of <who> is what · player is riding
if player is riding:
set {_mount} to vehicle of player
send "&7You are riding something."Try it<who> is [not] looking at <target>since 1.7.45Their crosshair is on it, give or take a few degrees. The target is a location or somebody; up to 100 blocks away · player is looking at arg.1
if player is looking at arg.1:
send "&aYou have %arg.1% in your sights."Try it<who> is [not] in biome <name>since 1.7.45Where they stand is that biome; a location works in place of a player · player is in biome "desert"
if player is in biome "desert":
send "&eIt is hot here."Try it<number> is [not] (even/odd)since 1.7.45A whole number that two goes into, or does not · level of player is even
if level of player is even:
send "&7An even level."Try it<number> is [not] divisible by <n>since 1.7.45It can be divided by that with nothing left over · level of player is divisible by 5
if level of player is divisible by 5:
give 1 diamond to player or dropTry itis op / is onlinesince 1.7.0Also true or false for someone offline · arg.1 is online
if arg.1 is online:
send "&a%arg.1% is here."Try ithas played beforesince 1.7.0They have joined at least once before; has not played before is the opposite · arg.1 has played before
if arg.1 has played before:
send "&7%arg.1% has been here."Try ithas saved inventory <name> / does not have saved inventory <name>since 1.7.15An inventory was put away for them with save inventory · player has saved inventory "before-arena"
on player quit:
if player has saved inventory "before-arena":
log "%player% left in the middle of a round"Try itis holding <item> / is wearing <item>since 1.7.0In either hand, or in an armour slot · player is holding diamond sword
if player is holding diamond sword:
send "&bNice sword."Try itis in region <name> / is not in region <name>since 1.7.14The player is inside a region made with create region · player is in region "spawn"
on block break:
if player is in region "spawn":
cancel event
send "&cNot here."Try itis on cooldown <name> / is not on cooldown <name>since 1.7.14A cooldown started with start cooldown is still running for them · player is on cooldown "kit"
command /kit:
trigger:
if player is on cooldown "kit":
set {_left} to cooldown "kit"
send "&cWait %{_left}%."
stop
start cooldown "kit" of 1 hour
give player 16 breadTry itcan see <player>since 1.7.0The other player is not hidden from them · player can see arg.1
if player can see arg.1:
send "&7You can see %arg.1%."Try it<world> is raining / is day / is nightsince 1.7.0About a world, by name · player.world is night
if player.world is night:
send "&7It is dark. Watch out."Try it<block> is solidsince 1.7.0The block type can be stood on · block at {_loc} is solid
if block at (location below player's location) is solid:
send "&7You are on firm ground."Try it<block> is liquidsince 1.7.67It is water or lava · block at {_loc} is liquid
if block at player's location is liquid:
send "&bYou are swimming."Try it<block> is passablesince 1.7.67It can be walked through: air, water, grass, flowers, torches · block at {_loc} is passable
if block at (location below player's location) is passable:
send "&7There is nothing under your feet."Try it<block> is airsince 1.7.67Nothing is there · block at {_loc} is air
if block at (location above player's location) is air:
send "&7Nothing above you."Try ithas space for <item>since 1.7.1The items would fit in the inventory · player has space for 5 diamond
if player has space for 5 diamond:
give 5 diamond to player
else:
send "&cYour inventory is full."Try itis bedrock / is deadsince 1.7.1On the Bedrock edition (through Floodgate) / dead and not yet respawned · player is bedrock
if player is bedrock:
send "&7Bedrock players: use /menu instead of the book."Try it<a> if <condition> else <b>since 1.7.1Not a test but a choice: one value or the other · "on" if {flag} else "off"
set {_state} to "&aon" if {%player%.pvp_on} else "&coff"
send "&7PvP is %{_state}%"Try itstarts with / ends withsince 1.5.9The text begins or ends with the other, ignoring case · message starts with "!"
on player chat:
if message starts with "!":
cancel event
send "&7Commands start with / here."Try itmatchessince 1.5.9The whole text fits a regular expression · arg.1 matches "[a-z0-9_]{3,16}"
if not (arg.1 matches "[a-zA-Z0-9_]{3,16}"):
send "&cThat is not a valid name."Try itchance of <n>%since 1.5.9True about that often, at random · if chance of 25%:
on block break:
if chance of 5%:
give 1 diamond to player
send "&bLucky find!"Try itchance of <n>%:since 1.7.45The same as a block of its own: its lines run about that often. An if chance of <n>%: without the if; use the if when there is an else · chance of 10%:
on block break:
chance of 10%:
give player 1 emerald
send "&aLucky!"Try ithas <item>since 1.5.6The player's inventory holds at least that many · player has 5 diamond
if player has 5 diamond:
send "&aYou can afford the upgrade."Try itdoes not have <item>since 1.5.6It holds fewer · player does not have 1 "%{_material}%"
if player does not have 1 iron pickaxe:
send "&cBring a pickaxe."Try ithas permissionThe player holds the permission · player has permission "shop.vip"
unless player has permission "fly.use":
send "&cYou cannot fly here."
stopTry itdoes not have permissionsince 1.4.0The player lacks the permission · player does not have permission "shop.vip"
if player does not have permission "fly.use":
cancel eventTry ithas effect / does not have effectsince 1.5.8The player has that potion effect · player has effect speed
if player does not have effect night vision:
apply night vision to player for 5 minutesTry itis frozen / is vanished / is flyingsince 1.5.8See Players · arg.1 is frozen
if player is flying:
send "&7Enjoy the view."Try itis tagged / is not taggedsince 1.5.8The item carries that hidden tag · tool of player is tagged "wand"
if tool of player is tagged "wand":
send "&dThe wand hums."Try itis banned / is not bannedsince 1.5.7The player is on the server's ban list · arg.1 is banned
if arg.1 is banned:
send "&c%arg.1% is banned."Try itis set / is not setThe value exists / does not · {%player%.coins} is not set
if {_spot} is set:
teleport player to {_spot}Try itis a number / is not a numberThe value is numeric · arg.1 is a number
if arg.1 is not a number:
send "&cUsage: /pay <amount>"
stopTry itis / is notsince 1.5.0The same as == / != · event.cause is "FALL", {%player%.frozen} is true
if event.cause is "FALL":
cancel eventTry itbigger than / smaller thansince 1.7.42The same as > / <. Also greater than, more than, larger than, higher than, and less than, lower than, fewer than. With or without is in front · {_players} bigger than 50, {%player%.coins} is less than 10
if {_players} bigger than 50:
send "&aBusy today."Try itat least / at mostsince 1.7.42The same as >= / <=. Also greater than or equal to and less than or equal to · level of player is at least 30
if level of player is at least 30:
send "&6You may enter."Try itis equal to / is not equal tosince 1.7.42The same as == / != · arg.1 is equal to "red"
if arg.1 is equal to "red":
send "&cRed it is."Try itis above / is belowsince 1.7.42The same as > / < · y of player's location is below 0
if y of player's location is above 200:
send "&bHigh up."Try itis between <a> and <b>since 1.7.0Not less than the one and not more than the other; both ends count. is not between is the opposite · level of player is between 10 and 20
if player.y is between 0 and 16:
send "&bDiamond level!"Try itany of <list> <condition>since 1.7.58The condition holds for at least one element of the list. What follows the list is any condition about one value; are and have may be written for is and has · any of {_scores} is above 100
command /anyrich:
trigger:
set {_coins} to [5, 250, 40]
if any of {_coins} is above 100:
send "&6Somebody is rich."Try itall of <list> <condition>since 1.7.58It holds for every element; for an empty list that is true · all of {team} are online
command /ready:
trigger:
set {_marks} to [3, 4, 5]
if all of {_marks} are above 2:
send "&aEverybody passed."Try itand, or, notCombine conditions · {_a} > 1 and not {locked}
if {%player%.coins} >= 50 and not {shop_closed}:
send "&aThe shop is open."Try itif {%player%.coins} >= 100:
send "&aYou can afford it."
else if {%player%.coins} >= 50:
send "&eAlmost there."
else:
send "&cNot enough coins."
| Operator | True when | Example |
|---|---|---|
== | Equal | player.world == "world_nether" |
!= | Not equal | arg.1 != "off" |
> < >= <= | Numeric comparison | player.health <= 5 |
contains | Left text includes right text, or left list includes right value; does not contain is the opposite | message contains "help" |
is between <a> and <b> | A number is in that range, ends included | player.y is between 0 and 64 |
is in <list> | The list contains the value | arg.1 is in ["on", "off"] |
is empty | Unset, empty text or an empty list | {queue} is empty |
is a list / a location / an item / a date / an entity / a table / text | What kind of value it is | {home} is a location |
is a player | The name of someone who is online | arg.1 is a player |
is alphanumeric | Only letters and digits | arg.1 is alphanumeric |
is sneaking / sprinting / swimming / blocking / sleeping / on ground / in water | What a player is doing | player is sneaking |
<who> is [not] riding | They sit on or in something: a horse, a boat, a minecart. vehicle of <who> is what | player is riding |
<who> is [not] looking at <target> | Their crosshair is on it, give or take a few degrees. The target is a location or somebody; up to 100 blocks away | player is looking at arg.1 |
<who> is [not] in biome <name> | Where they stand is that biome; a location works in place of a player | player is in biome "desert" |
<number> is [not] (even/odd) | A whole number that two goes into, or does not | level of player is even |
<number> is [not] divisible by <n> | It can be divided by that with nothing left over | level of player is divisible by 5 |
is op / is online | Also true or false for someone offline | arg.1 is online |
has played before | They have joined at least once before; has not played before is the opposite | arg.1 has played before |
has saved inventory <name> / does not have saved inventory <name> | An inventory was put away for them with save inventory | player has saved inventory "before-arena" |
is holding <item> / is wearing <item> | In either hand, or in an armour slot | player is holding diamond sword |
is in region <name> / is not in region <name> | The player is inside a region made with create region | player is in region "spawn" |
is on cooldown <name> / is not on cooldown <name> | A cooldown started with start cooldown is still running for them | player is on cooldown "kit" |
can see <player> | The other player is not hidden from them | player can see arg.1 |
<world> is raining / is day / is night | About a world, by name | player.world is night |
<block> is solid | The block type can be stood on | block at {_loc} is solid |
<block> is liquid | It is water or lava | block at {_loc} is liquid |
<block> is passable | It can be walked through: air, water, grass, flowers, torches | block at {_loc} is passable |
<block> is air | Nothing is there | block at {_loc} is air |
has space for <item> | The items would fit in the inventory | player has space for 5 diamond |
is bedrock / is dead | On the Bedrock edition (through Floodgate) / dead and not yet respawned | player is bedrock |
<a> if <condition> else <b> | Not a test but a choice: one value or the other | "on" if {flag} else "off" |
starts with / ends with | The text begins or ends with the other, ignoring case | message starts with "!" |
matches | The whole text fits a regular expression | arg.1 matches "[a-z0-9_]{3,16}" |
chance of <n>% | True about that often, at random | if chance of 25%: |
chance of <n>%: | The same as a block of its own: its lines run about that often. An if chance of <n>%: without the if; use the if when there is an else | chance of 10%: |
has <item> | The player's inventory holds at least that many | player has 5 diamond |
does not have <item> | It holds fewer | player does not have 1 "%{_material}%" |
has permission | The player holds the permission | player has permission "shop.vip" |
does not have permission | The player lacks the permission | player does not have permission "shop.vip" |
has effect / does not have effect | The player has that potion effect | player has effect speed |
is frozen / is vanished / is flying | See Players | arg.1 is frozen |
is tagged / is not tagged | The item carries that hidden tag | tool of player is tagged "wand" |
is banned / is not banned | The player is on the server's ban list | arg.1 is banned |
is set / is not set | The value exists / does not | {%player%.coins} is not set |
is a number / is not a number | The value is numeric | arg.1 is a number |
is / is not | The same as == / != | event.cause is "FALL", {%player%.frozen} is true |
bigger than / smaller than | The same as > / <. Also greater than, more than, larger than, higher than, and less than, lower than, fewer than. With or without is in front | {_players} bigger than 50, {%player%.coins} is less than 10 |
at least / at most | The same as >= / <=. Also greater than or equal to and less than or equal to | level of player is at least 30 |
is equal to / is not equal to | The same as == / != | arg.1 is equal to "red" |
is above / is below | The same as > / < | y of player's location is below 0 |
is between <a> and <b> | Not less than the one and not more than the other; both ends count. is not between is the opposite | level of player is between 10 and 20 |
any of <list> <condition> | The condition holds for at least one element of the list. What follows the list is any condition about one value; are and have may be written for is and has | any of {_scores} is above 100 |
all of <list> <condition> | It holds for every element; for an empty list that is true | all of {team} are online |
and, or, not | Combine conditions | {_a} > 1 and not {locked} |
A comparison can be written with its sign or in words; both mean the same:
command /check:
trigger:
set {_players} to server.online_players
if {_players} bigger than 50:
send "&aBusy today."
if {_players} smaller than 5:
send "&7Quiet today."
if level of player is at least 30:
send "&6You may enter."
if level of player at most 5:
send "&7You are new here."
if arg.1 is equal to "red":
send "&cRed it is."
if arg.1 is not equal to "red":
send "&7Not red."
if y of player's location is below 0:
send "&8Deep down."
if y of player's location is above 200:
send "&bHigh up."
if level of player is between 10 and 20:
send "&eIn the middle."
if {_players} is greater than or equal to 1 and {_players} is not more than 100:
send "&7Somebody is here."
if can have its statement on the same line, after the colon: if arg.1 is not set: stop. It takes one statement and has no else.else unless <condition>: joins the chain alongside else if.is test has an is not form: player is not sneaking, arg.1 is not in {allowed}.unless <condition>: is if the other way round; it runs its block when the condition is false:unless player has permission "fly.use":
send "&cYou cannot fly here."
stop
if {event_active}: is true for true, any non-zero number, any non-empty list, and any text other than false or empty.==, != and contains ignore case for text, and == compares numerically when both sides are numeric ("5" == 5 is true).not binds tighter than and, which binds tighter than or. Use parentheses when in doubt.player has permission "x" checks whoever triggered the script, so it is true for the console. To check someone else, put a name on the left: arg.1 has permission "x".has <item> counts across the whole inventory, armour and off hand included. A plain item such as 5 diamond matches any diamonds; an item written with a name or lore only matches stacks that carry them. A player who is offline has nothing. Take items away with remove 5 diamond from player; see Actions.loop 3 times:
send "Hello!"
for each {_name} in sorted server.players:
send "&7 - &f%{_name}%"
loop all players: runs its block once for every player who is online:
loop all players:
add 10 to {%loop-player%.coins}
send "&a%player.name% gave you 10 coins!" to loop-player
Inside any loop, loop-value is what the loop is on: the number of the round, the element of the list, the player.
loop 3 times:
send "&7Round %loop-value%"
loop from 10 to 1:
send "&e%loop-value%..."
wait 1 second
send "&aGo!"
loop from 0 to 100 by 25:
send "&7%loop-value%%"
loop {queue}:
send "&7%loop-index%. &f%loop-value%"
In a loop inside a loop the values are numbered from the outside in: loop-value-1 belongs to the first loop, loop-value-2 to the one inside it.
loop from 1 to 3:
loop from 1 to 3:
send "&7%loop-value-1% x %loop-value-2% = &f%loop-value-1 * loop-value-2%"
A loop can take some of what it goes through only, and say what to do when there was nothing:
loop all players with permission "staff.alerts":
send "&c%player.name% needs help." to loop-player
else:
send "&7No staff are online."
loop {queue} where loop-value is not player.name:
send "&7%loop-index%. &f%loop-value%"
loop blocks within 3 blocks of player:
if block at loop-value is "fire":
set block at loop-value to air
A counter, and a table's names and values:
loop 5 times with {_i}:
send "&7Round %{_i}%"
for each {_name}, {_place} in {warp}:
send "&b%{_name}% &7is at %{_place}%"
break and continue steer a loop from inside:
for each {_name} in {queue}:
if {_name} is "Steve":
continue
if size of {_picked} >= 3:
break
append {_name} to {_picked}
A while loop repeats for as long as its condition holds:
set {_n} to 3
while {_n} > 0:
send "&e%{_n}%..."
wait 1 second
subtract 1 from {_n}
send "&aGo!"
loop <n> times: repeats its block. To protect the server it refuses more than 100,000 (loop-limit in config.yml changes that) repetitions.for each {_item} in <list>: runs its block once per element, with the element in the local.loop <n> times with {_i}: puts the number of the round, from 1, in the local.loop from <a> to <b>: counts from the one number to the other, both included, and loop-value is the number: loop from 1 to 5 is 1, 2, 3, 4, 5 and loop from 5 to 1 is 5, 4, 3, 2, 1. by <n> is how far apart the numbers are: loop from 0 to 10 by 5 is 0, 5, 10, and loop from 0 to 1 by 0.25 works as well. Which way it counts is said by the two ends, so by is never negative, and it stops at the last number that does not pass the end: loop from 10 to 0 by 3 is 10, 7, 4, 1. The same limit as for loop <n> times applies.loop <list>: goes through a list without a local to name: loop {queue}:, loop sorted server.players:. The element is loop-value. Given a number it goes round that many times, so loop {_n}: is loop {_n} times:.loop-value is what the loop around the line is on. In loop <n> times and while that is the number of the round; in loop from the number; in for each and loop <list> the element (with for each {_key}, {_value} the value); in loop all players the player, like loop-player; in countdown the seconds left; in repeat the round. In text it is %loop-value%, and it can be written loop_value.loop-index is which round the loop is on, from 1, whatever the loop goes through: "%loop-index%. %loop-value%" numbers a list.loop-value-1 is the value of the outermost loop, loop-value-2 of the loop inside it, and so on; loop-index-1, loop-index-2 likewise. The plain loop-value is always the innermost loop's, the one the line is directly in. A number that no loop has (loop-value-3 inside two loops) is refused when the script loads, and so is loop-value outside a loop. To subtract from it, leave a space: loop-value - 1.for each {_key}, {_value} in {table}: goes through every name under a table and the value stored there, for saved tables ({warp}, {%player%.homes}) and local ones ({_data}) alike.repeat every <time> for <time>: runs its block, waits, and runs it again until the time is up; see Waiting.countdown 10 seconds: is a repeat that counts: its block runs once a second and seconds left is 10, then 9, down to 1. The lines after the block run when it has reached the end, so they are where "Go!" belongs. break ends it early.once every 5 seconds for player: runs its block at most that often for each player, which is a cooldown around any lines you like; else: under it is where "wait a moment" goes. It can also be written at most once every 5 seconds for player:.once for player: runs its block the first time a player gets there and never again; once per day for player: once in each day by the server's calendar, so a reward taken at 23:59 can be taken again at 00:00. Put a name after once (once "daily" per day for player:) if the block may be moved or changed later: without one HyperScript tells the once blocks of a script apart by what they say, and one that is rewritten counts as new. else: works as after if.loop all players: goes through whoever is online when it starts. Inside it, loop-player (in text, %loop-player%) is the name of the player the loop is on (it can also be written loop player or loop_player, which are the same word), and player is still whoever ran the command or caused the event. Everything that takes a player takes loop-player: loop-player's location, health of loop-player, {%loop-player%.coins}, send "..." to loop-player, loop-player has permission "x". loop-number is which round the loop is on, starting at 1; it is the same as loop-index and works in every loop.loop all players takes what says which of them: with permission "<node>", in world "<name>", within <n> blocks of <location>, or where <condition>, in which loop-player is each player in turn: loop all players where health of loop-player < 5:. The same works wherever something is done to all players: send "..." to all players with permission "staff", send title "Go!" to all players in world "arena".loop <list> where <condition>: goes through the elements the condition holds for only; in the condition loop-value is the element. loop-index then counts the ones that were kept.loop blocks within 3 blocks of player: and loop blocks from {_a} to {_b}: (each loop-value is the location of a block, so block at loop-value is what is there), loop entities within 10 blocks of player:, loop players within 10 blocks of player:, loop items in inventory of player:. Blocks are counted before the loop starts, and more than loop-limit of them are refused.else: directly under a loop runs when the loop never went round: the list was empty or was never set, nobody was online, the condition of a while did not hold the first time.while <condition>: checks the condition before every round.break loop 1 and continue loop 1 reach a loop further out, by the same numbers as loop-value-1: 1 is the outermost. break loop 1 leaves that loop and every loop inside it; continue loop 1 ends the loops inside it and starts its next round. They take a condition like the plain ones: break loop 1 if {_found} is set.break leaves the loop it is in and carries on after it. continue skips the rest of this round and starts the next. In nested loops both act on the innermost one.stop inside a loop ends the whole trigger, not just the loop.stop if {_coins} < 100, continue if loop-player is player.name, break unless {_found} is set. stop with <text> tells the player something first: stop with "&cNot enough coins." if {_coins} < 100.while loop that goes round 100,000 times (loop-limit in config.yml) without a wait is stopped with an error in the console, so a condition that never becomes false cannot freeze the server. A loop that waits each round may run for as long as you like.switch runs one block out of several, chosen by a value. It reads better than a chain of else if when a command has many subcommands:
switch arg.1:
case "on", "enable":
set {event_active} to true
case "off", "disable":
set {event_active} to false
default:
send "&eUsage: /event <on|off>"
case with a matching value runs, and only that one; there is no falling through.== does.case 1 to 5: is every number from the one to the other, both included, and can stand in a list with others: case 1 to 5, 10, 20 to 30:.default: runs when nothing matched. It is optional.function <name>(<locals>):since 1.5.6Any script
function reward({_who}, {_amount}):
add {_amount} to {%{_who}%.coins}
return {%{_who}%.coins}Try itlocal function <name>(<locals>):since 1.5.6Only the file it is written in
local function prefix():
return "&7[&bShop&7] "Try itA function is a block with a name. Write it once, at the left margin like a command, and call it from anywhere:
function reward({_who}, {_amount}):
add {_amount} to {%{_who}%.coins}
send "&a+%{_amount}% coins" to {_who}
return {%{_who}%.coins}
command /daily:
cooldown: 1 day
trigger:
set {_total} to reward(player.name, 50)
send "&7You now have %{_total}% coins."
| Form | Can be called from |
|---|---|
function <name>(<locals>): | Any script |
local function <name>(<locals>): | Only the file it is written in |
function refresh(): and called refresh().function reward({_who}, {_amount} = 10): can be called as reward(player.name) or reward(player.name, 50). Parameters with a default come last.reward(player.name, 50)) or anywhere a value is expected (set {_total} to reward(player.name, 50), if is_rich(player.name):).return <value> leaves the function and hands the value back; return on its own just leaves. A function that never returns a value gives unset.player and the event values are those of whoever called it. Its locals are its own: it cannot see the caller's locals, and the caller cannot see its.function is shared by every script, in whatever order the files load, so two scripts may not both define a shared function of the same name; the second one is refused with a message naming the first. Use local function for helpers that only one file needs. When both exist, a file's own local function is the one it gets._, and may not be a word that starts a statement, such as send or give.wait inside a function pauses the function only: the caller carries on at once, and gets whatever had been returned by then (normally nothing).wait <duration>since 1.5.2Any duration: wait 10 ticks, wait 5 seconds, wait 1 minute 30 seconds
wait 3 secondsTry itwait <number> secondssince 1.5.2The number may be a variable: wait {_delay} seconds
set {_delay} to 5
wait {_delay} secondsTry itwait until <condition> [for at most <duration>]since 1.7.0Pause until it is true
wait until block at (location below player's location) is "gold_block" for at most 30 secondsTry itwait between <duration> and <duration>since 1.7.57Pause for some time between the two, another every time: wait between 1 and 3 seconds, wait between 10 ticks and 1 second
command /fish:
trigger:
send "&7You cast the line..."
wait between 2 and 6 seconds
send "&bA bite!"Try itafter <duration>:since 1.7.57Run the block under it that much later, on its own: the lines below the block carry on at once. Inside it the local variables are as they were when the after was reached
on player join:
after 3 seconds:
send "&aWelcome, %player.name%."Try itrun <function>(...) in <duration>since 1.7.0Call a function later
function remind({_who}):
send "&eTime is up!" to {_who}
command /timer:
trigger:
run remind(player.name) in 30 secondsTry itrun <function>(...) in <duration> as <name>since 1.7.1The same, under a name it can be called off by
function end_boost({_who}):
set walk speed of {_who} to 0.2
command /boost:
trigger:
set walk speed of player to 0.4
run end_boost(player.name) in 30 seconds as "boost %player.name%"Try itschedule <function>(...) in <duration>since 1.7.10Like run ... in, but written down: the call still happens after a restart. Add as <name> to be able to replace it or call it off
function end_vip({_who}):
delete {%{_who}%.vip}
send "&7Your VIP time is over." to {_who}
command /vip <target:player>:
permission: "vip.give"
trigger:
set {%arg.1%.vip} to true
schedule end_vip(arg.1) in 30 days as "vip %arg.1%"Try itcancel schedule <name>since 1.7.10Call off a named schedule that has not happened yet
cancel schedule "vip %arg.1%"Try ittime until schedule <name>since 1.7.44How long a named schedule still has; unset if nothing waits under that name, so is set says whether one is pending
set {_left} to time until schedule "restart"Try itcancel run <name>since 1.7.1Call off a named run that has not happened yet
cancel run "boost %player.name%"Try itrepeat every <duration> for <duration>:since 1.7.0Run a block now and then again at each interval
repeat every 1 second for 10 seconds:
send title "&e%{_n}%" to all players
subtract 1 from {_n}Try itcountdown <duration>:since 1.7.52Run a block once a second, with seconds left counting down to 1; what comes after the block runs when it is over
countdown 5 seconds:
send title "&e%seconds left%" to player
send title "&aGo!" to playerTry itonce for <who>:since 1.7.52Run a block the first time only, for each player; else: under it runs every other time
on player join:
once for player:
send "&6Welcome! &7Type /help to get started."Try itonce per day for <who>:since 1.7.52The same once in each day; also per hour, per week, per month, or per 30 minutes for that long after the last time
command /daily:
trigger:
once per day for player:
add 100 to {%player%.coins}
send "&a+100 coins."
else:
send "&7You have had today's reward."Try itonce:since 1.7.52Without for: once for the whole server
on load:
once:
log "This server ran HyperScript for the first time."Try itwait pauses the trigger it is in, then carries on with the next line. Only that trigger pauses; the server and every other script keep running.
command /launch:
trigger:
send "&eLaunching in 3 seconds..."
wait 3 seconds
execute console command "effect give %player.name% minecraft:levitation 2 20"
wait 2 seconds
send "&aEnjoy the view."
| Syntax | Meaning |
|---|---|
wait <duration> | Any duration: wait 10 ticks, wait 5 seconds, wait 1 minute 30 seconds |
wait <number> seconds | The number may be a variable: wait {_delay} seconds |
wait works anywhere, including inside if, loops, GUI click blocks and async:. Local variables keep their values across it.wait, the event that started the trigger is over: cancel event and statements that change the event, such as set join message, no longer have any effect.Waiting for something. wait until pauses until a condition holds, looking again four times a second:
send "&7Stand on the gold block to start."
wait until block at (location below player's location) is "gold_block" for at most 30 seconds
send "&aGo!"
It gives up after the time given with for at most, or after five minutes if none is given, and the script carries on either way; test the condition again afterwards if it matters.
Doing something later, and again. run calls a function after a delay without making the rest of the trigger wait, and repeat runs a block at intervals for a while:
function unfreeze_later({_who}):
unfreeze {_who}
send "&aYou can move again." to {_who}
command /timeout <player>:
permission: "staff.timeout"
trigger:
freeze arg.1
run unfreeze_later(arg.1) in 30 seconds
command /countdown:
trigger:
set {_n} to 10
repeat every 1 second for 10 seconds:
send title "&e%{_n}%" to all players
subtract 1 from {_n}
| Syntax | Effect |
|---|---|
wait until <condition> [for at most <duration>] | Pause until it is true |
wait between <duration> and <duration> | Pause for some time between the two, another every time: wait between 1 and 3 seconds, wait between 10 ticks and 1 second |
after <duration>: | Run the block under it that much later, on its own: the lines below the block carry on at once. Inside it the local variables are as they were when the after was reached |
run <function>(...) in <duration> | Call a function later |
run <function>(...) in <duration> as <name> | The same, under a name it can be called off by |
schedule <function>(...) in <duration> | Like run ... in, but written down: the call still happens after a restart. Add as <name> to be able to replace it or call it off |
cancel schedule <name> | Call off a named schedule that has not happened yet |
time until schedule <name> | How long a named schedule still has; unset if nothing waits under that name, so is set says whether one is pending |
cancel run <name> | Call off a named run that has not happened yet |
repeat every <duration> for <duration>: | Run a block now and then again at each interval |
countdown <duration>: | Run a block once a second, with seconds left counting down to 1; what comes after the block runs when it is over |
once for <who>: | Run a block the first time only, for each player; else: under it runs every other time |
once per day for <who>: | The same once in each day; also per hour, per week, per month, or per 30 minutes for that long after the last time |
once: | Without for: once for the whole server |
Normally a line that cannot be done stops the trigger and reports the mistake. try: lets a script deal with it instead:
try:
set {_data} to send get request to "https://hyperscript.monoforge.net/api/test"
log "The website answered: %{_data}%"
on error:
log "Could not reach the website: %{_error}%"
https://hyperscript.monoforge.net/api/test is a real address kept for trying requests out: it answers with the plain text Yup works.
try: block fails, the rest of the block is skipped and the on error: block runs, with {_error} holding the message.on error: is optional. Without it the failure is simply ignored and the script carries on.fail "<text>" is a mistake of your own making: the trigger stops there as it does for any other, and a try: around it, also one in the code that called the function it is in, gets the text in {_error}. Outside a try: it ends the trigger and is written to the console.wait inside the block is not caught; put the try: after the wait.This is the file installed to plugins/HyperScript/scripts/disabled_demo.hs on first start, switched off until /hyperscript enable demo (source). It uses commands, every event, math, persistent variables, a GUI, lists, an async block, world effects, cooldowns, titles, a boss bar, an opt-in sidebar driven by a timer, a custom item, a stored location, a text file per player, sounds, a protected region, time and weather, a web API lookup read with json value, fall-damage protection, a countdown built from while and wait, a function, parse, another player's variables, loop all players, inventory checks, and ends with Discord examples that are commented out until config.yml is set up.
# ==============================================================
# demo.hs - a tour of HyperScript
# Edit this file, then run /hyperscript reload
# ==============================================================
# ---- Events --------------------------------------------------
on player join:
if {%player%.joins} is not set:
set {%player%.joins} to 0
set {%player%.coins} to 100
broadcast "&6Welcome &e%player.name% &6to the server for the first time!"
add 1 to {%player%.joins}
send "&aHello %player.name%! &7Visit #%{%player%.joins}%, balance &e%{%player%.coins}% coins"
send "&7Server %server.version% | TPS %server.tps% | Online %server.online_players%"
if {event_active}:
send "&d&lThe double coins event is active!"
on player quit:
log "%player.name% left with %{%player%.coins}% coins (ping %player.ping% ms)"
on block break:
# Regions made with /protect: only admins may break blocks inside them.
if region at event's location contains "spawn":
if player does not have permission "demo.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
stop
set {_reward} to random integer between 1 and 3
if event.block contains "ore":
set {_reward} to {_reward} * 5
if player has permission "demo.vip":
set {_reward} to {_reward} + 2
if {event_active}:
set {_reward} to {_reward} * 2
add {_reward} to {%player%.coins}
add 1 to {%player%.blocks}
# Every 50th block pays a bonus.
if {%player%.blocks} % 50 == 0:
add 25 to {%player%.coins}
send "&b%{%player%.blocks}% blocks mined! &6+25 bonus coins"
play sound "entity.player.levelup" with pitch 1.2 and volume 0.8 for player
on entity death:
# The player here is the killer; there is none when a mob dies on its own.
if event.killer is set:
set {_bounty} to random integer between 5 and 15
add {_bounty} to {%player%.coins}
send "&6+%{_bounty}% coins &7for slaying a %event.entity%"
on player chat:
# Inside an event, its values have short names: "message" is event.message.
if message contains "free op":
cancel event
send "&cThat phrase is not allowed here."
on entity damage:
# Fires for every hit on the server, so the cheapest test comes first.
if cause is "FALL":
if player has permission "demo.nofall":
cancel event
send action bar "&aFall damage negated!" to victim
on right click:
# At most once every 2 seconds per player; clicks in between are ignored.
cooldown: 2 seconds
if event.item == "compass":
send "&bWorld &f%player.world% &7| &bMode &f%player.gamemode% &7| &bHealth &f%player.health%"
# ---- Commands ------------------------------------------------
command /coins:
description: Show your coin balance
usage: /coins
aliases: bal, balance
trigger:
if player is not set:
send "&cOnly players have a balance."
stop
send "&6Balance: &e%{%player%.coins}% coins"
command /gamble:
description: Bet coins on a 45% chance to double them
usage: /gamble <amount>
permission: demo.gamble
permission message: "&cYou are not allowed to gamble."
aliases: bet
trigger:
if player is not set:
send "&cOnly players can gamble."
stop
if args.count != 1 or arg.1 is not a number:
send "&cUsage: /gamble <amount>"
stop
set {_bet} to arg.1
if {_bet} <= 0:
send "&cThe bet must be more than 0."
else if {_bet} > {%player%.coins}:
send "&cYou only have %{%player%.coins}% coins."
else if random integer between 1 and 100 <= 45:
add {_bet} to {%player%.coins}
send "&aYou won %{_bet}% coins! &7Balance: %{%player%.coins}%"
else:
subtract {_bet} from {%player%.coins}
send "&cYou lost %{_bet}% coins. &7Balance: %{%player%.coins}%"
command /event:
description: Toggle the double coins event
usage: /event <on|off>
permission: demo.admin
trigger:
if arg.1 == "on":
set {event_active} to true
broadcast "&d&lDouble coins event started!"
create bossbar "event" titled "&d&lDouble Coins Event" with color purple with progress 100 for all players
else if arg.1 == "off":
set {event_active} to false
broadcast "&7The double coins event has ended."
remove bossbar "event"
else:
send "&eEvent active: %{event_active}% &7- usage: /event <on|off>"
# ---- GUIs, lists, async and world effects --------------------
command /shop:
description: Open the coin shop
usage: /shop
trigger:
if player is not set:
send "&cOnly players can open the shop."
stop
open gui with title "&8Coin Shop" with 3 rows for player:
slot 12 is "diamond" named "&bDiamond" lore "&7Price: &e50 coins|&7Click to buy":
if {%player%.coins} < 50:
send "&cYou need 50 coins for that."
else:
subtract 50 from {%player%.coins}
execute console command "give %player.name% diamond 1"
spawn particle "dust" colored "#55ffff" count 20 at player
send "&aBought a diamond. &7Balance: %{%player%.coins}%"
close gui
slot 14 is "gold_ingot" named "&6Balance: &e%{%player%.coins}% coins"
slot 16 is "barrier" named "&cClose":
close gui
command /who:
description: List online players in alphabetical order
usage: /who
trigger:
send "&6Online (%server.online_players%):"
for each {_name} in sorted server.players:
send "&7 - &f%{_name}%"
command /sethome:
description: Remember where you are standing
usage: /sethome
trigger:
if player is not set:
stop
# A variable can hold a location (world and coordinates) as one value.
set {%player%.home} to player's location
spawn text display "&e%player.name%'s home" at player for 10 seconds
send "&aHome set."
command /home:
description: Return to your home
usage: /home
trigger:
if {%player%.home} is not set:
send "&cUse /sethome first."
stop
teleport player to {%player%.home}
send "&aWelcome home. &7(%{%player%.home}%)"
command /highscores:
description: Show the balances recorded with /cashout
usage: /highscores
trigger:
# {scores} is a list; /cashout appends to it.
async:
# Sorting and filtering run off the server thread...
set {_ranked} to reversed sorted {scores}
set {_count} to size of {_ranked}
set {_best} to item 1 of {_ranked}
set {_rich} to size of (filter {_ranked} where it >= 500)
sync:
# ...and the result is reported back on it.
if {_count} == 0:
send "&7No scores yet. Use /cashout to record yours."
else:
send "&6Best score: &e%{_best}% &7(%{_count}% recorded, %{_rich}% of 500 or more)"
command /cashout:
description: Record your current balance on the high score list
usage: /cashout
trigger:
if player is not set:
stop
append {%player%.coins} to {scores}
send "&aRecorded &e%{%player%.coins}% &aon the high score list."
# ---- Functions, other players and parsing --------------------
# A function can be called from any script. Written as "local function"
# it could only be used in this file.
function pay({_from}, {_to}, {_amount}):
subtract {_amount} from {%{_from}%.coins}
add {_amount} to {%{_to}%.coins}
return {%{_to}%.coins}
command /pay <player> <amount>:
description: Give some of your coins to another player
usage: /pay <player> <amount>
trigger:
if player is not set:
stop
# Arguments arrive as text; parse turns "52" into the number 52.
set {_amount} to parse arg.2 as integer
if {_amount} is not set or {_amount} < 1:
send "&c'%arg.2%' is not an amount."
stop
# A name that starts with a player is that player's own variable,
# whether they are online or not.
if {%arg.1%.joins} is not set:
send "&c%arg.1% has never played here."
stop
if {%player%.coins} < {_amount}:
send "&cYou only have %{%player%.coins}% coins."
stop
set {_total} to pay(player.name, arg.1, {_amount})
send "&aSent &e%{_amount}% &acoins to %arg.1%."
send "&e%player.name% &asent you &e%{_amount}% &acoins. You now have &e%{_total}%&a." to arg.1
command /bonus <amount>:
description: Give every online player some coins
usage: /bonus <amount>
permission: op
trigger:
set {_amount} to parse arg.1 as integer
if {_amount} is not set:
send "&cUsage: /bonus <amount>"
stop
# "player" is still whoever ran the command; "loop-player" is each player in turn.
loop all players:
add {_amount} to {%loop-player%.coins}
send "&6Everybody received &e%{_amount}% &6coins from %player.name%!" to all players
command /sell:
description: Sell 8 cobblestone for 4 coins
usage: /sell
trigger:
if player does not have 8 cobblestone:
send "&cYou need 8 cobblestone to sell."
stop
remove 8 cobblestone from player
add 4 to {%player%.coins}
send "&aSold 8 cobblestone for &e4 coins&a."
on player death:
subtract 5 from {%player%.coins}
send "&cYou died and lost 5 coins."
# ---- Cooldowns, titles, scoreboards and particle shapes ------
command /kit:
description: Claim a starter kit once an hour
usage: /kit
cooldown: 1 hour
cooldown message: "&cYou must wait %cooldown% before using /kit again!"
trigger:
if player is not set:
send "&cOnly players can claim a kit."
stop
give 1 diamond to player
give 16 bread to player
send title "&6Kit claimed!" with subtitle "&eCome back in an hour" to player with fadein 10 stay 60 fadeout 20
send action bar "&a+1 Diamond +16 Bread" to player
draw particle circle with radius 1.5 using particle "flame" at player's location
command /sidebar:
description: Show or hide the stats sidebar
usage: /sidebar
trigger:
if player is not set:
stop
if {%player%.sidebar}:
set {%player%.sidebar} to false
clear player's scoreboard
send "&7Sidebar hidden."
else:
set {%player%.sidebar} to true
send "&aSidebar shown."
# Runs once a second for every online player; only those who asked get the sidebar.
every 1 second for all players:
if {%player%.sidebar}:
set title of player's scoreboard to "&e&lHYPERSCRIPT"
set line 1 of player's scoreboard to "&7Coins: &a%{%player%.coins}%"
set line 2 of player's scoreboard to "&7Ping: &f%player.ping% ms"
set line 3 of player's scoreboard to "&7Online: &f%server.online_players%"
set line 4 of player's scoreboard to "&7TPS: &f%server.tps%"
# ---- Custom items, files and text ----------------------------
command /excalibur:
description: Receive a named sword, once a day
usage: /excalibur
cooldown: 1 day
trigger:
if player is not set:
send "&cOnly players can wield it."
stop
give player 1 diamond sword named "&6Excalibur" with lore "&7A legendary blade", "&7Forged in fire."
# Items are values too: remember what was handed out.
set {%player%.last_reward} to diamond sword named "&6Excalibur"
send "&aYou received &f%{%player%.last_reward}%&a."
command /note:
description: Save a note to a text file, or read it back
usage: /note [text]
trigger:
if player is not set:
stop
# One file per player, named by UUID so nothing a player types ends up in the path.
set {_path} to "plugins/HyperScript/notes/%player.uuid%.txt"
if args.count > 0:
set file at {_path} to args
send "&aNote saved."
else if file at {_path} exists:
set {_note} to read file at {_path}
set {_words} to split {_note} by " "
set {_count} to size of {_words}
set {_shout} to uppercase (first 20 characters of {_note})
send "&eYour note (%{_count}% words): &f%{_note}%"
send "&7Starts with: &f%{_shout}%"
else:
send "&7You have no note yet. Write one with /note <text>"
# ---- Worlds, regions, sounds and web requests ----------------
command /day:
description: Set the time to day and clear the weather in your world
usage: /day
permission: demo.admin
trigger:
if player is not set:
send "&cRun this as a player, so there is a world to change."
stop
set time in world "%player.world%" to 1000
set weather in world "%player.world%" to clear
broadcast "&e%player.name% set the time to day in %player.world%!"
play sound "block.note_block.pling" with pitch 2.0 and volume 0.5 for all players in world "%player.world%"
command /protect:
description: Protect the area within 5 blocks of you as the spawn region
usage: /protect
permission: demo.admin
trigger:
if player is not set:
stop
create region "spawn" from player.x - 5, 0, player.z - 5 to player.x + 5, 255, player.z + 5
send "&aSpawn region set around you. Remove it with /unprotect."
command /unprotect:
description: Remove the spawn region
usage: /unprotect
permission: demo.admin
trigger:
delete region "spawn"
send "&7Spawn region removed."
command /lookup <player>:
description: Look up a player's UUID using Mojang's web API
cooldown: 5 seconds
trigger:
if args.count != 1:
send "&cUsage: /lookup <player>"
reset cooldown
stop
send "&eFetching data from the API..."
# Web requests wait for an answer, so they belong in an async block.
async:
set {_response} to send get request to "https://api.mojang.com/users/profiles/minecraft/" + urlencoded arg.1
# The answer is JSON such as {"id":"...","name":"..."}; pick the id out of it.
set {_uuid} to json value "id" of {_response}
sync:
if {_uuid} is set:
send "&aUUID of %arg.1%: &f%{_uuid}%"
else:
send "&cPlayer profile not found."
command /countdown:
description: Count down from 3, one number a second
usage: /countdown
cooldown: 10 seconds
trigger:
set {_n} to 3
# 'wait' pauses this trigger only; the server carries on as normal meanwhile.
while {_n} > 0:
send title "&e%{_n}%" to player with fadein 0 stay 20 fadeout 5
play sound "block.note_block.pling" for player
wait 1 second
subtract 1 from {_n}
send title "&aGo!" to player
# ---- Server list, tab list and chat (remove the leading '#' to use) ----
#
# on server ping:
# set motd to random item of ["&6HyperScript demo server", "&bNow with double coins!"]
# set max players to 100
#
# on player join:
# set join message to "&a+ &f%player.name%"
# set tab header of player to "&6&lMy Server"
# set tab footer of player to "&7Online: %server.online_players%"
#
# on player chat:
# set chat format to "&7[&bMember&7] &f%player.name%&7: &f%event.message%"
# ---- Resource packs (remove the leading '#' and use your own pack) ----
#
# on player join:
# send resource pack "https://example.com/pack.zip" with hash "da39a3ee5e6b4b0d3255bfef95601890afd80709" to player
#
# on resource pack decline:
# send "&cYou declined the resource pack. Some custom items may look wrong."
#
# on resource pack successfully loaded:
# send "&aResource pack loaded!"
# ---- Discord (remove the leading '#' after setting up config.yml) ----
#
# Webhooks need a URL under discord.webhooks in config.yml:
#
# on player join:
# send webhook "alerts" with content "%player.name% joined the server" as "HyperScript"
#
# Slash commands need discord.bot.enabled and a bot token:
#
# on discord command "/online":
# reply "%server.online_players% player(s) online: %server.players%"
Text, numbers, lists and dates, and the values the server hands a script.
split <text> by <separator>since 1.3.0A list of the pieces · split "Coins:500" by ":" gives Coins, 500
set {_parts} to split {_data} by ":"Try itjoin <list> with <separator>since 1.3.0The elements as one text · join {_names} with ", "
send "Online: " + join server.players with ", "Try ituppercase <text> / lowercase <text>since 1.3.0Changed case · uppercase "hi" gives HI
set {_shout} to uppercase (first 20 characters of {_note})Try ittrimmed <text>since 1.3.0Without spaces at either end · trimmed " hi " gives hi
set {_name} to trimmed argsTry itreplace <a> with <b> in <text>since 1.3.0Every <a> replaced · replace "_" with " " in "diamond_sword"
set {_pretty} to replace "_" with " " in "diamond_sword"Try itreplace regex <pattern> with <b> in <text>since 1.7.20Every part the regular expression fits, replaced · replace regex "\\d+" with "#" in "a12 b345" gives a# b#
on chat:
# Hide anything that looks like an address.
set chat message to replace regex "\\d+\\.\\d+\\.\\d+\\.\\d+" with "[hidden]" in messageTry itregex matches of <pattern> in <text>since 1.7.20A list of every part that fits · regex matches of "\\d+" in "a12 b345" gives 12, 345
command /numbers <text>:
trigger:
set {_found} to regex matches of "\\d+" in args
send "&7Numbers: &f" + join {_found} with ", "Try itregex groups of <pattern> in <text>since 1.7.20What the brackets of the pattern caught in the first part that fits, as a list; the whole part if the pattern has no brackets; empty if nothing fits · regex groups of "(\\w+)=(\\d+)" in "coins=250" gives coins, 250
command /setting <text>:
trigger:
set {_parts} to regex groups of "(\\w+)=(\\d+)" in arg.1
if size of {_parts} is 2:
send "&7" + item 1 of {_parts} + " is " + item 2 of {_parts}Try itfirst <n> characters of <text>since 1.3.0The start of the text · first 3 characters of "Hello" gives Hel
set {_shout} to uppercase (first 20 characters of {_note})Try itlast <n> characters of <text>since 1.3.0The end of the text · last 2 characters of "Hello" gives lo
set {_ending} to last 3 characters of player.nameTry itcharacters <a> to <b> of <text>since 1.3.0A slice, counting from 1, both ends included · characters 2 to 4 of "Hello" gives ell
set {_middle} to characters 2 to 4 of "Hello"Try itlength of <text>since 1.3.0Number of characters · length of "Hello" gives 5
if length of args > 50:
send "&cThat is too long."Try itrounded <number>since 1.3.0The nearest whole number · rounded 2.5 gives 3
send "TPS: " + rounded server.tpsTry itjson of <value>since 1.7.3A list, a local table, a number or text written out as JSON, ready to send · json of ["a", 2] gives ["a",2]
set {_body.player} to player.name
set {_body.coins} to {%player%.coins} + 0
send post request to "https://example.com/hook" with body json of {_body}Try itjson value <path> of <text>since 1.5.2A value out of JSON text; see Web requests · json value "id" of {_response}
log json value "name" of {_json}Try itparse <text> as numbersince 1.5.6The text as a number; unset if it is not one. An amount written short counts: 1.5k is 1500, 2m two million, 1b a thousand million · parse "52" as number gives 52
set {_amount} to parse arg.1 as number
if {_amount} is not set:
send "&cThat is not a number."Try itparse <text> as integersince 1.5.6The same, rounded down to a whole number · parse "7.9" as integer gives 7
set {_whole} to parse "7.9" as integerTry itparse <value> as textsince 1.5.6A number or any other value as text · parse 52 as text gives "52"
set {_label} to parse 52 as textTry itparse <text> as timesince 1.7.47Text such as "1h 30m", "90 seconds" or "2 days and 4 hours" as a duration; unset if it is not one. Also written as duration · parse "1h 30m" as time gives 1 hour 30 minutes
set {_long} to parse arg.1 as time
if {_long} is not set:
send "&cSay how long, such as 1h 30m."
stop
send "&aMuted for %{_long}%."Try itbar of <part> out of <whole>since 1.7.50A bar of ten characters, as much of it filled as part is of whole. Add with <n> characters, using "<character>" and colored "<filled>" and "<rest>" as wanted · bar of 3 out of 10 gives &a███&7███████
send action bar "&7XP " + bar of {%player%.xp} out of 100 to playerTry itrandom text of <n> characterssince 1.7.55Letters and digits picked at random, without the ones that look alike (0 and O, 1 and l): for vouchers and codes · random text of 8 characters gives something like kT7mQ2xp
set {_code} to random text of 8 characters
send "&7Your voucher: &f%{_code}%"Try itrandom code of <n> digitssince 1.7.55Digits only · random code of 4 digits gives something like 0382
set {_pin} to random code of 4 digitsTry itnew idsince 1.7.55An id that nothing else has, 36 characters long · new id
set {_id} to new idTry ittry parse <text> as numbersince 1.7.20The same as parse, for those who like it said: text that is not a number gives unset, never an error. Works with integer and text too · try parse "abc" as number is not set
command /pay <amount>:
trigger:
set {_amount} to try parse arg.1 as number
if {_amount} is not set:
send "&c%arg.1% is not a number."
stop
send "&aPaying %{_amount}%."Try itduration(<seconds>)since 1.5.7Seconds as readable time · duration(125) gives 2 minutes 5 seconds
send "&7Uptime: " + duration(125)Try itcapitalized <text>since 1.7.0The first letter in upper case · capitalized "hello" gives Hello
send capitalized "hello there"Try ittitle case <text>since 1.7.0Every word capitalised; underscores become spaces · title case "diamond_sword" gives Diamond Sword
set {_nice} to title case "diamond_sword"
send "&7You found a %{_nice}%"Try ituncoloured <text>since 1.7.0Without colour codes · uncoloured "&aHi" gives Hi
log uncoloured "&aGreen text"Try itword <n> of <text>since 1.7.0One word, counting from 1 · word 2 of "one two three" gives two
set {_first} to word 1 of argsTry it<text> repeated <n> timessince 1.7.0The text over and over · "=" repeated 20 times
send "&8" + ("-" repeated 20 times)Try it<text> padded to <n>since 1.7.1Spaces added at the end (or in front, with padded left to), for lining things up · "Name" padded to 12
for each {_name} in server.players:
send "&f" + ({_name} padded to 16) + "&e%{%{_name}%.coins}%"Try it<text> shortened to <n>since 1.7.59Cut to that many characters, the last of them …, if it is longer; colour codes are not counted · "Hello world" shortened to 8 gives Hello w…
command /tag <words:text>:
trigger:
set {_tag} to arg.1 shortened to 12
send "&7Your tag: &f%{_tag}%"Try it<text> wrapped to <n>since 1.7.59A list of lines no longer than that, broken between words, each going on in the colour the one before ended in. For lore and signs · {_about} wrapped to 30
command /about:
trigger:
set {_about} to "&7A sword that was made long ago and has never lost a fight."
loop {_about} wrapped to 24:
send loop-valueTry it<text> centered to <n>since 1.7.44Spaces on both sides, so that the text stands in the middle of that many characters; colour codes are not counted · "SHOP" centered to 20
set {_title} to arg.1 centered to 30Try itbetween(text, before, after)since 1.7.44What stands between two pieces of a text; unset if either is not there · between("Hello [world]!", "[", "]") gives world
set {_inner} to between("Hello [world]!", "[", "]")
send "&7%{_inner}%"Try it<text> parsed as numbersince 1.5.9The same as parse ... as number, written after the value; also integer, text, player, offlineplayer · arg.1 parsed as number
set {_amount} to arg.1 parsed as number
if {_amount} is not set:
send "&cThat is not a number."Try it<text> as offlineplayersince 1.7.26A player by name, online now or not. For somebody who has played here it is the name as the server has it; has played before says whether they have. Also written as offline player, parsed as offlineplayer and parse <text> as offlineplayer · "Progamer52" as offlineplayer
command /seen <player>:
trigger:
set {_who} to arg.1 as offlineplayer
if {_who} has not played before:
send "&c%arg.1% has never played here."
stop
send "&7%{_who}% was last on " + last seen of {_who} formatted as "d MMMM yyyy"Try itnow formatted as <pattern>since 1.5.9The date and time, written the way the pattern says · now formatted as "HH:mm" gives 18:30
send "&7It is " + now formatted as "HH:mm"Try iturlencoded <text>since 1.4.0Made safe to put inside a URL · urlencoded "a b&c" gives a%20b%26c
set {_response} to send get request to "https://api.mojang.com/users/profiles/minecraft/" + urlencoded arg.1Try it<text> contains <text>since 1.3.0Whether one includes the other, ignoring case · message contains "help"
if {winners} contains player.name:
send "You already won."Try it<text> + <text>since 1.3.0Joined · "Level " + 5 gives Level 5
set {_greeting} to "Hello, " + player.nameTry it| Syntax | Result | Example |
|---|---|---|
split <text> by <separator> | A list of the pieces | split "Coins:500" by ":" gives Coins, 500 |
join <list> with <separator> | The elements as one text | join {_names} with ", " |
uppercase <text> / lowercase <text> | Changed case | uppercase "hi" gives HI |
trimmed <text> | Without spaces at either end | trimmed " hi " gives hi |
replace <a> with <b> in <text> | Every <a> replaced | replace "_" with " " in "diamond_sword" |
replace regex <pattern> with <b> in <text> | Every part the regular expression fits, replaced | replace regex "\\d+" with "#" in "a12 b345" gives a# b# |
regex matches of <pattern> in <text> | A list of every part that fits | regex matches of "\\d+" in "a12 b345" gives 12, 345 |
regex groups of <pattern> in <text> | What the brackets of the pattern caught in the first part that fits, as a list; the whole part if the pattern has no brackets; empty if nothing fits | regex groups of "(\\w+)=(\\d+)" in "coins=250" gives coins, 250 |
first <n> characters of <text> | The start of the text | first 3 characters of "Hello" gives Hel |
last <n> characters of <text> | The end of the text | last 2 characters of "Hello" gives lo |
characters <a> to <b> of <text> | A slice, counting from 1, both ends included | characters 2 to 4 of "Hello" gives ell |
length of <text> | Number of characters | length of "Hello" gives 5 |
rounded <number> | The nearest whole number | rounded 2.5 gives 3 |
json of <value> | A list, a local table, a number or text written out as JSON, ready to send | json of ["a", 2] gives ["a",2] |
json value <path> of <text> | A value out of JSON text; see Web requests | json value "id" of {_response} |
parse <text> as number | The text as a number; unset if it is not one. An amount written short counts: 1.5k is 1500, 2m two million, 1b a thousand million | parse "52" as number gives 52 |
parse <text> as integer | The same, rounded down to a whole number | parse "7.9" as integer gives 7 |
parse <value> as text | A number or any other value as text | parse 52 as text gives "52" |
parse <text> as time | Text such as "1h 30m", "90 seconds" or "2 days and 4 hours" as a duration; unset if it is not one. Also written as duration | parse "1h 30m" as time gives 1 hour 30 minutes |
bar of <part> out of <whole> | A bar of ten characters, as much of it filled as part is of whole. Add with <n> characters, using "<character>" and colored "<filled>" and "<rest>" as wanted | bar of 3 out of 10 gives &a███&7███████ |
random text of <n> characters | Letters and digits picked at random, without the ones that look alike (0 and O, 1 and l): for vouchers and codes | random text of 8 characters gives something like kT7mQ2xp |
random code of <n> digits | Digits only | random code of 4 digits gives something like 0382 |
new id | An id that nothing else has, 36 characters long | new id |
try parse <text> as number | The same as parse, for those who like it said: text that is not a number gives unset, never an error. Works with integer and text too | try parse "abc" as number is not set |
duration(<seconds>) | Seconds as readable time | duration(125) gives 2 minutes 5 seconds |
capitalized <text> | The first letter in upper case | capitalized "hello" gives Hello |
title case <text> | Every word capitalised; underscores become spaces | title case "diamond_sword" gives Diamond Sword |
uncoloured <text> | Without colour codes | uncoloured "&aHi" gives Hi |
word <n> of <text> | One word, counting from 1 | word 2 of "one two three" gives two |
<text> repeated <n> times | The text over and over | "=" repeated 20 times |
<text> padded to <n> | Spaces added at the end (or in front, with padded left to), for lining things up | "Name" padded to 12 |
<text> shortened to <n> | Cut to that many characters, the last of them …, if it is longer; colour codes are not counted | "Hello world" shortened to 8 gives Hello w… |
<text> wrapped to <n> | A list of lines no longer than that, broken between words, each going on in the colour the one before ended in. For lore and signs | {_about} wrapped to 30 |
<text> centered to <n> | Spaces on both sides, so that the text stands in the middle of that many characters; colour codes are not counted | "SHOP" centered to 20 |
between(text, before, after) | What stands between two pieces of a text; unset if either is not there | between("Hello [world]!", "[", "]") gives world |
<text> parsed as number | The same as parse ... as number, written after the value; also integer, text, player, offlineplayer | arg.1 parsed as number |
<text> as offlineplayer | A player by name, online now or not. For somebody who has played here it is the name as the server has it; has played before says whether they have. Also written as offline player, parsed as offlineplayer and parse <text> as offlineplayer | "Progamer52" as offlineplayer |
now formatted as <pattern> | The date and time, written the way the pattern says | now formatted as "HH:mm" gives 18:30 |
urlencoded <text> | Made safe to put inside a URL | urlencoded "a b&c" gives a%20b%26c |
<text> contains <text> | Whether one includes the other, ignoring case | message contains "help" |
<text> + <text> | Joined | "Level " + 5 gives Level 5 |
command /banner <text>:
trigger:
set {_title} to arg.1 centered to 30
send "&8[&f%{_title}%&8]"
for each {_word} in words of "red green blue":
send "&7%{_word}%"
set {_inner} to between("Hello [world]!", "[", "]")
set {_bar} to lerp(0, 20, 0.25)
send "&7%{_inner}% %{_bar}%"
set {_data} to "Coins:500"
set {_parts} to split {_data} by ":"
set {_coins} to item 2 of {_parts} + 100
send "You have %{_coins}% coins"
parse is how text that came from a player, a file or a web page becomes a number you can rely on. If the text is not a number the result is unset, which is easy to test for:set {_amount} to parse arg.1 as number
if {_amount} is not set:
send "&c'%arg.1%' is not a number."
stop
send, the word title means a title on screen, so put title case in a variable first or in brackets: send (title case {_item}).&a style codes, text may use <#rrggbb> for an exact colour, as in "<#ff8800>Orange <#00c8ff>and blue". It works wherever colour codes do, on Minecraft 1.16 and newer.now formatted as takes Java's date letters: yyyy year, MM month number, MMMM month name, d day, EEEE weekday name, HH hour, mm minute, ss second. "d MMMM yyyy 'at' HH:mm" gives 11 October 2026 at 18:30. Text inside single quotes is taken as it is.split is taken literally, and splitting by "" gives the single characters.item 2 of {_parts} + 100 shows.uppercase (first 3 characters of {_name}).%nl%, or %new line%: send "&6Rules%nl%&71. Be kind". It works in every text: chat, holograms, lore, files, and text in front of a player.+Add · 7 + 2 · 9
set {%player%.coins} to {%player%.coins} + 50Try it-Subtract, or negate · 7 - 2 · 5
set {_left} to {%player%.coins} - 50Try it*Multiply · 7 * 2 · 14
set {_double} to {%player%.coins} * 2Try it/Divide · 7 / 2 · 3.5
set {_average} to {%player%.total} / {%player%.games}Try it%Modulo (remainder) · 7 % 2 · 1
if {%player%.blocks} % 50 == 0:
send "&bAnother 50 blocks mined!"Try it( )Grouping · (7 + 2) * 2 · 18
set {_total} to ({_price} + {_tax}) * {_amount}Try itrandom integer between A and BWhole number, both ends included · random integer between 1 and 10 · 1..10
set {_roll} to random integer between 1 and 6Try itrandom number between A and BDecimal number · random number between 0 and 1 · e.g. 0.4217
set {_chance} to random number between 0 and 1Try itmin(a, b, ...) / max(a, b, ...)since 1.5.7The smallest / largest; also takes one list · max(1, {%player%.level})
set {_level} to max(1, {%player%.level})
set {_cheapest} to min([30, 12, 45])Try itabs(n)since 1.5.7Without its sign · abs(-7) gives 7
set {_apart} to abs(player.y - 64)Try itround(n)since 1.5.7The nearest whole number · round(2.5) gives 3
set {_whole} to round(2.5)Try itfloor(n) / ceil(n)since 1.5.7Rounded down / up · ceil(2.1) gives 3
set {_pages} to ceil(size of {warps} / 9)Try itrounded up <n> / rounded down <n>since 1.5.7The same two, in words · rounded up 2.1 gives 3
set {_minutes} to rounded up ({_seconds} / 60)Try itsqrt(n)since 1.5.7Square root · sqrt(25) gives 5
set {_side} to sqrt(25)Try itpow(a, b)since 1.7.0a to the power of b · pow(2, 10) gives 1024
set {_cost} to 100 * pow(2, {%player%.upgrades})Try itround(n, places)since 1.7.0Rounded to that many decimal places · round(3.14159, 2) gives 3.14
set {_ratio} to round({%player%.kills} / max(1, {%player%.deaths}), 2)Try itpercent(part, whole)since 1.7.0What percentage the first is of the second · percent(3, 12) gives 25
set {_done} to percent({%player%.quests_done}, 20)
send "&7Quests: &f%{_done}%%"Try itcommas(n)since 1.7.0A number with thousands separators, as text · commas(1234567) gives 1,234,567
set {_shown} to commas({%player%.coins})
send "&6Balance: &e%{_shown}% coins"Try itordinal(n)since 1.7.01st, 2nd, 3rd, ... · ordinal(22) gives 22nd
set {_place} to ordinal(rank of player by {coins})
send "&7You are in &f%{_place}% &7place."Try itplural(n, word)since 1.7.57The number with the word, in the plural unless it is 1. A third value is the word for many, where an s is not it · plural(5, "coin") gives 5 coins; plural(2, "wolf", "wolves") gives 2 wolves
command /homes:
trigger:
set {_n} to size of {%player%.homes}
set {_said} to plural({_n}, "home")
send "&7You have &f%{_said}%&7."Try itroman(n)since 1.7.0Roman numerals, 1 to 3999 · roman(14) gives XIV
set {_level} to roman({%player%.prestige})
send "&dPrestige %{_level}%"Try itformat(n, pattern)since 1.7.3The number written the way the pattern says: 0 is a digit that is always shown, # one that is shown only if needed · format(3.14159, "0.00") gives 3.14
set {_ratio} to {%player%.kills} / max({%player%.deaths}, 1)
send "&7K/D: &f" + format({_ratio}, "0.00")Try itclamp(n, least, most)since 1.7.1The number, kept within the two · clamp(120, 0, 100) gives 100
set {%player%.mana} to clamp({%player%.mana} + 5, 0, 100)Try itlerp(from, to, t)since 1.7.44The number that far along from the one to the other: t is 0 at the start and 1 at the end · lerp(10, 20, 0.25) gives 12.5
set {_height} to lerp(60, 80, 0.5)
send "&7Half way up is %{_height}%."Try itrandom(a, b)since 1.7.1A random number from a to b; whole if both are whole · random(1, 6)
set {_roll} to random(1, 6)
send "&7You rolled a &f%{_roll}%"Try itduration(seconds)since 1.5.7A number of seconds as a duration, which reads as words in a message · duration(90) gives 1 minute 30 seconds
set {_left} to duration({%player%.ready} - server.time)
send "&cWait %{_left}%."Try itshort(n)since 1.7.50A large number in a few characters: k for thousands, then M, B, T · short(1250) gives 1.3k, short(3400000) gives 3.4M
send "&7You have &6%short({%player%.coins})% &7coins."Try itmoney(n)since 1.7.52An amount of money, with commas and two decimals, the way money-format in config.yml says: "$%amount%" unless changed · money(1250.5) gives $1,250.50
send "&7Balance: &a%money({%player%.coins})%"Try itlerp(a, b, t)since 1.7.54With two colours, the colour t of the way from the one to the other; with two locations, the place. With numbers it is the number, as before · lerp("#ff0000", "#0000ff", 0.5) gives #800080
set {_colour} to lerp("#ff0000", "#00ff00", player.health / 20)
spawn particle "dust" colored {_colour} count 10 at playerTry itmix(a, b)since 1.7.54The colour between two; a third value says how much of the second, from 0 to 1 · mix("#ff0000", "#0000ff") gives #800080
set {_purple} to mix("#ff0000", "#0000ff")Try itlighten(colour, amount)since 1.7.54The colour that far towards white, from 0 to 1; 0.2 if left out · lighten("#ff0000", 0.5) gives #ff8080
set {_pale} to lighten("#336699", 0.5)Try itdarken(colour, amount)since 1.7.54The colour that far towards black · darken("#ff0000", 0.5) gives #800000
set {_deep} to darken("#336699", 0.5)Try itrainbow(t)since 1.7.54A colour of the rainbow: red at 0, green at a third, blue at two thirds, red again at 1, and round again from there · rainbow(0.33) is green
every 2 ticks for all players:
add 0.02 to {_turn}
spawn particle "dust" colored rainbow(server.time / 5) at playerTry itrgb(red, green, blue)since 1.7.54A colour from three numbers, 0 to 255 each · rgb(255, 136, 0) gives #ff8800
set {_orange} to rgb(255, 136, 0)Try itsin(angle), cos(angle), tan(angle)since 1.7.55The sine, cosine and tangent of an angle in degrees, as the game's own angles are · sin(90) gives 1
set {_x} to cos(45) * 3
set {_z} to sin(45) * 3
spawn particle "flame" at player's location offset by {_x}, 1, {_z}Try itasin(n), acos(n), atan(n)since 1.7.55The angle, in degrees, that has that sine, cosine or tangent · atan(1) gives 45
set {_angle} to atan(1)
send "&7That slope is %{_angle}% degrees."Try itatan2(up, along)since 1.7.55The angle of a slope that goes that far up over that far along; right all the way round · atan2(1, 1) gives 45
set {_angle} to atan2(1, 1)Try itdistance between <a> and <b>since 1.5.7Blocks between two locations; unset if they are in different worlds · distance between player's location and {spawn}
if distance between player's location and {spawn} > 100:
send "&7You are far from spawn."Try ithorizontal distance between <a> and <b>since 1.7.44The same on the map alone, whatever the two heights · horizontal distance between player's location and {spawn}
set {_far} to horizontal distance between player's location and {_spot}Try it| Operator | Meaning | Example | Result |
|---|---|---|---|
+ | Add | 7 + 2 | 9 |
- | Subtract, or negate | 7 - 2 | 5 |
* | Multiply | 7 * 2 | 14 |
/ | Divide | 7 / 2 | 3.5 |
% | Modulo (remainder) | 7 % 2 | 1 |
( ) | Grouping | (7 + 2) * 2 | 18 |
random integer between A and B | Whole number, both ends included | random integer between 1 and 10 | 1..10 |
random number between A and B | Decimal number | random number between 0 and 1 | e.g. 0.4217 |
*, / and % bind tighter than + and -, as usual.
| Function | Result | Example |
|---|---|---|
min(a, b, ...) / max(a, b, ...) | The smallest / largest; also takes one list | max(1, {%player%.level}) |
abs(n) | Without its sign | abs(-7) gives 7 |
round(n) | The nearest whole number | round(2.5) gives 3 |
floor(n) / ceil(n) | Rounded down / up | ceil(2.1) gives 3 |
rounded up <n> / rounded down <n> | The same two, in words | rounded up 2.1 gives 3 |
sqrt(n) | Square root | sqrt(25) gives 5 |
pow(a, b) | a to the power of b | pow(2, 10) gives 1024 |
round(n, places) | Rounded to that many decimal places | round(3.14159, 2) gives 3.14 |
percent(part, whole) | What percentage the first is of the second | percent(3, 12) gives 25 |
commas(n) | A number with thousands separators, as text | commas(1234567) gives 1,234,567 |
ordinal(n) | 1st, 2nd, 3rd, ... | ordinal(22) gives 22nd |
plural(n, word) | The number with the word, in the plural unless it is 1. A third value is the word for many, where an s is not it | plural(5, "coin") gives 5 coins; plural(2, "wolf", "wolves") gives 2 wolves |
roman(n) | Roman numerals, 1 to 3999 | roman(14) gives XIV |
format(n, pattern) | The number written the way the pattern says: 0 is a digit that is always shown, # one that is shown only if needed | format(3.14159, "0.00") gives 3.14 |
clamp(n, least, most) | The number, kept within the two | clamp(120, 0, 100) gives 100 |
lerp(from, to, t) | The number that far along from the one to the other: t is 0 at the start and 1 at the end | lerp(10, 20, 0.25) gives 12.5 |
random(a, b) | A random number from a to b; whole if both are whole | random(1, 6) |
duration(seconds) | A number of seconds as a duration, which reads as words in a message | duration(90) gives 1 minute 30 seconds |
short(n) | A large number in a few characters: k for thousands, then M, B, T | short(1250) gives 1.3k, short(3400000) gives 3.4M |
money(n) | An amount of money, with commas and two decimals, the way money-format in config.yml says: "$%amount%" unless changed | money(1250.5) gives $1,250.50 |
lerp(a, b, t) | With two colours, the colour t of the way from the one to the other; with two locations, the place. With numbers it is the number, as before | lerp("#ff0000", "#0000ff", 0.5) gives #800080 |
mix(a, b) | The colour between two; a third value says how much of the second, from 0 to 1 | mix("#ff0000", "#0000ff") gives #800080 |
lighten(colour, amount) | The colour that far towards white, from 0 to 1; 0.2 if left out | lighten("#ff0000", 0.5) gives #ff8080 |
darken(colour, amount) | The colour that far towards black | darken("#ff0000", 0.5) gives #800000 |
rainbow(t) | A colour of the rainbow: red at 0, green at a third, blue at two thirds, red again at 1, and round again from there | rainbow(0.33) is green |
rgb(red, green, blue) | A colour from three numbers, 0 to 255 each | rgb(255, 136, 0) gives #ff8800 |
sin(angle), cos(angle), tan(angle) | The sine, cosine and tangent of an angle in degrees, as the game's own angles are | sin(90) gives 1 |
asin(n), acos(n), atan(n) | The angle, in degrees, that has that sine, cosine or tangent | atan(1) gives 45 |
atan2(up, along) | The angle of a slope that goes that far up over that far along; right all the way round | atan2(1, 1) gives 45 |
distance between <a> and <b> | Blocks between two locations; unset if they are in different worlds | distance between player's location and {spawn} |
horizontal distance between <a> and <b> | The same on the map alone, whatever the two heights | horizontal distance between player's location and {spawn} |
set {%player%.coins} to {%player%.coins} + 50
set {_rand} to random integer between 1 and 10
set {_tax} to ({%player%.coins} - 100) * 0.05
add 5 to {%player%.coins} # shorthand for set ... to ... + 5
subtract {_tax} from {%player%.coins} # shorthand for set ... to ... - {_tax}
Details:
+ adds when both sides are numbers and joins text otherwise: "Level " + 5 is Level 5. Text that looks like a number counts as a number, so arg.1 + 1 adds..0; other decimals are shown to at most 4 places.min, round and so on.duration(...) is how a number of seconds becomes readable: set {_left} to duration({%player%.ready} - server.time) then send "Wait %{_left}%." says "Wait 9 minutes 30 seconds." In math it still counts as seconds.random ... between A and B extends to the end of the arithmetic, so random integer between 1 and 10 + 5 means 1 to 15. Use parentheses to say otherwise: (random integer between 1 and 10) + 5.sorted <list>Ascending copy: numbers first, then text A-Z ignoring case · 1, 3, 5, 9
set {_names} to sorted server.playersTry itreversed <list>Copy in reverse order · 1, 9, 3, 5
set {_newest_first} to reversed {winners}Try itreversed sorted <list>Descending copy · 9, 5, 3, 1
set {_top} to reversed sorted {scores}Try itfilter <list> where <condition>Elements for which the condition holds; it is the element · filter {_nums} where it > 4 gives 5, 9
set {_rich} to filter {_top} where it >= 500Try itsize of <list>Number of elements (or characters, for text) · 4
set {_count} to size of {_words}Try ititem <n> of <list>The n-th element, counting from 1; unset if there is none · item 2 of {_nums} gives 3
set {_a} to item 1 of {_players}Try it{_list.<n>}since 1.4.0The same, for a list in a local variable; handy inside text as %{_nums.2}% · {_nums.2} gives 3
set {_parts} to split "Coins:500" by ":"
send "You have %{_parts.2}% coins"Try it<list> contains <value>Whether the value is in the list · {_nums} contains 9 is true
if {winners} contains player.name:
send "You already won."Try it<list> + <value>Copy with the value at the end · 5, 3, 9, 1, 7
set {_everyone} to server.players + "Console"Try itrandom item of <list>since 1.5.2One element picked at random; unset for an empty list · random item of {_nums}
send random item of ["Hello!", "Hi there!", "Welcome!"]Try itrandom <n> of <list>since 1.7.59That many different elements, in no order; all of them if the list has fewer · random 3 of server.players
command /pickthree:
trigger:
set {_lucky} to random 3 of server.players
send "&6Winners: &f%{_lucky}%" to all playersTry itappend <value> to <variable>Add to the end. An unset variable becomes a one-element list.
append player.name to {winners}Try itset item <n> of <variable> to <value>since 1.7.2Replace one element, counting from 1. The list must already have that many
set {podium} to ["Steve", "Alex", "Bob"]
set item 1 of {podium} to player.name
send "&6First place: &f" + item 1 of {podium}Try itadd <value> to <variable>Same as append if the variable already holds a list; otherwise arithmetic
add 1 to {_slot}Try itremove <value> from <variable>Remove the first matching element
remove player.name from {winners}Try ititems <a> to <b> of <list>since 1.5.7A part of the list, counting from 1, both ends included · items 1 to 5 of {_ranked}
set {_top} to items 1 to 5 of reversed sorted {scores}Try itindex of <value> in <list>since 1.5.7Where the value is; unset if it is not there · index of player.name in {queue}
set {_place} to index of player.name in {queue}Try itclosest match of <text> in <list>since 1.7.60The element most like the text, for "did you mean": a letter or two off, or what it begins with. Unset if nothing is close · closest match of arg.1 in keys of {warp}
command /kit <name>:
trigger:
set {_kits} to ["starter", "miner", "builder"]
if {_kits} contains arg.1:
send "&aHere is your %arg.1% kit."
stop
set {_meant} to closest match of arg.1 in {_kits}
if {_meant} is set:
send "&cThere is no kit %arg.1%. Did you mean &f%{_meant}%&c?"Try it<list> as sentencesince 1.7.60The elements as people write a list: Steve, Alex and Bob · server.players as sentence
command /who:
trigger:
set {_names} to server.players as sentence
send "&7Online: &f%{_names}%"Try itrandom item of <list>since 1.5.2One element, picked at random · random item of {announcements}
send random item of ["Hello!", "Hi there!", "Welcome!"]Try itrandom item of <list> weighted by <list>since 1.7.15The same, but not evenly: the second list gives each element its chance, so [70, 25, 5] makes the first fourteen times as likely as the last. Unset if every chance is 0 · random item of {loot} weighted by {chances}
command /crate:
trigger:
set {_prizes} to ["bread", "gold_ingot", "diamond"]
set {_prize} to random item of {_prizes} weighted by [70, 25, 5]
give player 1 "%{_prize}%"
send "&aYou won &f%{_prize}%&a!"Try itfirst <n> of <list> / last <n> of <list>since 1.7.0The beginning or the end of a list · first 3 of {queue}
set {_shout} to uppercase (first 20 characters of {_note})Try itnumbers from <a> to <b>since 1.7.0A list of whole numbers, counting up or down · numbers from 1 to 5
for each {_n} in numbers from 3 to 1:
send "&e%{_n}%..."Try itcount of <value> in <list>since 1.7.0How many times it occurs; works on text too · count of "a" in {letters}
set {_votes} to count of "yes" in {votes}Try itmin of <list> / max of <list>since 1.7.0The smallest or largest number in it · max of {scores}
set {_best} to max of {scores}Try it<list> without <value>since 1.7.1The list with the first such value taken out · server.players without player.name
for each {_other} in server.players without player.name:
send "&7%player.name% says hi" to {_other}Try it<list> sorted by {<name>}since 1.7.1Player names ordered by each one's own variable, highest first · server.players sorted by {coins}
set {_richest} to server.players sorted by {coins}
send "&6Richest online: &e" + item 1 of {_richest}Try it<list> sorted by <value>since 1.7.59Ordered by anything that can be said of one element, which is loop-value there: lowest first, or highest first when that is written behind it. Text is ordered by the alphabet · {_words} sorted by length of loop-value
command /longest:
trigger:
set {_words} to ["banana", "kiwi", "apple"]
set {_ordered} to {_words} sorted by length of loop-value highest first
send "&7%{_ordered}%"Try itmap each <list> to <expression>since 1.7.1A new list, each element changed the same way; it is the element · map each {prices} to it * 2
set {_shouted} to map each ["red", "blue"] to uppercase itTry itrandom playersince 1.5.9The name of a random online player; unset if nobody is on · give 1 diamond to random player
set {_winner} to random player
broadcast "&6%{_winner}% wins the draw!"Try itshuffled <list>since 1.5.9The same elements in a random order · shuffled server.players
set {_order} to shuffled server.playersTry itunique <list>since 1.5.9Without repeats; the first of each is kept · unique {visitors}
set {_once} to unique ["a", "b", "a"]Try itsum of <list> / average of <list>since 1.5.9Its numbers added up, or their mean · sum of {donations}
set {_total} to sum of [10, 20, 30]
set {_mean} to average of [10, 20, 30]Try itplayers within <n> blocks of <location>since 1.5.9The names of the players that close, nearest first · players within 10 blocks of player
for each {_near} in players within 10 blocks of player:
send "&7%player.name% waves at you." to {_near}Try itblocks within <n> blocks of <location>since 1.7.57The location of every block that close, nearest first; block at says what is there · blocks within 3 blocks of player
command /stones:
trigger:
set {_n} to 0
loop blocks within 4 blocks of player where block at loop-value is "stone":
add 1 to {_n}
send "&7Stone around you: &f%{_n}%"Try itblocks from <location> to <location>since 1.7.57The location of every block in the box between two opposite corners · blocks from {_a} to {_b}
command /floor:
trigger:
set {_a} to player's location offset by -2, -1, -2
set {_b} to player's location offset by 2, -1, 2
loop blocks from {_a} to {_b}:
set block at loop-value to glassTry itentities within <n> blocks of <location>since 1.7.44The creatures that close, nearest first, players not among them. Each can be given to anything that takes a creature · entities within 10 blocks of player
set {_left} to size of entities within 20 blocks of playerTry itentities of <kind> within <n> blocks of <location>since 1.7.44The same for one kind of creature · entities of zombie within 20 blocks of player
for each {_mob} in entities of zombie within 20 blocks of player:
kill {_mob}Try itnearest block of <type> within <n> blocks of <location>since 1.7.60Where the closest block of that kind is, as a location; unset if there is none that close · nearest block of diamond ore within 10 blocks of player
command /findore:
trigger:
set {_ore} to nearest block of diamond ore within 12 blocks of player
if {_ore} is set:
send "&bDiamonds at &f%{_ore}%"
else:
send "&7Nothing close by."Try itnearest player to <location>since 1.7.44The name of the player closest to a place, in that world; unset if nobody is there. nearest other player to player leaves out the player the trigger runs for · nearest other player to player
set {_who} to nearest player to player's location
if {_who} is set:
send "&7Closest: &f%{_who}%"Try itnearest entity to <location>since 1.7.44The closest creature that is not a player, up to 256 blocks away; a kind may be named instead of entity · nearest zombie to player
set {_any} to nearest entity to player's locationTry itwords of <text>since 1.7.44The words of a text as a list · words of "one two three"
for each {_word} in words of "red green blue":
send "&7%{_word}%"Try itkeys of {<table>}since 1.5.7The names under a table; see Records and tables · keys of {warp}
for each {_name} in keys of {warp}:
send "&7 - &b%{_name}%"Try itset {_nums} to [5, 3, 9, 1]
set {_names} to ["Steve", "Alex"]
set {_empty} to []
| Syntax | Result | Example with {_nums} = [5, 3, 9, 1] |
|---|---|---|
sorted <list> | Ascending copy: numbers first, then text A-Z ignoring case | 1, 3, 5, 9 |
reversed <list> | Copy in reverse order | 1, 9, 3, 5 |
reversed sorted <list> | Descending copy | 9, 5, 3, 1 |
filter <list> where <condition> | Elements for which the condition holds; it is the element | filter {_nums} where it > 4 gives 5, 9 |
size of <list> | Number of elements (or characters, for text) | 4 |
item <n> of <list> | The n-th element, counting from 1; unset if there is none | item 2 of {_nums} gives 3 |
{_list.<n>} | The same, for a list in a local variable; handy inside text as %{_nums.2}% | {_nums.2} gives 3 |
<list> contains <value> | Whether the value is in the list | {_nums} contains 9 is true |
<list> + <value> | Copy with the value at the end | 5, 3, 9, 1, 7 |
random item of <list> | One element picked at random; unset for an empty list | random item of {_nums} |
random <n> of <list> | That many different elements, in no order; all of them if the list has fewer | random 3 of server.players |
Statements that change a list variable:
| Statement | Effect |
|---|---|
append <value> to <variable> | Add to the end. An unset variable becomes a one-element list. |
set item <n> of <variable> to <value> | Replace one element, counting from 1. The list must already have that many |
add <value> to <variable> | Same as append if the variable already holds a list; otherwise arithmetic |
remove <value> from <variable> | Remove the first matching element |
append player.name to {winners}
set {_top} to reversed sorted {scores}
set {_rich} to filter {_top} where it >= 500
send "Best: %{_top}% (of which %{_rich}% are 500 or more)"
if {winners} contains player.name:
send "You already won."
, .set {_b} to {_a} followed by a change to {_b} leaves {_a} alone.| Syntax | Result | Example |
|---|---|---|
items <a> to <b> of <list> | A part of the list, counting from 1, both ends included | items 1 to 5 of {_ranked} |
index of <value> in <list> | Where the value is; unset if it is not there | index of player.name in {queue} |
closest match of <text> in <list> | The element most like the text, for "did you mean": a letter or two off, or what it begins with. Unset if nothing is close | closest match of arg.1 in keys of {warp} |
<list> as sentence | The elements as people write a list: Steve, Alex and Bob | server.players as sentence |
random item of <list> | One element, picked at random | random item of {announcements} |
random item of <list> weighted by <list> | The same, but not evenly: the second list gives each element its chance, so [70, 25, 5] makes the first fourteen times as likely as the last. Unset if every chance is 0 | random item of {loot} weighted by {chances} |
first <n> of <list> / last <n> of <list> | The beginning or the end of a list | first 3 of {queue} |
numbers from <a> to <b> | A list of whole numbers, counting up or down | numbers from 1 to 5 |
count of <value> in <list> | How many times it occurs; works on text too | count of "a" in {letters} |
min of <list> / max of <list> | The smallest or largest number in it | max of {scores} |
<list> without <value> | The list with the first such value taken out | server.players without player.name |
<list> sorted by {<name>} | Player names ordered by each one's own variable, highest first | server.players sorted by {coins} |
<list> sorted by <value> | Ordered by anything that can be said of one element, which is loop-value there: lowest first, or highest first when that is written behind it. Text is ordered by the alphabet | {_words} sorted by length of loop-value |
map each <list> to <expression> | A new list, each element changed the same way; it is the element | map each {prices} to it * 2 |
random player | The name of a random online player; unset if nobody is on | give 1 diamond to random player |
shuffled <list> | The same elements in a random order | shuffled server.players |
unique <list> | Without repeats; the first of each is kept | unique {visitors} |
sum of <list> / average of <list> | Its numbers added up, or their mean | sum of {donations} |
players within <n> blocks of <location> | The names of the players that close, nearest first | players within 10 blocks of player |
blocks within <n> blocks of <location> | The location of every block that close, nearest first; block at says what is there | blocks within 3 blocks of player |
blocks from <location> to <location> | The location of every block in the box between two opposite corners | blocks from {_a} to {_b} |
entities within <n> blocks of <location> | The creatures that close, nearest first, players not among them. Each can be given to anything that takes a creature | entities within 10 blocks of player |
entities of <kind> within <n> blocks of <location> | The same for one kind of creature | entities of zombie within 20 blocks of player |
nearest block of <type> within <n> blocks of <location> | Where the closest block of that kind is, as a location; unset if there is none that close | nearest block of diamond ore within 10 blocks of player |
nearest player to <location> | The name of the player closest to a place, in that world; unset if nobody is there. nearest other player to player leaves out the player the trigger runs for | nearest other player to player |
nearest entity to <location> | The closest creature that is not a player, up to 256 blocks away; a kind may be named instead of entity | nearest zombie to player |
words of <text> | The words of a text as a list | words of "one two three" |
keys of {<table>} | The names under a table; see Records and tables | keys of {warp} |
keys of {warp} looks at every saved variable whose name starts with warp. and gives the next part of each name: with {warp.spawn} and {warp.arena} set, it is the list arena, spawn. That is how a script loops over a table it has built. It works for a player's own tables as well: keys of {%player%.homes}.filter reads to the end of the condition, including any and / or. Wrap it in parentheses to use the result in a larger expression: size of (filter {_nums} where it > 4).HyperScript has no user-defined types. Structured data is built from variable names instead, in two ways that combine freely.
Records: group related values under one prefix.
set {%player%.home.x} to player.x
set {%player%.home.y} to player.y
set {%player%.home.z} to player.z
Tables: put a run-time value inside the name with %...%, giving one variable per key.
set {balance.%player.name%} to 250
set {_target} to arg.1
send "%{_target}% has %{balance.%{_target}%}% coins"
The inserted part is lower-cased like the rest of the name, so Steve and steve are the same key. Combined with lists (below), this covers most data a script needs to keep.
nowsince 1.7.0The present moment · set {%player%.joined} to now
set {%player%.next_daily} to now + 1 dayTry ittoday / tomorrowsince 1.7.0Midnight at the start of today, or of tomorrow · if {%player%.voted} < today:
if {%player%.last_vote} < today:
send "&eYou have not voted today."Try it<date> + <duration> / <date> - <duration>since 1.7.0A later or an earlier date · now + 7 days
set {%player%.next_daily} to now + 1 dayTry it<date> - <date>since 1.7.0The time between them, as a duration · now - {%player%.joined}
send "&7 - &f%{_name}%"Try ittime since <date>since 1.7.0How long ago it was · time since {%player%.last_death}
set {_ago} to time since {%player%.last_death}
send "&7You last died %{_ago}% ago."Try ittime until <date>since 1.7.0How long until then; zero if it has passed · time until {event_start}
set {_left} to time until {%player%.next_daily}Try it<date> formatted as <pattern>since 1.7.0The date written out your way · now formatted as "d MMMM yyyy"
send "&aSee you again on " + ({%player%.next_daily} formatted as "EEEE 'at' HH:mm")Try itfirst join date of <who> / last seen of <who>since 1.7.0When a player first joined and was last on; works offline · last seen of arg.1
set {_seen} to last seen of arg.1
send "&7%arg.1% was last on: &f%{_seen}%"Try itnow is the present moment as a value. It can be stored, compared, and moved forward or back with a duration.
command /daily:
trigger:
if {%player%.next_daily} is set and now < {%player%.next_daily}:
set {_left} to time until {%player%.next_daily}
send "&cCome back in %{_left}%."
stop
set {%player%.next_daily} to now + 1 day
give 3 diamond to player
send "&aSee you again on " + ({%player%.next_daily} formatted as "EEEE 'at' HH:mm")
| Syntax | Result | Example |
|---|---|---|
now | The present moment | set {%player%.joined} to now |
today / tomorrow | Midnight at the start of today, or of tomorrow | if {%player%.voted} < today: |
<date> + <duration> / <date> - <duration> | A later or an earlier date | now + 7 days |
<date> - <date> | The time between them, as a duration | now - {%player%.joined} |
time since <date> | How long ago it was | time since {%player%.last_death} |
time until <date> | How long until then; zero if it has passed | time until {event_start} |
<date> formatted as <pattern> | The date written out your way | now formatted as "d MMMM yyyy" |
first join date of <who> / last seen of <who> | When a player first joined and was last on; works offline | last seen of arg.1 |
11 October 2026 18:30 unless you format it. The letters for formatted as are Java's: yyyy year, MM month number, MMMM month name, d day, EEEE weekday, HH hour, mm minute, ss second. Text inside single quotes is taken as it is.< and >, and can be saved in variables like any other value.server.time, so the two mix: now > server.time - 60.Another place's clock. <date> formatted as "<pattern>" in time zone "<zone>" writes a moment as the clock shows it somewhere else: now formatted as "HH:mm" in time zone "Europe/Berlin". The zone is one of the world's names for them, such as "America/New_York", "Asia/Tokyo" or "UTC".
messages:since 1.7.15At the left margin. Under it a language, written as the game writes it (en, de, pt_br), and under that name: "text" lines
messages:
en:
welcome: "&aWelcome, %player%!"
de:
welcome: "&aWillkommen, %player%!"
on player join:
send message "welcome"Try itmessage <name>since 1.7.15The text of that name in the player's language. message <name> for <who> in someone else's
messages:
en:
greeting: "&7Hello!"
es:
greeting: "&7Hola!"
command /greet <player>:
trigger:
send message "greeting" for arg.1 to arg.1Try itA script that speaks to players can keep its texts in one place, once for each language, and let every player read their own:
messages:
en:
welcome: "&aWelcome, %player%!"
no-money: "&cYou cannot afford that."
de:
welcome: "&aWillkommen, %player%!"
no-money: "&cDas kannst du dir nicht leisten."
on player join:
send message "welcome"
| Written | Meaning |
|---|---|
messages: | At the left margin. Under it a language, written as the game writes it (en, de, pt_br), and under that name: "text" lines |
message <name> | The text of that name in the player's language. message <name> for <who> in someone else's |
de_at uses de if there is no de_at; a language or a message that is missing falls back on the first language in the block, so write the complete one first.%player%, %{%player%.coins}%) but not local variables: put a value that changes into a saved variable, or add it after the message with +.message "welcome"), and a name the block does not have is a mistake found when the file loads.messages: block, message keeps its other meaning: what was said in chat.%server.version%since 1.5.4Minecraft version, e.g. 1.20.4 · text
send "&7Server %server.version% | TPS %server.tps% | Online %server.online_players%"Try it%server.tps%since 1.5.4Recent ticks per second, 2 decimals, max 20 · number
send "TPS is %server.tps% and your ping is %player.ping% ms"Try it%server.online_players%since 1.5.4Players online · number
set {_players} to server.online_playersTry it%server.max_players%since 1.5.4Player slot limit · number
send "&7%server.online_players% of %server.max_players% players online"Try it%server.players%since 1.5.4Names of the players online · list
set {_online} to server.playersTry it%server.time%since 1.5.4The current time as seconds since 1970, for timestamps · number
set {%player%.last_seen} to server.timeTry it%server.worlds%since 1.7.0The names of the loaded worlds · list
for each {_world} in server.worlds:
send "&7 - &f%{_world}%"Try it%server.operators%, %server.banned%, %server.whitelist%since 1.7.0Names of operators, banned and whitelisted players · list
send "&7Operators: &f%server.operators%"Try it%server.plugins%since 1.7.0The names of the installed plugins · list
send "&7Plugins: &f%server.plugins%"Try it%server.uptime%since 1.7.0How long the server has been running · duration
send "&7The server has been up for &f%server.uptime%"Try it%server.memory_used%, %server.memory_max%since 1.7.0Memory in megabytes · number
send "&7Memory: &f%server.memory_used% &7of &f%server.memory_max% &7MB"Try it%server.date%since 1.5.9Today's date, e.g. 2026-10-11 · text
log "Backup finished on %server.date% at %server.clock%"Try it%server.clock%since 1.5.9The time of day, e.g. 18:30 · text
send "&7Server time: &f%server.clock%"Try it%server.weekday%since 1.5.9The day of the week in lower case, e.g. sunday · text
if server.weekday is "saturday":
send "&6Double coins today!"Try it%server.hour%, %server.minute%since 1.5.9The hour (0 to 23) and the minute, as numbers · number
if server.hour >= 22:
send "&7It is late. Good night!"Try it%player.name%since 1.5.4Player name · text
log "%player.name% left"Try it%player.uuid%since 1.5.4Player UUID · text
set {_path} to "plugins/HyperScript/notes/%player.uuid%.txt"Try it%player.ping%since 1.5.4Latency in ms (-1 if unavailable) · number
send "TPS is %server.tps% and your ping is %player.ping% ms"Try it%player.health%since 1.5.4Health, 1 decimal (20 = full by default) · number
if player.health < 6:
send "&cYou are badly hurt!"Try it%player.world%since 1.5.4Name of the world the player is in · text
set time in world "%player.world%" to 1000Try it%player.gamemode%since 1.5.4survival, creative, adventure or spectator · text
send "&bWorld &f%player.world% &7| &bMode &f%player.gamemode% &7| &bHealth &f%player.health%"Try it%player.x%, %player.y%, %player.z%since 1.5.4Position, 2 decimals · number
set {%player%.home.x} to player.xTry it%arg.1%, %arg.2%, ...since 1.5.4Command argument by position · text
freeze arg.1Try it%args%since 1.5.4All command arguments joined by spaces · text
send "&7You typed: %args%"Try it%args.count%since 1.5.4Number of command arguments · number
if args.count > 0:
set file at {_path} to args
send "&aNote saved."Try it%event.message%since 1.5.4Chat message (on player chat) · text
set chat format to "&7%player.name% &8>> &f%event.message%"Try it%event.block%since 1.5.4Block type, e.g. diamond_ore (on block break, on right click) · text
if event.block contains "ore":
set {_reward} to {_reward} * 5Try it%event.power%since 1.7.63The redstone power a block has now, 0 to 15 (on redstone) · number
if event.power > 0:
log "A lamp was lit at %event's location%"Try it%event.item%since 1.5.4Held item type, e.g. compass (on right click) · text
add 1 to {smelted.%event.item%}Try it%event.entity%since 1.5.4Entity type, e.g. zombie (on entity death) · text
send "&aYou tamed a %event.entity%!"Try it%event.killer%since 1.5.4Name of the killing player (on entity death) · text
set death message to "&c%player.name% &7was defeated by &c%event.killer%"Try it%event.world%, %event.x%, %event.y%, %event.z%since 1.5.4The block the event is about (on block break, on right click); as one value: event's location · text / number
on block break:
log "%player.name% broke a block at %event.x%, %event.y%, %event.z% in %event.world%"Try it%discord.user%since 1.5.4Discord user name (on discord command) · text
on discord command "/hello":
reply "Hello, %discord.user%!"Try it%discord.user_id%since 1.5.4Discord user ID (on discord command) · text
set {link.discord.%{_player}%} to discord.user_idTry it%discord.channel%since 1.5.4Discord channel name (on discord command) · text
on discord command "/where":
reply "You are in #%discord.channel%"Try itPlaceholders are read-only live values that HyperScript provides, such as the player's name or the server's TPS. They are written in two ways, depending on where they stand:
| Where | Written | Example |
|---|---|---|
| In code | The plain name | if player.health < 6: |
| Inside text | The name between percent signs | send "Hello %player.name%!" |
Braces are never used for placeholders. {...} always means a variable of your own; see Variables.
| Placeholder | Value | Type |
|---|---|---|
%server.version% | Minecraft version, e.g. 1.20.4 | text |
%server.tps% | Recent ticks per second, 2 decimals, max 20 | number |
%server.online_players% | Players online | number |
%server.max_players% | Player slot limit | number |
%server.players% | Names of the players online | list |
%server.time% | The current time as seconds since 1970, for timestamps | number |
%server.worlds% | The names of the loaded worlds | list |
%server.operators%, %server.banned%, %server.whitelist% | Names of operators, banned and whitelisted players | list |
%server.plugins% | The names of the installed plugins | list |
%server.uptime% | How long the server has been running | duration |
%server.memory_used%, %server.memory_max% | Memory in megabytes | number |
%server.date% | Today's date, e.g. 2026-10-11 | text |
%server.clock% | The time of day, e.g. 18:30 | text |
%server.weekday% | The day of the week in lower case, e.g. sunday | text |
%server.hour%, %server.minute% | The hour (0 to 23) and the minute, as numbers | number |
%player.name% | Player name | text |
%player.uuid% | Player UUID | text |
%player.ping% | Latency in ms (-1 if unavailable) | number |
%player.health% | Health, 1 decimal (20 = full by default) | number |
%player.world% | Name of the world the player is in | text |
%player.gamemode% | survival, creative, adventure or spectator | text |
%player.x%, %player.y%, %player.z% | Position, 2 decimals | number |
%arg.1%, %arg.2%, ... | Command argument by position | text |
%args% | All command arguments joined by spaces | text |
%args.count% | Number of command arguments | number |
%event.message% | Chat message (on player chat) | text |
%event.block% | Block type, e.g. diamond_ore (on block break, on right click) | text |
%event.power% | The redstone power a block has now, 0 to 15 (on redstone) | number |
%event.item% | Held item type, e.g. compass (on right click) | text |
%event.entity% | Entity type, e.g. zombie (on entity death) | text |
%event.killer% | Name of the killing player (on entity death) | text |
%event.world%, %event.x%, %event.y%, %event.z% | The block the event is about (on block break, on right click); as one value: event's location | text / number |
%discord.user% | Discord user name (on discord command) | text |
%discord.user_id% | Discord user ID (on discord command) | text |
%discord.channel% | Discord channel name (on discord command) | text |
The table lists each placeholder as it is written inside text. In code, leave the percent signs off: server.tps, arg.1, event.block. (The percent form is accepted in code as well, so %arg.1% == "on" still works.)
Two more describe the player as a whole: player is the player, for use wherever a player is expected (send "hi" to player), and inside text %player% is their name. player.location is where they stand, as a location.
Writing a placeholder in braces, as in {player.name} or %{player.name}%, is an error that says how to write it instead. That was the syntax before version 1.5.4, so scripts from older versions need those places changed.
"The player" is whoever caused the trigger: the player who joined, broke the block, ran the command, clicked the GUI slot, or, for on entity death, the killer. A placeholder with nothing to report (for example %player.name% when the console runs a command) is unset and prints as <none>.
send "TPS is %server.tps% and your ping is %player.ping% ms"
if player.health < 6:
send "&cYou are badly hurt!"
What sets a script off: a command, something that happens, or the clock.
trigger:yes · The code to run
command /pay <target:player> <amount:number> [note]:
players only: true
trigger:
subtract arg.2 from {%player%.coins}
add arg.2 to {%arg.1%.coins}Try itpermission:no · Permission node needed to run the command, or op for server operators only
command /heal:
description: Restore your health
usage: /heal [player]
permission: demo.heal
permission message: "&cYou cannot use /heal."
aliases: h, mend
trigger:
execute console command "effect give %player.name% minecraft:instant_health 1 10"
send "&aHealed."Try itpermission message:no · Shown to players who lack the permission
command /heal:
description: Restore your health
usage: /heal [player]
permission: demo.heal
permission message: "&cYou cannot use /heal."
aliases: h, mend
trigger:
execute console command "effect give %player.name% minecraft:instant_health 1 10"
send "&aHealed."Try itusage:no · Usage text shown in /help
command /heal:
description: Restore your health
usage: /heal [player]
permission: demo.heal
permission message: "&cYou cannot use /heal."
aliases: h, mend
trigger:
execute console command "effect give %player.name% minecraft:instant_health 1 10"
send "&aHealed."Try itdescription:no · Description shown in /help
command /heal:
description: Restore your health
usage: /heal [player]
permission: demo.heal
permission message: "&cYou cannot use /heal."
aliases: h, mend
trigger:
execute console command "effect give %player.name% minecraft:instant_health 1 10"
send "&aHealed."Try italiases:no · Comma-separated alternative names
command /heal:
description: Restore your health
usage: /heal [player]
permission: demo.heal
permission message: "&cYou cannot use /heal."
aliases: h, mend
trigger:
execute console command "effect give %player.name% minecraft:instant_health 1 10"
send "&aHealed."Try itcooldown:no · How long each player must wait between uses, e.g. 30 seconds
on right click:
cooldown: 2 seconds
send "&7Click!"Try itcooldown message:no · Shown to a player who is still waiting; %cooldown% is the time left
command /kit:
cooldown: 1 hour
cooldown message: "&cYou must wait %cooldown% before using this again!"
trigger:
give 1 diamond to playerTry itwarmup:since 1.7.60no · How long a player has to stand still before the trigger runs, e.g. 3 seconds, with the time counting down above the hotbar. Moving or being hurt calls it off. The console does not wait
command /spawn:
warmup: 3 seconds
trigger:
teleport player to {spawn}Try itcost:since 1.7.60no · What running the command costs: 100 of the server's money (with Vault and an economy plugin), or 5 gems of a currency of the script's own. Somebody who has not got it is told so and the trigger does not run; otherwise it is taken first
command /heal:
cost: 50
trigger:
heal player
send "&aHealed."Try itcost message:since 1.7.60no · What they are told then; %cost% is the cost as written
command /feed:
cost: 20
cost message: "&cFood costs %cost% coins."
trigger:
feed playerTry itworlds:since 1.7.64no · The worlds the command works in: worlds: "survival", "resource". Somewhere else the player is told so and the trigger does not run. The console is let through
command /mine:
worlds: "survival", "resource"
trigger:
give 1 iron pickaxe to playerTry itworlds message:since 1.7.64no · What they are told then
command /arena:
worlds: "minigames"
worlds message: "&cThe arena is in the minigames world."
trigger:
send "&aWelcome to the arena."Try ittab complete: <list>since 1.7.1no · What Tab offers for the first argument; tab complete 2: for the second, and so on
command /warp <name>:
tab complete: keys of {warp}
trigger:
teleport player to {warp.%arg.1%}Try itdisabled: truesince 1.7.1no · Keep the command in the file without adding it to the server
command /beta:
disabled: true
trigger:
send "&7Not ready yet."Try itsubcommand <name>:since 1.7.1no · A command inside the command, with options and a trigger of its own
command /team:
subcommand join <red|blue>:
trigger:
add player to team arg.1
subcommand leave:
trigger:
remove player from teamTry itplayers only: truesince 1.7.0no · The console is told it cannot use the command. players only: alone says the same
command /sethome:
players only: true
trigger:
set {%player%.home} to player's locationTry itconsole only: truesince 1.7.0no · Players are told they cannot use the command
command /maintenance:
console only: true
trigger:
set {maintenance} to trueTry it<onsince 1.5.7off>, <red · blue · green>` · Those words
send "&eUsage: /event <on|off>"Try it<player> or <target>since 1.5.7The players who are online
command /greet <player>:
trigger:
send "&aHello from %player.name%!" to arg.1Try it<name:player>since 1.7.0Must be someone who is online; Tab offers their names
command /greet <target:player>:
trigger:
send "&aHello!" to arg.1Try it<name:number>since 1.7.0Must be a number
command /setprice <price:number>:
trigger:
set {price} to arg.1Try it<name:integer>since 1.7.0Must be a whole number. Both kinds of number may be typed short, 1.5k or 2m, and reach the trigger written out
command /roll <sides:integer>:
trigger:
send "&7You rolled " + random integer between 1 and arg.1Try it<name:duration>since 1.7.59Must be a length of time: 30s, 10m, 2h, 1h30m, or a bare number of seconds. In the trigger the argument is that many seconds, so it goes wherever a time does: mute arg.1 for arg.2
command /slow <target:player> <time:duration>:
permission: "staff.slow"
trigger:
set {%arg.1%.slowed} to true for arg.2
send "&7%arg.1% is slowed."Try it<name:boolean>since 1.7.59true, yes or on, or false, no or off; in the trigger it is true or false. Tab offers the two
command /pvp <on:boolean>:
permission: "staff.pvp"
trigger:
set {pvp} to arg.1
send "&7PvP: &f%arg.1%"Try it<name:item>since 1.7.59Must be the name of an item of the game, as in diamond_sword
command /gimme <what:item>:
permission: "staff.gimme"
trigger:
send "&7You asked for &f%arg.1%&7."Try it<name:world>since 1.7.59Must be a world that is loaded; Tab offers their names
command /daytime <where:world>:
permission: "staff.time"
trigger:
set time in world arg.1 to 1000Try it<name:offline player>since 1.7.59Must be somebody who has played here, online or not
command /seen <who:offline player>:
trigger:
send "&7%arg.1% was last on &f%last seen of arg.1%"Try it<name:text>since 1.7.59Everything from there to the end of the line as one argument, spaces and all. It has to be the last one
command /announce <words:text>:
permission: "staff.announce"
trigger:
send "&6[!] &f%arg.1%" to all playersTry it<onsince 1.5.7off>` · One of the words, and nothing else: anything other is answered with the usage
send "&eUsage: /event <on|off>"Try it[name:type]since 1.7.0In square brackets: may be left out, but is checked when given
command /heal [target:player]:
trigger:
if arg.1 is set:
heal arg.1
else:
heal playerTry it[name:type = value]since 1.7.58What the argument is when it is left out: with [amount:number = 1], arg.2 is 1 for a player who gave no amount. Works without a type as well, [note = "a gift"]. Only arguments at the end are filled in
command /coins [amount:number = 1]:
trigger:
add arg.1 to {%player%.coins}
send "&a+%arg.1% coins"Try itcommand /heal:
description: Restore your health
usage: /heal [player]
permission: demo.heal
permission message: "&cYou cannot use /heal."
aliases: h, mend
trigger:
execute console command "effect give %player.name% minecraft:instant_health 1 10"
send "&aHealed."
| Option | Required | Meaning |
|---|---|---|
trigger: | yes | The code to run |
permission: | no | Permission node needed to run the command, or op for server operators only |
permission message: | no | Shown to players who lack the permission |
usage: | no | Usage text shown in /help |
description: | no | Description shown in /help |
aliases: | no | Comma-separated alternative names |
cooldown: | no | How long each player must wait between uses, e.g. 30 seconds |
cooldown message: | no | Shown to a player who is still waiting; %cooldown% is the time left |
warmup: | no | How long a player has to stand still before the trigger runs, e.g. 3 seconds, with the time counting down above the hotbar. Moving or being hurt calls it off. The console does not wait |
cost: | no | What running the command costs: 100 of the server's money (with Vault and an economy plugin), or 5 gems of a currency of the script's own. Somebody who has not got it is told so and the trigger does not run; otherwise it is taken first |
cost message: | no | What they are told then; %cost% is the cost as written |
worlds: | no | The worlds the command works in: worlds: "survival", "resource". Somewhere else the player is told so and the trigger does not run. The console is let through |
worlds message: | no | What they are told then |
tab complete: <list> | no | What Tab offers for the first argument; tab complete 2: for the second, and so on |
disabled: true | no | Keep the command in the file without adding it to the server |
subcommand <name>: | no | A command inside the command, with options and a trigger of its own |
players only: true | no | The console is told it cannot use the command. players only: alone says the same |
console only: true | no | Players are told they cannot use the command |
A number within limits. An argument that is a number can say what it has to lie between: <amount:number 1 to 10000>, <level:integer at least 1>, [percent:number at most 100]. A player who gives another number is told amount must be between 1 and 10000. and the trigger does not run.
command /pay <target:player> <amount:number 1 to 10000>:
trigger:
subtract arg.2 from {%player%.coins}
add arg.2 to {%arg.1%.coins}
send "&aYou paid %arg.1% %money(arg.2)%."
The command line may describe its arguments after the name, as in command /pay <player> <amount>:. It becomes the usage text unless a usage: line is given, and it decides what pressing Tab offers while the command is typed:
| Written in the header | Tab offers | |||
|---|---|---|---|---|
| `<on | off>, <red | blue | green>` | Those words |
<player> or <target> | The players who are online | |||
Anything else, such as <amount> | Nothing |
Subcommands. A command with several jobs can give each one its own block instead of a switch on the first argument. Each subcommand has its own permission, description, checked arguments and trigger, and arg.1 inside it is the first word *after* its name:
command /warp <name>:
tab complete: keys of {warp}
trigger:
teleport player to {warp.%arg.1%}
subcommand set <name>:
permission: "warps.manage"
trigger:
set {warp.%arg.1%} to player's location
send "&aWarp %arg.1% set."
subcommand list:
trigger:
send "&7Warps: &f" + join keys of {warp} with ", "
/warp set base runs the set block; /warp base runs the command's own trigger.tab complete: takes any list and is worked out when Tab is pressed, so it can offer warp names, team names or anything else a script keeps.What Tab offers, argument by argument. tab complete: can also be a block. Its lines run each time Tab is pressed, and set arg.1 to ... in it says what is offered for the first argument, set arg.2 to ... for the second, and so on. The lines are ordinary code, so what is offered for one argument can depend on what was typed for the ones before it:
command /rank [action] [target] [rank]:
permission: "ranks.admin"
tab complete:
set arg.1 to "set", "remove", "list"
set {_online} to server.players
if arg.1 is "set" or arg.1 is "remove":
set arg.2 to {_online}
if arg.1 is "set":
set arg.3 to "owner", "admin", "moderator", "vip"
trigger:
send "&7You typed: %args%"
What stands after to may be values written one after the other, a list, or both.
/rank and pressing Tab offers set, remove and list; after /rank set Steve it offers the ranks; after /rank list nothing, because the block set nothing for that.<player>, the words of <on|off>.arg.1 is what was typed.Checked arguments. Give an argument a type and HyperScript checks it before the trigger runs, answering with what is wrong, and the usage line for a missing argument or a number that is not one:
command /pay <target:player> <amount:number> [note]:
players only: true
trigger:
subtract arg.2 from {%player%.coins}
add arg.2 to {%arg.1%.coins}
| Written in the header | Checked | |
|---|---|---|
<name:player> | Must be someone who is online; Tab offers their names | |
<name:number> | Must be a number | |
<name:integer> | Must be a whole number. Both kinds of number may be typed short, 1.5k or 2m, and reach the trigger written out | |
<name:duration> | Must be a length of time: 30s, 10m, 2h, 1h30m, or a bare number of seconds. In the trigger the argument is that many seconds, so it goes wherever a time does: mute arg.1 for arg.2 | |
<name:boolean> | true, yes or on, or false, no or off; in the trigger it is true or false. Tab offers the two | |
<name:item> | Must be the name of an item of the game, as in diamond_sword | |
<name:world> | Must be a world that is loaded; Tab offers their names | |
<name:offline player> | Must be somebody who has played here, online or not | |
<name:text> | Everything from there to the end of the line as one argument, spaces and all. It has to be the last one | |
| `<on | off>` | One of the words, and nothing else: anything other is answered with the usage |
[name:type] | In square brackets: may be left out, but is checked when given | |
[name:type = value] | What the argument is when it is left out: with [amount:number = 1], arg.2 is 1 for a player who gave no amount. Works without a type as well, [note = "a gift"]. Only arguments at the end are filled in |
An argument without a type is not checked, as before. The types are not shown in the usage line.
A command declared without any arguments keeps the server's default, which is player names. The arguments are still read with %arg.1%, %arg.2% and so on, and are not checked for you.
A short command can also simply use a switch on the first argument, without subcommand blocks:
command /kit <starter|food>:
trigger:
switch arg.1:
case "starter":
give 1 stone sword to player
case "food":
give 16 bread to player
default:
send "&eUsage: /kit <starter|food>"
Commands can be run from the console; there is then no player. players only: true keeps the console out, or test if player is not set: yourself.
permission: valuesince 1.5.1Who may run the command
command /fly:
permission: "server.fly"
trigger:
execute console command "fly %player.name%"Try itopsince 1.5.1Server operators and the console, whatever permissions plugin is installed
command /shutdown:
permission: op
trigger:
execute console command "stop"Try itpermission <who> add <node>since 1.5.1Give the permission. It lasts across relogs and restarts
permission player add "server.fly"Try itpermission <who> add <node> for <duration>since 1.7.60Give it for a time: afterwards it is taken back by itself, also if the player was away or the server off meanwhile
command /trialfly:
trigger:
permission player add "server.fly" for 1 hour
send "&aYou can fly for an hour."Try itpermission <who> remove <node>since 1.5.1Take back a permission given this way
permission player remove "server.fly"Try it<who> has permission <node>since 1.5.1A condition; also does not have permission
if player has permission "tools.unbreaking":
cancel eventTry itA command can be limited to players holding a permission node, or to server operators:
command /fly:
permission: "server.fly"
trigger:
execute console command "fly %player.name%"
command /shutdown:
permission: op
trigger:
execute console command "stop"
permission: value | Who may run the command |
|---|---|
a node, such as "server.fly" | Players who have that permission. Quotes are optional |
op | Server operators and the console, whatever permissions plugin is installed |
| not given | Everyone |
Scripts can also hand out permissions themselves:
command /buyfly:
trigger:
if {%player%.coins} < 500:
send "&cFlying costs 500 coins."
stop
subtract 500 from {%player%.coins}
permission player add "server.fly"
send "&aYou can now use /fly."
| Statement | Effect |
|---|---|
permission <who> add <node> | Give the permission. It lasts across relogs and restarts |
permission <who> add <node> for <duration> | Give it for a time: afterwards it is taken back by itself, also if the player was away or the server off meanwhile |
permission <who> remove <node> | Take back a permission given this way |
<who> has permission <node> | A condition; also does not have permission |
<who> is player, all players, or a player name; the player has to be online.remove only undoes what add gave. A permission the player has from a rank or another plugin stays; change that in the plugin that manages your ranks.cooldown: <duration>Time between uses. Units: ticks, seconds, minutes, hours, days, or short forms such as 90s and 1h 30m
on right click:
cooldown: 2 seconds
send "&7Click!"Try itcooldown message: <text>Sent instead of running the trigger. %cooldown% becomes the time left, e.g. 59 minutes 30 seconds
command /kit:
cooldown: 1 hour
cooldown message: "&cYou must wait %cooldown% before using this again!"
trigger:
give 1 diamond to playerTry itworlds: <name>, <name>since 1.7.64At the top of an event's block: the block runs only when it happens in one of those worlds
on block break:
worlds: "survival", "resource"
add 1 to {%player%.mined}Try itpermission: <node>since 1.7.64At the top of an event's block: it runs only for a player who has that permission
on player join:
permission: "vip.perks"
send "&6Welcome back, VIP."Try itreset cooldownA statement: gives the player their cooldown back, for when the trigger decides not to do anything
reset cooldownTry itlimit: <n> per <duration>since 1.7.23At most that many runs in that long for each player: limit: 5 per second, limit: 20 per 10 seconds, limit: 1 per minute. Runs beyond it are dropped without a word. Goes where cooldown: goes, on a command or as the first line of an event
on chat:
limit: 3 per 5 seconds
add 1 to {%player%.messages}Try itstart cooldown <name> of <duration>since 1.7.14Starts a cooldown of your own for the player, by any name you like. Add for <who> to start it for someone else. Starting it again replaces the time left
on right click with stick:
if player is on cooldown "zap":
stop
start cooldown "zap" of 3 seconds
strike lightning at playerTry itend cooldown <name>since 1.7.14Ends it early; for <who> as above
command /resetkit <player>:
permission: kits.admin
trigger:
end cooldown "kit" for arg.1
send "&aDone."Try itcooldown <name>since 1.7.14An expression: the time left, or unset once it is over. cooldown <name> of <who> for someone else
command /kittime:
trigger:
set {_left} to cooldown "kit"
if {_left} is set:
send "&7Kit ready in &f%{_left}%"
else:
send "&aYour kit is ready."Try itA cooldown limits how often each player can run a command or trigger an event.
command /kit:
cooldown: 1 hour
cooldown message: "&cYou must wait %cooldown% before using this again!"
trigger:
give 1 diamond to player
On an event, the cooldown lines come first inside the block:
on right click:
cooldown: 2 seconds
send "&7Click!"
| Line | Meaning |
|---|---|
cooldown: <duration> | Time between uses. Units: ticks, seconds, minutes, hours, days, or short forms such as 90s and 1h 30m |
cooldown message: <text> | Sent instead of running the trigger. %cooldown% becomes the time left, e.g. 59 minutes 30 seconds |
worlds: <name>, <name> | At the top of an event's block: the block runs only when it happens in one of those worlds |
permission: <node> | At the top of an event's block: it runs only for a player who has that permission |
reset cooldown | A statement: gives the player their cooldown back, for when the trigger decides not to do anything |
limit: <n> per <duration> | At most that many runs in that long for each player: limit: 5 per second, limit: 20 per 10 seconds, limit: 1 per minute. Runs beyond it are dropped without a word. Goes where cooldown: goes, on a command or as the first line of an event |
start cooldown <name> of <duration> | Starts a cooldown of your own for the player, by any name you like. Add for <who> to start it for someone else. Starting it again replaces the time left |
end cooldown <name> | Ends it early; for <who> as above |
cooldown <name> | An expression: the time left, or unset once it is over. cooldown <name> of <who> for someone else |
limit: or cooldown:? A cooldown makes a player wait after one use and can tell them how long. A limit lets a burst through and stops a flood: it is for events a player can set off many times a second (chat, clicks, movement), where a script that does real work on every one of them would be made to work as hard as the player cares to click. Limits are not saved.cooldown: or start cooldown? cooldown: is for the common case, one wait per command or event. start cooldown is for everything else: a wait that starts only when the trigger succeeds, one shared by several commands, or one on an item or a menu button. Test it with player is on cooldown "<name>". These too are saved and survive restarts.reset cooldown before stop so the player is not charged for nothing.hyperscript.cooldown.bypass are not either; it is not granted to anyone by default, not even operators.{%player%.hs.cooldown.command.<name>} for commands. Deleting it ends the cooldown: delete {%player%.hs.cooldown.command.kit}.on player join:A player joins · no
on player join:
send "&aWelcome, %player.name%!" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%player.world% | text | World the player is in | |
%player.location% | location | Where the player is standing | |
x of player's location | number | The x of %player.location%, as a number | |
y of player's location | number | The y of %player.location%, as a number: how high it is | |
z of player's location | number | The z of %player.location%, as a number |
player is: The player who joinedon first join:since 1.5.9Someone joins who has never played here before · no
on first join:
give 16 bread to player
broadcast "&6Welcome &e%player.name% &6to the server!"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%player.world% | text | World the player is in | |
%player.location% | location | Where the player is standing | |
x of player's location | number | The x of %player.location%, as a number | |
y of player's location | number | The y of %player.location%, as a number: how high it is | |
z of player's location | number | The z of %player.location%, as a number |
player is: The new playeron left click:since 1.7.0A player left-clicks air or a block · yes
on left click:
if item is "stick":
send "&7Poke."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item in the player's hand; unset if empty |
%event.block% | block | text | The block clicked; unset when clicking air |
player is: The player who clickedon player sneak:since 1.7.0A player starts sneaking · yes
on player sneak:
send action bar "&7Sneaking..." to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player sneakingon player sprint:since 1.7.0A player starts sprinting · yes
on player sprint:
add 1 to {%player%.sprints}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player sprintingon player swim:since 1.7.0A player starts swimming · yes
on player swim:
apply night vision to player for 30 secondsTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player swimmingon flight toggle:since 1.7.0A player starts or stops flying · yes
on flight toggle:
if player does not have permission "fly.use":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The playeron hand swap:since 1.7.0A player swaps the items in their hands · yes
on hand swap:
cancel event
send "&7Hands are locked here."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playeron slot change:since 1.7.0A player selects another hotbar slot · yes
on slot change:
if item is "compass":
send action bar "&bRight-click to open the menu" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.slot% | slot | number | The hotbar slot now selected, 1 to 9 |
%event.item% | item | text | The type of item in that slot; unset if empty |
player is: The playeron item break:since 1.7.0A player's tool or armour breaks · no
on item break:
send "&cYour %event.item% broke!"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item that broke |
player is: The player whose item brokeon book edit:since 1.7.0A player writes in or signs a book · yes
on book edit:
log "%player.name% edited a book"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playeron gamemode change:since 1.7.0A player's game mode is about to change · yes
on gamemode change:
if event.gamemode is "creative" and player does not have permission "build.creative":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.gamemode% | text | The mode being changed to: survival, creative, adventure or spectator |
player is: The playeron hunger change:since 1.7.0A player's hunger bar changes · yes
on hunger change:
if region at player's location contains "spawn":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.amount% | amount | number | The new hunger level, 0 to 20 |
player is: The playeron player heal:since 1.7.0A player regains health · yes
on player heal:
if {%player%.in_combat}:
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.amount% | amount | number | How much health is regained; 2 is one heart |
%event.reason% | reason | text | SATIATED, REGEN, MAGIC, EATING and so on |
player is: The playeron experience gain:since 1.7.0A player gains experience points · no
on experience gain:
add amount to {%player%.total_xp}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.amount% | amount | number | How many points were gained |
player is: The playeron effect gained:since 1.7.0A player gets a potion effect · yes
on effect gained:
if event.effect is "poison" and player has permission "vip.immune":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.effect% | text | The effect, e.g. speed or poison |
player is: The playeron effect ended:since 1.7.0A potion effect on a player ends · yes
on effect ended:
send action bar "&7%event.effect% wore off" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.effect% | text | The effect that ended |
player is: The playeron player kick:since 1.7.0A player is about to be kicked · yes
on player kick:
log "%player.name% was kicked: %event.reason%"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.reason% | reason | text | The reason given |
player is: The player being kickedon advancement:since 1.7.0A player completes an advancement · no
on advancement:
if event.advancement is "story/mine_diamond":
broadcast "&b%player.name% found diamonds!"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.advancement% | text | The advancement's id, e.g. story/mine_diamond |
player is: The playeron player kill:since 1.7.0One player kills another; the player is the killer · no
on player kill:
grant advancement "first kill" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.victim% | victim | text | The name of the player who died |
%event.location% | location | Where the victim died | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who made the killon projectile shoot:since 1.7.0A player shoots or throws something · yes
on projectile shoot:
if entity is "ender_pearl" and {%player%.in_combat}:
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | What was shot, e.g. arrow or snowball |
player is: The player who shoton projectile hit:since 1.7.0Something a player shot lands · no
on projectile hit:
if entity is "snowball" and victim is set:
send "&bSplat! You hit %event.victim%"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | What was shot, e.g. arrow |
%event.victim% | victim | text | Who or what was hit: a player's name or a mob type; unset for a block |
%event.location% | location | Where it landed | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who shot iton totem use:since 1.7.0A totem of undying saves a player · yes
on totem use:
broadcast "&6%player.name% cheated death!"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who was savedon block burn:since 1.7.0Fire destroys a block · yes
on block burn:
if region at event's location contains "spawn":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The block being burnt |
%event.location% | location | Where the block is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon explosion:since 1.7.0Something explodes · yes
on explosion:
if entity is "creeper":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.entity% | entity | text | What exploded, e.g. creeper or primed_tnt |
%event.location% | location | Where it exploded | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon leaves decay:since 1.7.0Leaves disappear after a tree is cut · yes
on leaves decay:
if region at event's location contains "park":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The kind of leaves |
%event.location% | location | Where they are | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon redstone:since 1.7.63The redstone power of a block changes · no
on redstone:
if event.block is "redstone_lamp":
if event.power > 0:
log "A lamp was lit at %event's location%"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The block whose power changed |
%event.power% | number | The power it has now, 0 to 15 | |
%event.location% | location | Where the block is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon piston extend:since 1.7.63A piston pushes out · yes
on piston extend:
if region at event's location contains "spawn":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The piston: piston or sticky_piston |
%event.location% | location | Where the piston is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon piston retract:since 1.7.63A piston pulls back · yes
on piston retract:
if region at event's location contains "spawn":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The piston: piston or sticky_piston |
%event.location% | location | Where the piston is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon dispense:since 1.7.63A dispenser or dropper puts out an item · yes
on dispense:
if event.item is "tnt":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The block: dispenser or dropper |
%event.item% | item | text | What it puts out |
%event.location% | location | Where the block is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon hopper move:since 1.7.63A hopper or the like moves an item between containers · yes
on hopper move:
if event.item is "diamond":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.item% | item | text | The item that is moved |
%event.location% | location | Where it is going | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon crop grow:since 1.7.0A crop or plant grows a stage · yes
on crop grow:
if {season} is "winter":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The plant, e.g. wheat |
%event.location% | location | Where it is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon bucket fill:since 1.7.0A player fills a bucket · yes
on bucket fill:
if region at player's location contains "spawn":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The bucket being used |
player is: The playeron bucket empty:since 1.7.0A player empties a bucket · yes
on bucket empty:
if item is "lava_bucket" and player does not have permission "build.lava":
cancel event
send "&cLava is not allowed."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The bucket being emptied, e.g. lava_bucket |
player is: The playeron weather change:since 1.7.0Rain starts or stops in a world · yes
on weather change:
if event.weather is "rain":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.weather% | text | What it is changing to: rain or clear |
player is: Nobodyon entity tame:since 1.7.0A player tames an animal · yes
on entity tame:
send "&aYou tamed a %event.entity%!"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | The animal, e.g. wolf |
player is: The player who tamed iton entity breed:since 1.7.0Two animals have a baby · yes
on entity breed:
if player is set:
add 1 to {%player%.animals_bred}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.entity% | entity | text | The kind of baby, e.g. cow |
player is: The player who fed them, if a player didon shear:since 1.7.0A player shears a sheep · yes
on shear:
add 1 to {%player%.sheep_sheared}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | What was sheared, e.g. sheep |
player is: The playeron mob target:since 1.7.0A mob picks a player as its target · yes
on mob target:
if player is vanished:
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | The mob, e.g. zombie |
player is: The player being targetedon player move:since 1.7.2A player moves into another block; runs very often, so keep it short · yes
on player move:
if block at (location below player's location) is "magma_block":
send action bar "&cHot!" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playeron portal use:since 1.7.2A player is about to go through a nether or end portal · yes
on portal use:
if {%player%.level} < 10:
cancel event
send "&cReach level 10 before leaving the overworld."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playeron bed leave:since 1.7.2A player gets out of a bed · no
on bed leave:
send "&eGood morning, %player.name%!"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playeron item damage:since 1.7.2An item a player is using loses durability · yes
on item damage:
if player has permission "tools.unbreaking":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playeron harvest:since 1.7.2A player picks berries or the like from a block without breaking it · yes
on harvest:
add 1 to {%player%.harvests}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playeron glide toggle:since 1.7.2A player starts or stops gliding with an elytra · yes
on glide toggle:
if region at player's location contains "spawn":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playeron entity mount:since 1.7.2A player gets onto a creature or vehicle · yes
on entity mount:
send action bar "&7Sneak to get off" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playeron entity dismount:since 1.7.2A player gets off what they were riding · yes
on entity dismount:
add 1 to {%player%.rides}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playeron vehicle enter:since 1.7.0A player gets into a vehicle · yes
on vehicle enter:
send action bar "&7Hold on tight" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | The vehicle, e.g. boat or minecart |
player is: The playeron vehicle exit:since 1.7.0A player gets out of a vehicle · yes
on vehicle exit:
log "%player.name% left a %event.entity%"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | The vehicle |
player is: The playeron inventory open:since 1.7.0A player opens a container · yes
on inventory open:
if event.inventory is "ender_chest" and {%player%.in_combat}:
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.inventory% | text | The kind of container: chest, furnace, anvil and so on | |
%event.location% | location | Where the container stands; unset for one that stands nowhere, such as an ender chest or a menu a script opened | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The playeron inventory close:since 1.7.0A player closes a container · no
on inventory close:
delete {%player%.shop_page}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.inventory% | text | The kind of container that was open |
player is: The playeron enchant item:since 1.7.0A player enchants an item at a table · yes
on enchant item:
add 1 to {%player%.enchants}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The item being enchanted |
%event.level% | number | How many levels it costs |
player is: The playeron furnace smelt:since 1.7.0A furnace finishes smelting an item · yes
on furnace smelt:
add 1 to {smelted.%event.item%}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.item% | item | text | What comes out, e.g. iron_ingot |
%event.location% | location | Where the furnace is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon console command:since 1.7.0A command is run from the console · yes
on console command:
if command is "stop":
broadcast "&cThe server is shutting down."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.command% | command | text | The command without the slash, in lower case |
%event.message% | message | text | The whole line |
player is: Nobodyon shield block:since 1.7.1A player's raised shield takes a blow completely · no
on shield block:
add 1 to {%player%.blocks_made}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.attacker% | attacker | text | Who struck: a player's name or a mob type |
player is: The player holding the shieldon anvil use:since 1.7.1A player takes the finished item out of an anvil · yes
on anvil use:
if item is "name_tag" and player does not have permission "anvil.nametags":
cancel event
send "&cYou cannot rename name tags here."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The item being taken out |
player is: The player using the anvilon villager trade:since 1.7.1A player takes the goods out of a trade · yes
on villager trade:
add 1 to {%player%.trades}
if item is "emerald":
send action bar "&aA fine deal" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | What the player is buying |
player is: The player tradingon server start:since 1.7.0Once, when the server has started and every script is loaded; not on a reload · no
on server start:
log "The server is up. %server.online_players% player(s) online."Try iton server stop:since 1.7.0Once, as the server shuts down · no
on server stop:
set {last_shutdown} to nowTry iton player quit:A player leaves · no
on player quit:
hide quit messageTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The player who lefton player login:since 1.5.7Someone is connecting, before they are in the game; see Moderation · with refuse login
on player login:
if {maintenance} and {%player%.staff} is not set:
refuse login because "&eThe server is being worked on. Back soon!"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.name% | text | The name of the player logging in | |
%event.uuid% | text | Their account id | |
%event.address% | text | The address they are connecting from |
player is: Nobody yet: 'player' is unset, but {%player%.<name>} is already the variables of whoever is logging inon player death:since 1.5.6A player dies · Paper only
on player death:
subtract 5 from {%player%.coins}
send "&cYou died and lost 5 coins."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.message% | message | text | The death message everyone will see |
%event.killer% | killer | text | Name of the player who made the kill; unset if none |
%event.cause% | cause | text | What killed the player: FALL, LAVA, ENTITY_ATTACK and so on |
%event.location% | location | Where the player died | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who diedon player respawn:since 1.5.6A player comes back after dying · no
on player respawn:
make player invulnerable for 5 secondsTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is about to appear | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who respawnedon item pickup:since 1.5.6A player picks an item up off the ground · yes
on item pickup:
if item is "diamond":
add amount to {%player%.diamonds_found}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item, e.g. diamond |
%event.amount% | amount | number | How many items are in the stack |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player picking the item upon item drop:since 1.5.6A player drops an item · yes
on item drop:
if item is "compass":
cancel event
send "&cYou cannot drop your compass."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item, e.g. diamond |
%event.amount% | amount | number | How many items are in the stack |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player dropping the itemon world change:since 1.5.6A player arrives in another world · no
on world change:
send "&7You left &f%event.from% &7for &f%player.world%"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%player.world% | text | World the player is in | |
%event.from% | text | The name of the world the player left | |
%event.location% | location | Where the player is now | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who changed worldon player command:since 1.5.6A player types any command, before the server runs it · yes
on player command:
if command is "plugins" and player does not have permission "server.admin":
cancel event
send "&cThat command is not available."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.command% | command | text | The command without the slash, in lower case: home |
%event.message% | message | text | The whole line as typed: /home set base |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who typed the commandon block break:A player breaks a block · yes
enchantment prospector:
on block break:
if event.block is "stone":
if chance of 5%:
give player 1 gold nuggetTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.block% | block | text | The block type, e.g. diamond_ore |
%event.location% | location | Where the block is | |
%event.drops% | list | The items the block will drop with the tool in the player's hand | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player breaking the blockon block place:since 1.5.8A player places a block · yes
on block place:
if block is "tnt" and player does not have permission "build.tnt":
cancel event
send "&cTNT is not allowed here."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.block% | block | text | The block type placed, e.g. tnt |
%event.location% | location | Where the block was placed | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who placed iton sign change:since 1.5.8A player finishes writing on a sign · yes
on sign change:
if item 1 of event.lines is "[Shop]":
send "&aShop sign created."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.lines% | list | The lines of text, top to bottom | |
%event.block% | block | text | The kind of sign, e.g. oak_sign |
%event.location% | location | Where the sign is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who wrote the signon player teleport:since 1.5.8A player is about to be teleported · yes
on player teleport:
if cause is "ENDER_PEARL" and region at event's location contains "spawn":
cancel event
send "&cNo pearling into spawn."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.cause% | cause | text | COMMAND, PLUGIN, ENDER_PEARL, NETHER_PORTAL and so on |
%event.location% | location | Where the player is going | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player being teleportedon entity click:since 1.5.8A player right-clicks a mob, animal or player · yes
on entity click:
make event entity glow for player for 10 secondsTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | The type clicked, e.g. villager or player |
%event.clicked% | text | A player's name if a player was clicked, otherwise the type | |
%event.location% | location | Where the clicked entity is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who clickedon craft:since 1.5.8A player takes the result out of a crafting grid · yes
on craft:
if item is "diamond_sword" and level of player < 10:
cancel event
send "&cYou need level 10 to craft that."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The item being crafted, e.g. diamond_sword |
%event.amount% | amount | number | How many one craft makes |
player is: The player craftingon consume:since 1.5.8A player finishes eating or drinking · yes
on consume:
if item is "golden_apple":
apply speed 2 to player for 10 secondsTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | What was eaten or drunk, e.g. golden_apple |
player is: The player eating or drinkingon fish:since 1.5.8A player reels in a catch · yes
on fish:
add 1 to {%player%.fish_caught}
send action bar "&bCatch #%{%player%.fish_caught}%: %event.item%" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | What was caught, e.g. cod |
%event.amount% | amount | number | How many |
player is: The player fishingon level up:since 1.5.8A player's experience level goes up · no
on level up:
play particle effect "level up" at playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.level% | number | The level just reached | |
%event.old_level% | number | The level before |
player is: The player who levelled upon bed enter:since 1.5.8A player gets into a bed · yes
on bed enter:
set {%player%.bed} to event's location
send "&7Sleep well."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the bed is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player going to bedon region enter:since 1.5.8A player comes into a script region; see Worlds and regions · no
on region enter:
if event.region is "spawn":
send title "&aSpawn" with subtitle "&7You are safe here" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.region% | text | The name of the region entered | |
%event.location% | location | Where the player now is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who enteredon region leave:since 1.5.8A player leaves a script region · no
on region leave:
if event.region is "spawn":
send action bar "&cYou left the safe zone" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.region% | text | The name of the region left | |
%event.location% | location | Where the player now is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who lefton combat start:since 1.7.50A player gets into a fight with another player; see Combat and being away · no
on combat start:
send action bar "&cIn combat" to player while player is in combatTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.opponent% | text | The name of the other player; unset when a script started it |
player is: The player who is now in combaton combat end:since 1.7.50The fight is over: nobody hit anybody for combat-time · no
on combat end:
send "&aYou are out of combat."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The player who is out of combat againon afk:since 1.7.50A player has done nothing for afk-time · no
on afk:
broadcast "&7%player.name% is away."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The player who is awayon afk return:since 1.7.50A player who was away does something again · no
on afk return:
broadcast "&7%player.name% is back."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The player who is backon kill streak:since 1.7.52A player kills another player; %event.streak% is how many in a row · no
on kill streak:
if event.streak is 5:
broadcast "&6%player.name% is on a killing spree!"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.streak% | number | How many kills in a row this is: 1 for the first | |
%event.opponent% | text | The name of the player who was killed |
player is: The player who made the killon blocked word:since 1.7.55A player writes a word in chat that a script blocked; %event.word% is the word · no
on blocked word:
add 1 to {%player%.warnings}
if {%player%.warnings} >= 3:
mute player for 10 minutes because "language"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.word% | text | The blocked word that was found | |
%event.message% | text | What the player wrote, as they wrote it |
player is: The player who wrote iton brew:since 1.7.55A brewing stand finishes brewing; there is no player · yes
on brew:
spawn particle "witch" count 20 at event.locationTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.location% | location | Where the brewing stand is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon entity death:Any living entity dies; the player is the killer, if there was one · Paper only
on entity death:
if event.entity is "wither" and player is set:
set {_boss} to "the Wither"
fire event "boss killed" with {_boss}Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.entity% | entity | text | The type of entity that died |
%event.killer% | killer | text | Name of the player who made the kill; unset if none |
player is: The killer, if a player made the kill; otherwise nobodyon player chat:A player sends a chat message · yes
on player chat:
set chat format to "&7%player.name% &8>> &f%event.message%"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.message% | message | text | The text of the message |
%event.recipients% | list | Names of the players who will see it |
player is: The senderon right click:A player right-clicks air or a block, with either hand. Not when they are looking at a creature or another player in reach: that is on entity click: · yes
on right click:
cooldown: 2 seconds
send "&7Click!"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item in the player's hand; unset if empty |
%event.block% | block | text | The block clicked; unset when clicking air |
%event.location% | location | Where the clicked block is; unset when clicking air | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who clickedon right click with <item>:since 1.7.14The same, but only for a player holding that item in either hand. on left click with <item>: likewise · yes
on right click with compass:
send "&7You are at &f%player.x%, %player.y%, %player.z%"Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item in the player's hand; unset if empty |
%event.block% | block | text | The block clicked; unset when clicking air |
%event.location% | location | Where the clicked block is; unset when clicking air | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who clickedon right click on <block>:since 1.7.68The same, but only for a click on that kind of block: on right click on gold block:. on left click on <block>: likewise, and with <item> may follow: on right click on gold block with stick: · yes
on right click on gold block:
send "&6That is solid gold."Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item in the player's hand; unset if empty |
%event.block% | block | text | The block clicked; unset when clicking air |
%event.location% | location | Where the clicked block is; unset when clicking air | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player who clickedon entity damage: (or on hit:)since 1.5.0Any entity takes damage · yes
on entity damage:
show floating text "&c-%event.damage%" at victimTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.attacker% | attacker | text | Who dealt the damage: a player's name or a mob type such as zombie. For an arrow or other projectile this is whoever shot it. Unset for damage with no attacker, such as falling |
%event.victim% | victim | text | Who was hurt: a player's name or a mob type |
%event.damage% | damage | number | Damage actually taken, after armour and effects; 2 is one heart |
%event.cause% | cause | text | Why: FALL, FIRE, ENTITY_ATTACK, PROJECTILE, DROWNING, VOID and so on |
%event.entity% | entity | text | The victim's entity type, e.g. player or zombie |
%event.location% | location | Where the victim is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The victim if a player was hurt; otherwise the attacker if a player dealt the damage; otherwise nobodyon player jump:since 1.5.0A player jumps · yes
on player jump:
if {%player%.frozen} is true:
cancel event
send action bar "&cYou cannot jump while frozen!" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%player.world% | text | World the player is in | |
%player.location% | location | Where the player is standing | |
%event.location% | location | Where the jump started | |
x of player's location | number | The x of %player.location%, as a number | |
y of player's location | number | The y of %player.location%, as a number: how high it is | |
z of player's location | number | The z of %player.location%, as a number | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The jumping playeron mob spawn:since 1.5.0A living creature spawns · yes
on mob spawn:
if entity is "phantom" and reason is "NATURAL":
cancel eventTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.entity% | entity | text | The type of creature, e.g. zombie |
%event.reason% | reason | text | Why it spawned: NATURAL, SPAWNER, SPAWNER_EGG, BREEDING, CUSTOM and so on |
%event.location% | location | Where it spawns | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: Nobodyon inventory click:since 1.5.0A player clicks in an inventory window · yes
on inventory click:
if item is "barrier" and event.click_type is "SHIFT_LEFT":
cancel event
send "&cThat item cannot be moved." to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.slot% | slot | number | The slot clicked, counting from 1 at the top left of the window, the same numbering open gui uses. Unset for a click outside the window |
%event.item% | item | text | The type of item in that slot; unset if it is empty |
%event.click_type% | text | How it was clicked: LEFT, RIGHT, SHIFT_LEFT, SHIFT_RIGHT, MIDDLE, DROP and so on |
player is: The player who clickedon server ping:since 1.5.2A client refreshes its server list; see Server list · no
on server ping:
set motd to random item of ["&6Welcome!", "&bNew: sky islands", "&dVote for rewards"]Try itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.address% | text | The IP address of the client asking | |
%server.motd% | text | The MOTD from server.properties | |
%server.online_players% | number | Players online right now | |
%server.max_players% | number | The real player limit |
player is: Nobody: the client has not logged in, so only its address is knownon resource pack accept:since 1.4.0A player agrees to download a resource pack · no
on resource pack accept:
send action bar "&aDownloading server resource pack..." to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playerMore about on resource pack accept:, with a box to try it in
on resource pack decline:since 1.4.0A player refuses a resource pack · no
on resource pack decline:
send "&cSome custom items may look wrong without the pack." to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playerMore about on resource pack decline:, with a box to try it in
on resource pack successfully loaded:since 1.4.0A player's game has finished applying the pack · no
on resource pack successfully loaded:
send "&aResource pack loaded!" to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playerMore about on resource pack successfully loaded:, with a box to try it in
on resource pack failed:since 1.4.0The download or the pack itself failed · no
on resource pack failed:
send "&cThe resource pack failed to load." to playerTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
player is: The playerMore about on resource pack failed:, with a box to try it in
| Event | Fires when | Can be cancelled |
|---|---|---|
on player join: | A player joins | no |
on first join: | Someone joins who has never played here before | no |
on left click: | A player left-clicks air or a block | yes |
on player sneak: | A player starts sneaking | yes |
on player sprint: | A player starts sprinting | yes |
on player swim: | A player starts swimming | yes |
on flight toggle: | A player starts or stops flying | yes |
on hand swap: | A player swaps the items in their hands | yes |
on slot change: | A player selects another hotbar slot | yes |
on item break: | A player's tool or armour breaks | no |
on book edit: | A player writes in or signs a book | yes |
on gamemode change: | A player's game mode is about to change | yes |
on hunger change: | A player's hunger bar changes | yes |
on player heal: | A player regains health | yes |
on experience gain: | A player gains experience points | no |
on effect gained: | A player gets a potion effect | yes |
on effect ended: | A potion effect on a player ends | yes |
on player kick: | A player is about to be kicked | yes |
on advancement: | A player completes an advancement | no |
on player kill: | One player kills another; the player is the killer | no |
on projectile shoot: | A player shoots or throws something | yes |
on projectile hit: | Something a player shot lands | no |
on totem use: | A totem of undying saves a player | yes |
on block burn: | Fire destroys a block | yes |
on explosion: | Something explodes | yes |
on leaves decay: | Leaves disappear after a tree is cut | yes |
on redstone: | The redstone power of a block changes | no |
on piston extend: | A piston pushes out | yes |
on piston retract: | A piston pulls back | yes |
on dispense: | A dispenser or dropper puts out an item | yes |
on hopper move: | A hopper or the like moves an item between containers | yes |
on crop grow: | A crop or plant grows a stage | yes |
on bucket fill: | A player fills a bucket | yes |
on bucket empty: | A player empties a bucket | yes |
on weather change: | Rain starts or stops in a world | yes |
on entity tame: | A player tames an animal | yes |
on entity breed: | Two animals have a baby | yes |
on shear: | A player shears a sheep | yes |
on mob target: | A mob picks a player as its target | yes |
on player move: | A player moves into another block; runs very often, so keep it short | yes |
on portal use: | A player is about to go through a nether or end portal | yes |
on bed leave: | A player gets out of a bed | no |
on item damage: | An item a player is using loses durability | yes |
on harvest: | A player picks berries or the like from a block without breaking it | yes |
on glide toggle: | A player starts or stops gliding with an elytra | yes |
on entity mount: | A player gets onto a creature or vehicle | yes |
on entity dismount: | A player gets off what they were riding | yes |
on vehicle enter: | A player gets into a vehicle | yes |
on vehicle exit: | A player gets out of a vehicle | yes |
on inventory open: | A player opens a container | yes |
on inventory close: | A player closes a container | no |
on enchant item: | A player enchants an item at a table | yes |
on furnace smelt: | A furnace finishes smelting an item | yes |
on console command: | A command is run from the console | yes |
on shield block: | A player's raised shield takes a blow completely | no |
on anvil use: | A player takes the finished item out of an anvil | yes |
on villager trade: | A player takes the goods out of a trade | yes |
on server start: | Once, when the server has started and every script is loaded; not on a reload | no |
on server stop: | Once, as the server shuts down | no |
on player quit: | A player leaves | no |
on player login: | Someone is connecting, before they are in the game; see Moderation | with refuse login |
on player death: | A player dies | Paper only |
on player respawn: | A player comes back after dying | no |
on item pickup: | A player picks an item up off the ground | yes |
on item drop: | A player drops an item | yes |
on world change: | A player arrives in another world | no |
on player command: | A player types any command, before the server runs it | yes |
on block break: | A player breaks a block | yes |
on block place: | A player places a block | yes |
on sign change: | A player finishes writing on a sign | yes |
on player teleport: | A player is about to be teleported | yes |
on entity click: | A player right-clicks a mob, animal or player | yes |
on craft: | A player takes the result out of a crafting grid | yes |
on consume: | A player finishes eating or drinking | yes |
on fish: | A player reels in a catch | yes |
on level up: | A player's experience level goes up | no |
on bed enter: | A player gets into a bed | yes |
on region enter: | A player comes into a script region; see Worlds and regions | no |
on region leave: | A player leaves a script region | no |
on combat start: | A player gets into a fight with another player; see Combat and being away | no |
on combat end: | The fight is over: nobody hit anybody for combat-time | no |
on afk: | A player has done nothing for afk-time | no |
on afk return: | A player who was away does something again | no |
on kill streak: | A player kills another player; %event.streak% is how many in a row | no |
on blocked word: | A player writes a word in chat that a script blocked; %event.word% is the word | no |
on brew: | A brewing stand finishes brewing; there is no player | yes |
on entity death: | Any living entity dies; the player is the killer, if there was one | Paper only |
on player chat: | A player sends a chat message | yes |
on right click: | A player right-clicks air or a block, with either hand. Not when they are looking at a creature or another player in reach: that is on entity click: | yes |
on right click with <item>: | The same, but only for a player holding that item in either hand. on left click with <item>: likewise | yes |
on right click on <block>: | The same, but only for a click on that kind of block: on right click on gold block:. on left click on <block>: likewise, and with <item> may follow: on right click on gold block with stick: | yes |
on entity damage: (or on hit:) | Any entity takes damage | yes |
on player jump: | A player jumps | yes |
on mob spawn: | A living creature spawns | yes |
on inventory click: | A player clicks in an inventory window | yes |
on server ping: | A client refreshes its server list; see Server list | no |
on resource pack accept: | A player agrees to download a resource pack | no |
on resource pack decline: | A player refuses a resource pack | no |
on resource pack successfully loaded: | A player's game has finished applying the pack | no |
on resource pack failed: | The download or the pack itself failed | no |
Several scripts (or several blocks in one script) may handle the same event; they run in file-name order. on load: looks like an event but is not one: it runs when the script is loaded, as described under File structure.
Right-clicks. on right click: runs once for each click, whichever hand it was made with and whatever is in it, on a block or in the air. It does not run when the player is looking at a creature or another player that is near enough to click: that click is on entity click:. One case cannot be seen by any plugin: right-clicking the air with a completely empty hand. The game does not tell the server about that click at all. Holding anything, or clicking a block, works.
Events of your own. fire event "<name>" runs every on event "<name>": block, wherever it is, so scripts can tell each other that something happened without knowing about each other:
# In Bosses.hs
on entity death:
if event.entity is "wither" and player is set:
set {_boss} to "the Wither"
fire event "boss killed" with {_boss}
# In Rewards.hs
on event "boss killed":
add 500 to {%player%.coins}
broadcast "&6%player.name% &eslew %{_boss}%!"
Inside the block, player is the player of the trigger that fired the event (if it had one), and each local variable handed over with with is there under the same name.
Short names. The word player may be left out of an event's name wherever what is left still means only one event: on join: is on player join:, and likewise on quit:, on chat:, on death:, on respawn:, on command:, on move: and the rest.
Stepping on a block. on step on <block>: is on player move: for players who are standing on that kind of block, which is what a move handler is most often written for:
on step on magma block:
ignite player for 3 seconds
on step on "slime_block":
push player upward with force 1.5
Questions. While a script is waiting for an answer to ask or confirm, the player's next chat message is the answer and is not shown to anybody. The answers offered to click on run the command /hsanswer, which any player may use and which does nothing when no question is open.
attackersince 1.5.0%event.attacker% · entity damage · Who dealt the damage: a player's name or a mob type; for a projectile, whoever shot it; unset if nobody did
on entity damage:
if attacker is set and victim is "villager":
cancel eventTry itvictimsince 1.5.0%event.victim% · entity damage · Who was hurt: a player's name or a mob type
send action bar "&aFall damage negated!" to victimTry itdamagesince 1.5.0%event.damage% · entity damage · Damage taken after armour; 2 is one heart
on entity damage:
if damage >= 10:
send "&cThat hit hard!" to victimTry itcausesince 1.5.0%event.cause% · entity damage · FALL, FIRE, ENTITY_ATTACK, PROJECTILE and so on
if cause is "ENDER_PEARL" and region at event's location contains "spawn":
cancel event
send "&cNo pearling into spawn."Try itcausesince 1.5.0%event.cause% · player death · What killed the player, in the same words
if cause is "ENDER_PEARL" and region at event's location contains "spawn":
cancel event
send "&cNo pearling into spawn."Try itmessagesince 1.5.0%event.message% · player chat · The chat message
if message contains "badword":
cancel event
send "&cPlease keep chat friendly!" to playerTry itmessagesince 1.5.0%event.message% · player death · The death message everyone will see
if message contains "badword":
cancel event
send "&cPlease keep chat friendly!" to playerTry itmessagesince 1.5.0%event.message% · player command · The whole line as typed, e.g. /home set base
if message contains "badword":
cancel event
send "&cPlease keep chat friendly!" to playerTry itcommandsince 1.5.6%event.command% · player command · The command without the slash, in lower case: home
on player command:
if command is "plugins":
cancel eventTry itamountsince 1.5.6%event.amount% · item pickup, item drop · How many items are in the stack
on item pickup:
send "&7Picked up %event.amount% %event.item%"Try it%event.gamemode%since 1.7.0gamemode change · The mode being changed to
if event.gamemode is "creative" and player does not have permission "build.creative":
cancel eventTry it%event.effect%since 1.7.0effect gained, effect ended · The potion effect
send action bar "&7%event.effect% wore off" to playerTry it%event.advancement%since 1.7.0advancement · The advancement's id
if event.advancement is "story/mine_diamond":
broadcast "&b%player.name% found diamonds!"Try it%event.weather%since 1.7.0weather change · rain or clear
if event.weather is "rain":
cancel eventTry it%event.inventory%since 1.7.0inventory open, inventory close · The kind of container
if event.inventory is "ender_chest" and {%player%.in_combat}:
cancel eventTry it%event.region%since 1.5.8region enter, region leave · The name of the region
on region enter:
send action bar "&7Entering &f%event.region%" to playerTry it%event.opponent%since 1.7.50combat start · The name of the other player; unset when a script started the fight
on combat start:
send "&cYou are fighting %event.opponent%. Logging out now counts as a death."Try it%event.streak%since 1.7.52kill streak · How many players they have killed in a row since they last died
on kill streak:
if event.streak is 5:
broadcast "&6%player.name% is on a killing spree!"Try it%event.word%since 1.7.55blocked word · The blocked word that was found in what the player wrote
on blocked word:
log "%player.name% wrote the blocked word %event.word%"Try it%event.lines%since 1.5.8sign change · A list of the sign's lines, top to bottom
on sign change:
log "%player.name% wrote: %event.lines%"Try it%event.clicked%since 1.5.8entity click · A player's name if a player was clicked, otherwise the entity type
on entity click:
send "&7You clicked &f%event.clicked%"Try it%event.level%, %event.old_level%since 1.5.8level up · The level reached, and the one before
on level up:
send "&aLevel %event.old_level% -> %event.level%"Try it%event.name%since 1.5.7player login · The name of whoever is logging in
on player login:
log "%event.name% is connecting from %event.address%"Try it%event.uuid%since 1.5.7player login · Their account id
on player login:
log "%event.name% has the id %event.uuid%"Try it%event.address%since 1.5.7player login, server ping · The address they are connecting from
on player login:
log "%event.name% is connecting from %event.address%"Try it%event.from%since 1.5.6world change · The name of the world the player left
on world change:
send "&7You left %event.from% for %player.world%"Try itblocksince 1.5.0%event.block% · block break, right click · The block type, e.g. diamond_ore
on block break:
if block is "diamond_ore":
broadcast "&b%player.name% found diamonds!"Try it%event.power%since 1.7.63redstone · The power the block has now, 0 to 15
if event.power > 0:
log "A lamp was lit at %event's location%"Try itentitysince 1.5.0%event.entity% · entity damage, entity death, mob spawn · The entity type, e.g. zombie
on entity damage:
if event.cause is "FALL":
if player has permission "hyperscript.nofall":
cancel event
send action bar "&aFall damage negated!" to victimTry itkillersince 1.5.0%event.killer% · entity death, player death · Name of the player who made the kill
if killer is set:
send "&6You slew a %event.entity%" to playerTry itreasonsince 1.5.0%event.reason% · mob spawn · NATURAL, SPAWNER, SPAWNER_EGG, BREEDING, CUSTOM and so on
if entity is "phantom" and reason is "NATURAL":
cancel eventTry itslotsince 1.5.0%event.slot% · inventory click · The slot clicked, counting from 1 like the slots of open gui
on inventory click:
if slot is 1:
send "&7You clicked the first slot."Try ititemsince 1.5.0%event.item% · inventory click, right click, item pickup, item drop · The item type clicked, held, picked up or dropped
on right click:
if item is "compass":
send "&bYou are in %player.world%"Try it%event.click_type%since 1.5.4inventory click · LEFT, RIGHT, SHIFT_LEFT, MIDDLE, DROP and so on
on inventory click:
if event.click_type is "SHIFT_LEFT":
cancel eventTry it%event.recipients%since 1.5.4player chat · A list of the names of the players who will see the message
on player chat:
log "%player.name% wrote to: %event.recipients%"Try it%event.drops%since 1.5.4block break, entity death · A list of the items that are about to drop
broadcast "&b%player.name% found diamonds! Drops: %event.drops%"Try it%event.location%since 1.5.4block break, right click, entity damage, mob spawn, player jump · Where it happened, as a location; also written event's location
on block break:
spawn particle "flame" at event's locationTry itEach event makes its details available inside its block. Every value has a placeholder, and the common ones also have a one-word short form.
on entity damage:
if event.cause is "FALL":
if player has permission "hyperscript.nofall":
cancel event
send action bar "&aFall damage negated!" to victim
on player chat:
if message contains "badword":
cancel event
send "&cPlease keep chat friendly!" to player
| Short form | Placeholder | Events | Meaning |
|---|---|---|---|
attacker | %event.attacker% | entity damage | Who dealt the damage: a player's name or a mob type; for a projectile, whoever shot it; unset if nobody did |
victim | %event.victim% | entity damage | Who was hurt: a player's name or a mob type |
damage | %event.damage% | entity damage | Damage taken after armour; 2 is one heart |
cause | %event.cause% | entity damage | FALL, FIRE, ENTITY_ATTACK, PROJECTILE and so on |
cause | %event.cause% | player death | What killed the player, in the same words |
message | %event.message% | player chat | The chat message |
message | %event.message% | player death | The death message everyone will see |
message | %event.message% | player command | The whole line as typed, e.g. /home set base |
command | %event.command% | player command | The command without the slash, in lower case: home |
amount | %event.amount% | item pickup, item drop | How many items are in the stack |
%event.gamemode% | gamemode change | The mode being changed to | |
%event.effect% | effect gained, effect ended | The potion effect | |
%event.advancement% | advancement | The advancement's id | |
%event.weather% | weather change | rain or clear | |
%event.inventory% | inventory open, inventory close | The kind of container | |
%event.region% | region enter, region leave | The name of the region | |
%event.opponent% | combat start | The name of the other player; unset when a script started the fight | |
%event.streak% | kill streak | How many players they have killed in a row since they last died | |
%event.word% | blocked word | The blocked word that was found in what the player wrote | |
%event.lines% | sign change | A list of the sign's lines, top to bottom | |
%event.clicked% | entity click | A player's name if a player was clicked, otherwise the entity type | |
%event.level%, %event.old_level% | level up | The level reached, and the one before | |
%event.name% | player login | The name of whoever is logging in | |
%event.uuid% | player login | Their account id | |
%event.address% | player login, server ping | The address they are connecting from | |
%event.from% | world change | The name of the world the player left | |
block | %event.block% | block break, right click | The block type, e.g. diamond_ore |
%event.power% | redstone | The power the block has now, 0 to 15 | |
entity | %event.entity% | entity damage, entity death, mob spawn | The entity type, e.g. zombie |
killer | %event.killer% | entity death, player death | Name of the player who made the kill |
reason | %event.reason% | mob spawn | NATURAL, SPAWNER, SPAWNER_EGG, BREEDING, CUSTOM and so on |
slot | %event.slot% | inventory click | The slot clicked, counting from 1 like the slots of open gui |
item | %event.item% | inventory click, right click, item pickup, item drop | The item type clicked, held, picked up or dropped |
%event.click_type% | inventory click | LEFT, RIGHT, SHIFT_LEFT, MIDDLE, DROP and so on | |
%event.recipients% | player chat | A list of the names of the players who will see the message | |
%event.drops% | block break, entity death | A list of the items that are about to drop | |
%event.location% | block break, right click, entity damage, mob spawn, player jump | Where it happened, as a location; also written event's location |
cause is "fall" and cause is "FALL" are the same.item on its own is the event's item. Followed by a number it is still the list lookup item 2 of <list>.player in on entity damage is the player who was hurt, or, if the victim is not a player, the player who dealt the damage. victim and attacker are always exact.on player death can rewrite or remove the message everyone sees: set death message to "&c%player.name% fell over" and hide death message. on entity death fires for players too, with player being the killer; on player death is the one where player is who died.on player command sees every command before the server does, including ones that do not exist. cancel event stops the command from running, which makes it the way to block commands:on player command:
if command is "plugins" and player does not have permission "server.admin":
cancel event
send "&cThat command is not available."
on region enter and on region leave fire when a player crosses the edge of a region made with create region, on foot or by teleport. Movement is only watched while a loaded script has one of these blocks, and only when a player steps into a different block. Neither can be cancelled; to keep someone out, teleport them back.block, item, entity and cause also work in the newer events: the block placed, the item crafted, eaten or caught, the entity clicked, and why a teleport is happening.on entity damage and on mob spawn fire extremely often. Put the cheapest test first, as the example does, so that most runs end after one line.on player jump works on Spigot and Paper. Cancelling it snaps the player back to where they were; because the jump has already started on their screen, a small hop may be visible.on inventory click fires for every inventory, including the player's own and GUIs opened by scripts. Cancelling it means the click moves nothing.The Docs page of the documentation site lists every event with its values, whether it can be cancelled, a working example, and a box for trying the values out. The same information is published for other tools as events_metadata.json.
on entity damage:Triggers when any entity takes damage from any source. This fires very often on a busy server, so keep the block short and test the cause or victim first.
on hit:player is: The victim if a player was hurt; otherwise the attacker if a player dealt the damage; otherwise nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.attacker% | attacker | text | Who dealt the damage: a player's name or a mob type such as zombie. For an arrow or other projectile this is whoever shot it. Unset for damage with no attacker, such as falling |
%event.victim% | victim | text | Who was hurt: a player's name or a mob type |
%event.damage% | damage | number | Damage actually taken, after armour and effects; 2 is one heart |
%event.cause% | cause | text | Why: FALL, FIRE, ENTITY_ATTACK, PROJECTILE, DROWNING, VOID and so on |
%event.entity% | entity | text | The victim's entity type, e.g. player or zombie |
%event.location% | location | Where the victim is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on entity damage:
if event.cause is "FALL":
if player has permission "hyperscript.nofall":
cancel event
send action bar "&aFall damage negated!" to victim
on entity damage:
# click a value above
on player jump:Triggers when a player jumps.
player is: The jumping player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%player.world% | text | World the player is in | |
%player.location% | location | Where the player is standing | |
%event.location% | location | Where the jump started | |
x of player's location | number | The x of %player.location%, as a number | |
y of player's location | number | The y of %player.location%, as a number: how high it is | |
z of player's location | number | The z of %player.location%, as a number | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on player jump:
if {%player%.frozen} is true:
cancel event
send action bar "&cYou cannot jump while frozen!" to player
on player jump:
# click a value above
on player chat:Triggers when a player sends a chat message.
player is: The sender| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.message% | message | text | The text of the message |
%event.recipients% | list | Names of the players who will see it |
on player chat:
if message contains "badword":
cancel event
send "&cPlease keep chat friendly!" to player
on player chat:
# click a value above
on block break:Triggers when a player breaks a block.
player is: The player breaking the block| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.block% | block | text | The block type, e.g. diamond_ore |
%event.location% | location | Where the block is | |
%event.drops% | list | The items the block will drop with the tool in the player's hand | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on block break:
if block is "diamond_ore":
broadcast "&b%player.name% found diamonds! Drops: %event.drops%"
on block break:
# click a value above
on mob spawn:Triggers when a mob or other living creature spawns. This fires very often; test the reason or entity first.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.entity% | entity | text | The type of creature, e.g. zombie |
%event.reason% | reason | text | Why it spawned: NATURAL, SPAWNER, SPAWNER_EGG, BREEDING, CUSTOM and so on |
%event.location% | location | Where it spawns | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on mob spawn:
if entity is "phantom" and reason is "NATURAL":
cancel event
on mob spawn:
# click a value above
on inventory click:Triggers when a player clicks in any inventory window, including chests, their own inventory and GUIs opened by scripts.
player is: The player who clicked| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.slot% | slot | number | The slot clicked, counting from 1 at the top left of the window, the same numbering open gui uses. Unset for a click outside the window |
%event.item% | item | text | The type of item in that slot; unset if it is empty |
%event.click_type% | text | How it was clicked: LEFT, RIGHT, SHIFT_LEFT, SHIFT_RIGHT, MIDDLE, DROP and so on |
on inventory click:
if item is "barrier" and event.click_type is "SHIFT_LEFT":
cancel event
send "&cThat item cannot be moved." to player
on inventory click:
# click a value above
on server ping:Triggers when a client refreshes its server list, before anyone has logged in. This is where the MOTD, player counts and icon shown in that list can be changed. It fires very often and off the server thread, so keep the block short.
player is: Nobody: the client has not logged in, so only its address is known| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.address% | text | The IP address of the client asking | |
%server.motd% | text | The MOTD from server.properties | |
%server.online_players% | number | Players online right now | |
%server.max_players% | number | The real player limit |
on server ping:
set motd to "&6My Server &7- &a%server.online_players% online\n&eDouble coins weekend!"
set max players to 100
on server ping:
# click a value above
on left click:Triggers when a player left-clicks air or a block with their main hand.
player is: The player who clicked| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item in the player's hand; unset if empty |
%event.block% | block | text | The block clicked; unset when clicking air |
on left click:
if item is "stick":
send "&7Poke."
on left click:
# click a value above
on player sneak:Triggers when a player starts sneaking.
player is: The player sneaking| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on player sneak:
send action bar "&7Sneaking..." to player
on player sneak:
# click a value above
on player sprint:Triggers when a player starts sprinting.
player is: The player sprinting| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on player sprint:
add 1 to {%player%.sprints}
on player sprint:
# click a value above
on player swim:Triggers when a player starts swimming.
player is: The player swimming| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on player swim:
apply night vision to player for 30 seconds
on player swim:
# click a value above
on flight toggle:Triggers when a player starts or stops flying.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on flight toggle:
if player does not have permission "fly.use":
cancel event
on flight toggle:
# click a value above
on hand swap:Triggers when a player swaps the items in their two hands.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on hand swap:
cancel event
send "&7Hands are locked here."
on hand swap:
# click a value above
on slot change:Triggers when a player selects another hotbar slot.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.slot% | slot | number | The hotbar slot now selected, 1 to 9 |
%event.item% | item | text | The type of item in that slot; unset if empty |
on slot change:
if item is "compass":
send action bar "&bRight-click to open the menu" to player
on slot change:
# click a value above
on item break:Triggers when a tool or piece of armour wears out and breaks.
player is: The player whose item broke| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item that broke |
on item break:
send "&cYour %event.item% broke!"
on item break:
# click a value above
on book edit:Triggers when a player writes in or signs a book.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on book edit:
log "%player.name% edited a book"
on book edit:
# click a value above
on gamemode change:Triggers when a player's game mode is about to change.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.gamemode% | text | The mode being changed to: survival, creative, adventure or spectator |
on gamemode change:
if event.gamemode is "creative" and player does not have permission "build.creative":
cancel event
on gamemode change:
# click a value above
on hunger change:Triggers when a player's hunger bar changes.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.amount% | amount | number | The new hunger level, 0 to 20 |
on hunger change:
if region at player's location contains "spawn":
cancel event
on hunger change:
# click a value above
on player heal:Triggers when a player regains health.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.amount% | amount | number | How much health is regained; 2 is one heart |
%event.reason% | reason | text | SATIATED, REGEN, MAGIC, EATING and so on |
on player heal:
if {%player%.in_combat}:
cancel event
on player heal:
# click a value above
on experience gain:Triggers when a player gains experience points.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.amount% | amount | number | How many points were gained |
on experience gain:
add amount to {%player%.total_xp}
on experience gain:
# click a value above
on effect gained:Triggers when a player gets a potion effect.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.effect% | text | The effect, e.g. speed or poison |
on effect gained:
if event.effect is "poison" and player has permission "vip.immune":
cancel event
on effect gained:
# click a value above
on effect ended:Triggers when a potion effect on a player ends or is removed.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.effect% | text | The effect that ended |
on effect ended:
send action bar "&7%event.effect% wore off" to player
on effect ended:
# click a value above
on player kick:Triggers when a player is about to be kicked.
player is: The player being kicked| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.reason% | reason | text | The reason given |
on player kick:
log "%player.name% was kicked: %event.reason%"
on player kick:
# click a value above
on advancement:Triggers when a player completes an advancement. Unlocking a recipe does not count.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.advancement% | text | The advancement's id, e.g. story/mine_diamond |
on advancement:
if event.advancement is "story/mine_diamond":
broadcast "&b%player.name% found diamonds!"
on advancement:
# click a value above
on player kill:Triggers when one player kills another.
player is: The player who made the kill| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.victim% | victim | text | The name of the player who died |
%event.location% | location | Where the victim died | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on player kill:
add 1 to {%player%.kills}
add 1 to {%victim%.deaths}
send "&aYou defeated &f%event.victim%"
on player kill:
# click a value above
on projectile shoot:Triggers when a player shoots or throws something: an arrow, a snowball, a trident.
player is: The player who shot| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | What was shot, e.g. arrow or snowball |
on projectile shoot:
if entity is "ender_pearl" and {%player%.in_combat}:
cancel event
on projectile shoot:
# click a value above
on projectile hit:Triggers when something a player shot lands, on a block or on a creature.
player is: The player who shot it| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | What was shot, e.g. arrow |
%event.victim% | victim | text | Who or what was hit: a player's name or a mob type; unset for a block |
%event.location% | location | Where it landed | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on projectile hit:
if entity is "snowball" and victim is set:
send "&bSplat! You hit %event.victim%"
on projectile hit:
# click a value above
on totem use:Triggers when a totem of undying saves a player.
player is: The player who was saved| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on totem use:
broadcast "&6%player.name% cheated death!"
on totem use:
# click a value above
on block burn:Triggers when fire destroys a block.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The block being burnt |
%event.location% | location | Where the block is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on block burn:
if region at event's location contains "spawn":
cancel event
on block burn:
# click a value above
on explosion:Triggers when something explodes: a creeper, TNT, a bed in the Nether.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.entity% | entity | text | What exploded, e.g. creeper or primed_tnt |
%event.location% | location | Where it exploded | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on explosion:
if entity is "creeper":
cancel event
on explosion:
# click a value above
on leaves decay:Triggers when leaves disappear because their tree is gone.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The kind of leaves |
%event.location% | location | Where they are | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on leaves decay:
if region at event's location contains "park":
cancel event
on leaves decay:
# click a value above
on redstone:Triggers when the redstone power of a block changes: a lamp, a wire, a repeater, a pressure plate.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The block whose power changed |
%event.power% | number | The power it has now, 0 to 15 | |
%event.location% | location | Where the block is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on redstone:
if event.block is "redstone_lamp":
if event.power > 0:
log "A lamp was lit at %event's location%"
on redstone:
# click a value above
on piston extend:Triggers when a piston pushes out.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The piston: piston or sticky_piston |
%event.location% | location | Where the piston is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on piston extend:
if region at event's location contains "spawn":
cancel event
on piston extend:
# click a value above
on piston retract:Triggers when a piston pulls back.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The piston: piston or sticky_piston |
%event.location% | location | Where the piston is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on piston retract:
if region at event's location contains "spawn":
cancel event
on piston retract:
# click a value above
on dispense:Triggers when a dispenser or dropper puts out an item.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The block: dispenser or dropper |
%event.item% | item | text | What it puts out |
%event.location% | location | Where the block is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on dispense:
if event.item is "tnt":
cancel event
on dispense:
# click a value above
on hopper move:Triggers when a hopper, dropper or other block moves an item from one container to another.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.item% | item | text | The item that is moved |
%event.location% | location | Where it is going | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on hopper move:
if event.item is "diamond":
cancel event
on hopper move:
# click a value above
on crop grow:Triggers when a crop or plant grows a stage.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.block% | block | text | The plant, e.g. wheat |
%event.location% | location | Where it is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on crop grow:
if {season} is "winter":
cancel event
on crop grow:
# click a value above
on bucket fill:Triggers when a player scoops something up with a bucket.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The bucket being used |
on bucket fill:
if region at player's location contains "spawn":
cancel event
on bucket fill:
# click a value above
on bucket empty:Triggers when a player pours a bucket out.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The bucket being emptied, e.g. lava_bucket |
on bucket empty:
if item is "lava_bucket" and player does not have permission "build.lava":
cancel event
send "&cLava is not allowed."
on bucket empty:
# click a value above
on weather change:Triggers when rain starts or stops in a world.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.weather% | text | What it is changing to: rain or clear |
on weather change:
if event.weather is "rain":
cancel event
on weather change:
# click a value above
on entity tame:Triggers when a player tames an animal.
player is: The player who tamed it| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | The animal, e.g. wolf |
on entity tame:
send "&aYou tamed a %event.entity%!"
on entity tame:
# click a value above
on entity breed:Triggers when two animals have a baby.
player is: The player who fed them, if a player did| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.entity% | entity | text | The kind of baby, e.g. cow |
on entity breed:
if player is set:
add 1 to {%player%.animals_bred}
on entity breed:
# click a value above
on shear:Triggers when a player shears a sheep or another shearable creature.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | What was sheared, e.g. sheep |
on shear:
add 1 to {%player%.sheep_sheared}
on shear:
# click a value above
on mob target:Triggers when a mob picks a player as its target.
player is: The player being targeted| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | The mob, e.g. zombie |
on mob target:
if player is vanished:
cancel event
on mob target:
# click a value above
on player move:Triggers when a player walks, falls or is pushed into another block. Turning the head or shuffling inside one block does not count. It still runs very often, so keep its block short.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on player move:
if block at (location below player's location) is "magma_block":
send action bar "&cHot!" to player
on player move:
# click a value above
on portal use:Triggers when a player is about to go through a nether or end portal.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on portal use:
if {%player%.level} < 10:
cancel event
send "&cReach level 10 before leaving the overworld."
on portal use:
# click a value above
on bed leave:Triggers when a player gets out of a bed.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on bed leave:
send "&eGood morning, %player.name%!"
on bed leave:
# click a value above
on item damage:Triggers when a tool, weapon or piece of armour a player is using loses durability.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on item damage:
if player has permission "tools.unbreaking":
cancel event
on item damage:
# click a value above
on harvest:Triggers when a player picks something from a block without breaking it, such as berries from a sweet berry bush.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on harvest:
add 1 to {%player%.harvests}
on harvest:
# click a value above
on glide toggle:Triggers when a player starts or stops gliding with an elytra.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on glide toggle:
if region at player's location contains "spawn":
cancel event
on glide toggle:
# click a value above
on entity mount:Triggers when a player gets onto a horse, pig, strider or any other creature or vehicle.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on entity mount:
send action bar "&7Sneak to get off" to player
on entity mount:
# click a value above
on entity dismount:Triggers when a player gets off whatever they were riding.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on entity dismount:
add 1 to {%player%.rides}
on entity dismount:
# click a value above
on vehicle enter:Triggers when a player gets into a boat, minecart or other vehicle.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | The vehicle, e.g. boat or minecart |
on vehicle enter:
send action bar "&7Hold on tight" to player
on vehicle enter:
# click a value above
on vehicle exit:Triggers when a player gets out of a vehicle.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | The vehicle |
on vehicle exit:
log "%player.name% left a %event.entity%"
on vehicle exit:
# click a value above
on inventory open:Triggers when a player opens a chest, furnace or any other container.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.inventory% | text | The kind of container: chest, furnace, anvil and so on | |
%event.location% | location | Where the container stands; unset for one that stands nowhere, such as an ender chest or a menu a script opened | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on inventory open:
if event.inventory is "ender_chest" and {%player%.in_combat}:
cancel event
on inventory open:
# click a value above
on inventory close:Triggers when a player closes a container or their own inventory.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.inventory% | text | The kind of container that was open |
on inventory close:
delete {%player%.shop_page}
on inventory close:
# click a value above
on enchant item:Triggers when a player enchants an item at an enchanting table.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The item being enchanted |
%event.level% | number | How many levels it costs |
on enchant item:
add 1 to {%player%.enchants}
on enchant item:
# click a value above
on furnace smelt:Triggers when a furnace finishes smelting one item.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.item% | item | text | What comes out, e.g. iron_ingot |
%event.location% | location | Where the furnace is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on furnace smelt:
add 1 to {smelted.%event.item%}
on furnace smelt:
# click a value above
on console command:Triggers when a command is run from the console.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.command% | command | text | The command without the slash, in lower case |
%event.message% | message | text | The whole line |
on console command:
if command is "stop":
broadcast "&cThe server is shutting down."
on console command:
# click a value above
on shield block:Triggers when a player's raised shield takes a blow completely.
player is: The player holding the shield| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.attacker% | attacker | text | Who struck: a player's name or a mob type |
on shield block:
play sound "item.shield.block" with pitch 0.8 and volume 1.0 at player's location
add 1 to {%player%.blocks_made}
on shield block:
# click a value above
on anvil use:Triggers when a player takes the finished item out of an anvil.
player is: The player using the anvil| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The item being taken out |
on anvil use:
if item is "name_tag" and player does not have permission "anvil.nametags":
cancel event
send "&cYou cannot rename name tags here."
on anvil use:
# click a value above
on villager trade:Triggers when a player takes the goods out of a trade with a villager or wandering trader.
player is: The player trading| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | What the player is buying |
on villager trade:
add 1 to {%player%.trades}
if item is "emerald":
send action bar "&aA fine deal" to player
on villager trade:
# click a value above
on first join:Triggers when someone joins who has never played on the server before. 'on player join' runs for them as well.
player is: The new player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%player.world% | text | World the player is in | |
%player.location% | location | Where the player is standing | |
x of player's location | number | The x of %player.location%, as a number | |
y of player's location | number | The y of %player.location%, as a number: how high it is | |
z of player's location | number | The z of %player.location%, as a number |
on first join:
give 16 bread to player
broadcast "&6Welcome &e%player.name% &6to the server!"
on first join:
# click a value above
on player join:Triggers when a player joins the server.
player is: The player who joined| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%player.world% | text | World the player is in | |
%player.location% | location | Where the player is standing | |
x of player's location | number | The x of %player.location%, as a number | |
y of player's location | number | The y of %player.location%, as a number: how high it is | |
z of player's location | number | The z of %player.location%, as a number |
on player join:
send "&aWelcome, %player.name%!" to player
on player join:
# click a value above
on player quit:Triggers when a player leaves the server.
player is: The player who left| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on player quit:
log "%player.name% left"
on player quit:
# click a value above
on block place:Triggers when a player places a block.
player is: The player who placed it| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.block% | block | text | The block type placed, e.g. tnt |
%event.location% | location | Where the block was placed | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on block place:
if block is "tnt" and player does not have permission "build.tnt":
cancel event
send "&cTNT is not allowed here."
on block place:
# click a value above
on sign change:Triggers when a player finishes writing on a sign.
player is: The player who wrote the sign| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.lines% | list | The lines of text, top to bottom | |
%event.block% | block | text | The kind of sign, e.g. oak_sign |
%event.location% | location | Where the sign is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on sign change:
if item 1 of event.lines is "[Shop]":
send "&aShop sign created."
on sign change:
# click a value above
on player teleport:Triggers when a player is about to be teleported, by a command, a plugin, an ender pearl or a portal.
player is: The player being teleported| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.cause% | cause | text | COMMAND, PLUGIN, ENDER_PEARL, NETHER_PORTAL and so on |
%event.location% | location | Where the player is going | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on player teleport:
if cause is "ENDER_PEARL" and region at event's location contains "spawn":
cancel event
send "&cNo pearling into spawn."
on player teleport:
# click a value above
on entity click:Triggers when a player right-clicks a mob, an animal, another player or any other entity.
player is: The player who clicked| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.entity% | entity | text | The type clicked, e.g. villager or player |
%event.clicked% | text | A player's name if a player was clicked, otherwise the type | |
%event.location% | location | Where the clicked entity is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on entity click:
if entity is "player":
send "&7That is &f%event.clicked%&7."
on entity click:
# click a value above
on craft:Triggers when a player takes the result out of a crafting grid.
player is: The player crafting| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The item being crafted, e.g. diamond_sword |
%event.amount% | amount | number | How many one craft makes |
on craft:
if item is "diamond_sword" and level of player < 10:
cancel event
send "&cYou need level 10 to craft that."
on craft:
# click a value above
on consume:Triggers when a player finishes eating or drinking something.
player is: The player eating or drinking| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | What was eaten or drunk, e.g. golden_apple |
on consume:
if item is "golden_apple":
apply speed 2 to player for 10 seconds
on consume:
# click a value above
on fish:Triggers when a player reels in a catch.
player is: The player fishing| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | What was caught, e.g. cod |
%event.amount% | amount | number | How many |
on fish:
add 1 to {%player%.fish_caught}
send action bar "&bCatch #%{%player%.fish_caught}%: %event.item%" to player
on fish:
# click a value above
on level up:Triggers when a player's experience level goes up.
player is: The player who levelled up| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.level% | number | The level just reached | |
%event.old_level% | number | The level before |
on level up:
if event.level % 10 == 0:
broadcast "&6%player.name% reached level %event.level%!"
on level up:
# click a value above
on bed enter:Triggers when a player gets into a bed.
player is: The player going to bed| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the bed is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on bed enter:
set {%player%.bed} to event's location
send "&7Sleep well."
on bed enter:
# click a value above
on combat start:Triggers when a player gets into a fight: they hit another player or were hit by one, or a script put them in combat. Not again for every hit while the fight lasts.
player is: The player who is now in combat| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.opponent% | text | The name of the other player; unset when a script started it |
on combat start:
send action bar "&cIn combat" to player while player is in combat
on combat start:
# click a value above
on combat end:Triggers when a player's fight is over: nobody has hit them, and they have hit nobody, for the time 'combat-time' in config.yml gives (15 seconds unless changed).
player is: The player who is out of combat again| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on combat end:
send "&aYou are out of combat."
on combat end:
# click a value above
on afk:Triggers when a player has done nothing for the time 'afk-time' in config.yml gives (5 minutes unless changed): not moved, looked around, clicked, chatted or run a command.
player is: The player who is away| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on afk:
broadcast "&7%player.name% is away."
on afk:
# click a value above
on afk return:Triggers when a player who was away does something again.
player is: The player who is back| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on afk return:
broadcast "&7%player.name% is back."
on afk return:
# click a value above
on blocked word:Triggers when a player writes a word in chat that was blocked with 'block word'. The message has been starred or kept back by then, as 'word-filter' in config.yml says.
player is: The player who wrote it| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.word% | text | The blocked word that was found | |
%event.message% | text | What the player wrote, as they wrote it |
on blocked word:
add 1 to {%player%.warnings}
if {%player%.warnings} >= 3:
mute player for 10 minutes because "language"
on blocked word:
# click a value above
on brew:Triggers when a brewing stand finishes brewing. There is no player: it is the stand that brews.
player is: Nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.location% | location | Where the brewing stand is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on brew:
spawn particle "witch" count 20 at event.location
on brew:
# click a value above
on kill streak:Triggers each time a player kills another player, with how many they have killed in a row since they last died.
player is: The player who made the kill| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.streak% | number | How many kills in a row this is: 1 for the first | |
%event.opponent% | text | The name of the player who was killed |
on kill streak:
if event.streak is 5:
broadcast "&6%player.name% is on a killing spree!"
on kill streak:
# click a value above
on region enter:Triggers when a player walks, falls or teleports into a region made with 'create region'.
player is: The player who entered| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.region% | text | The name of the region entered | |
%event.location% | location | Where the player now is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on region enter:
if event.region is "spawn":
send title "&aSpawn" with subtitle "&7You are safe here" to player
on region enter:
# click a value above
on region leave:Triggers when a player leaves a region made with 'create region'.
player is: The player who left| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.region% | text | The name of the region left | |
%event.location% | location | Where the player now is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on region leave:
if event.region is "spawn":
send action bar "&cYou left the safe zone" to player
on region leave:
# click a value above
on player login:Triggers while someone is logging in, before they are in the game. 'refuse login because <text>' turns them away with that message.
player is: Nobody yet: 'player' is unset, but {%player%.<name>} is already the variables of whoever is logging in| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.name% | text | The name of the player logging in | |
%event.uuid% | text | Their account id | |
%event.address% | text | The address they are connecting from |
on player login:
if {%player%.muted_until} > server.time:
set {_left} to duration({%player%.muted_until} - server.time)
refuse login because "&cYou may join again in %{_left}%."
on player login:
# click a value above
on player death:Triggers when a player dies. The death message can be rewritten with 'set death message to' or removed with 'hide death message'.
player is: The player who died| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.message% | message | text | The death message everyone will see |
%event.killer% | killer | text | Name of the player who made the kill; unset if none |
%event.cause% | cause | text | What killed the player: FALL, LAVA, ENTITY_ATTACK and so on |
%event.location% | location | Where the player died | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on player death:
set {%player%.death_place} to event's location
if killer is set:
set death message to "&c%player.name% &7was defeated by &c%event.killer%"
on player death:
# click a value above
on player respawn:Triggers when a player comes back to life after dying.
player is: The player who respawned| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.location% | location | Where the player is about to appear | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on player respawn:
wait 1 tick
give player 1 bread
send "&7Here is something to eat."
on player respawn:
# click a value above
on item pickup:Triggers when a player picks an item up off the ground.
player is: The player picking the item up| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item, e.g. diamond |
%event.amount% | amount | number | How many items are in the stack |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on item pickup:
if item is "diamond":
add amount to {%player%.diamonds_found}
on item pickup:
# click a value above
on item drop:Triggers when a player drops an item out of their inventory.
player is: The player dropping the item| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item, e.g. diamond |
%event.amount% | amount | number | How many items are in the stack |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on item drop:
if item is "compass":
cancel event
send "&cYou cannot drop your compass."
on item drop:
# click a value above
on world change:Triggers when a player has arrived in another world, through a portal or a teleport.
player is: The player who changed world| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%player.world% | text | World the player is in | |
%event.from% | text | The name of the world the player left | |
%event.location% | location | Where the player is now | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on world change:
send "&7You left &f%event.from% &7for &f%player.world%"
on world change:
# click a value above
on player command:Triggers when a player types any command, before the server runs it. Cancelling it stops the command.
player is: The player who typed the command| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.command% | command | text | The command without the slash, in lower case: home |
%event.message% | message | text | The whole line as typed: /home set base |
%event.location% | location | Where the player is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on player command:
if command is "plugins" and player does not have permission "server.admin":
cancel event
send "&cThat command is not available."
on player command:
# click a value above
on entity death:Triggers when any living entity dies.
player is: The killer, if a player made the kill; otherwise nobody| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.entity% | entity | text | The type of entity that died |
%event.killer% | killer | text | Name of the player who made the kill; unset if none |
on entity death:
if killer is set:
send "&6You slew a %event.entity%" to player
on entity death:
# click a value above
on right click:Triggers when a player right-clicks air or a block, with either hand. Not when they are looking at a creature or another player that is in reach: that is 'on entity click'.
player is: The player who clicked| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.item% | item | text | The type of item in the player's hand; unset if empty |
%event.block% | block | text | The block clicked; unset when clicking air |
%event.location% | location | Where the clicked block is; unset when clicking air | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
on right click:
if item is "compass":
send "&bYou are in %player.world%" to player
on right click:
# click a value above
on resource pack accept:Triggers when a player agrees to download a resource pack.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on resource pack accept:
send action bar "&aDownloading server resource pack..." to player
on resource pack accept:
# click a value above
on resource pack decline:Triggers when a player refuses a resource pack.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on resource pack decline:
send "&cSome custom items may look wrong without the pack." to player
on resource pack decline:
# click a value above
on resource pack successfully loaded:Triggers when a player's game has finished applying a resource pack.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on resource pack successfully loaded:
send "&aResource pack loaded!" to player
on resource pack successfully loaded:
# click a value above
on resource pack failed:Triggers when a resource pack could not be downloaded or applied.
player is: The player| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
on resource pack failed:
send "&cThe resource pack failed to load." to player
on resource pack failed:
# click a value above
every <duration>:Once per interval, with no player (like a console command)
every 5 minutes:
broadcast "&7Remember to vote!"Try itevery <duration> for all players:Once per interval for each online player, as that player
every 1 second for all players:
set line 1 of player's scoreboard to "&7Coins: &a%{%player%.coins}%"Try itevery day at <hh:mm>:since 1.5.8Once a day at that time, by the server's clock
every day at 18:00:
broadcast "&6The evening event starts now!"Try itevery monday at <hh:mm>:since 1.5.8Once a week; any weekday name works
every monday at 00:00:
delete {weekly_winner}Try itevery runs a block repeatedly for as long as the script is loaded.
every 5 minutes:
broadcast "&7Remember to vote!"
every 1 second for all players:
set line 1 of player's scoreboard to "&7Coins: &a%{%player%.coins}%"
| Form | Runs |
|---|---|
every <duration>: | Once per interval, with no player (like a console command) |
every <duration> for all players: | Once per interval for each online player, as that player |
every day at <hh:mm>: | Once a day at that time, by the server's clock |
every monday at <hh:mm>: | Once a week; any weekday name works |
1 tick (a twentieth of a second).async: for anything heavy.every day at 18:00:, every friday at 20:30:. They do not drift with restarts the way a every 24 hours: timer does. A time that passes while the server is off is skipped, not caught up, and for all players may be added as with any timer.every day at 00:00:
delete {daily_reward_claimed}
broadcast "&6Daily rewards are available again!"
set <variable> to <value>Assign
set tool of player to 1 stone swordTry itset <variable>, <variable> to <value>since 1.7.58The same value for several: set {_a}, {_b} to 0
command /resetgame:
trigger:
set {game.red}, {game.blue} to 0
send "&7Scores reset."Try itset <variable> to <value> for <duration>since 1.7.58Assign for a time; afterwards it is unset again by itself, also across a restart. For saved variables
command /boost:
trigger:
set {%player%.boost} to 2 for 10 minutes
send "&aDouble coins for ten minutes."Try itadd <value> to <variable>Increase a number (or append to a list)
add 100 to {%player%.coins}Try itadd <n>% to <variable> / subtract <n>% from <variable>since 1.7.58Change a number by a share of itself: add 10% to {_price} makes 100 into 110
command /sale:
trigger:
set {_price} to 200
subtract 25% from {_price}
send "&eToday only: &f%{_price}% coins"Try itsubtract <value> from <variable>Decrease a number
subtract 1 from {_n}Try itmultiply <variable> by <value> / divide <variable> by <value>since 1.7.57Change a number in place: multiply {_price} by 2. An unset variable counts as 0; dividing by 0 is refused
command /double:
trigger:
multiply {%player%.coins} by 2
send "&aDoubled: &f%{%player%.coins}%"Try itappend <value> to <variable>Add to a list
append {_name} to {_picked}Try itremove <value> from <variable>Remove from a list
remove player.name from {winners}Try itremove <item> from <who>since 1.5.6Take items out of an inventory. The player may be in a variable: remove 5 diamond from {_target}
if player has 5 diamond:
remove 5 diamond from playerTry itincrease <variable> by <n> / decrease <variable> by <n>since 1.7.1The same as add and subtract, in other words
increase {%player%.coins} by 10
decrease {%player%.lives} by 1Try ittoggle <variable>since 1.7.1Flip between true and false; an unset variable becomes true
toggle {%player%.pvp_on}
send "&7PvP: %{%player%.pvp_on}%"Try itswap <variable> and <variable>since 1.7.1Exchange two values
swap {team.red.score} and {team.blue.score}Try itdefault <variable> to <value>since 1.7.1Set it only if it has no value yet
on load:
default {motd} to "&aWelcome!"Try itdelete <variable>Unset; several at once with commas: delete {_a}, {_b}
delete boots of playerTry itdelete <variable> for all playerssince 1.7.61Unset a variable each player has, for everybody who has it, online or not: delete {coins} for all players. For the end of a season
command /newseason:
permission: "staff.season"
trigger:
delete {coins} for all players
send "&eA new season begins." to all playersTry itset <variable> to <value> for all playerssince 1.7.61Give it that value for everybody who has ever played: set {coins} to 100 for all players
command /gift:
permission: "staff.gift"
trigger:
set {tokens} to 5 for all playersTry itdelete all variables of <who>since 1.7.61Everything the scripts keep for one player. What HyperScript itself keeps for them, such as permissions it gave and saved inventories, stays
command /wipe <who:offline player>:
permission: "staff.wipe"
trigger:
delete all variables of arg.1
send "&7Everything of %arg.1% is gone."Try itsend <text>Message whoever triggered the script (player or console)
send "&7You are not wearing a helmet."Try itsend <text> to playersince 1.5.6The same
send "&aSaved." to playerTry itsend <text> to <player name>Message a named online player
send "&e%player.name% says hi!" to arg.1Try ittell <who> <text>since 1.7.67Another way to say send <text> to <who>: tell player "Hello". message <who> <text> is the same
command /hi <target:player>:
trigger:
tell arg.1 "&e%player.name% says hi!"
tell player "&7Sent."Try itsend <text> to all playerssince 1.5.6Message every online player
send "&6The event starts in one minute!" to all playersTry itsend <text> to all players with permission <node>since 1.7.57Only those who have it. Also in world <name>, within <n> blocks of <location> and where <condition> with loop-player as each of them. These work wherever all players does
command /staffchat <words:text>:
trigger:
send "&d[Staff] %player.name%: &f%arg.1%" to all players with permission "staff.chat"Try itsend <text> with click command <text>since 1.5.7A message that runs a command when clicked; see below
send "&a[Go home]" with click command "/home"Try itsend <text> with hover <text>since 1.5.7A message that shows more when the mouse is over it
send "&e[?]" with hover "&7Hover text can explain things."Try itsend <text> with click copy <text>since 1.7.60A message that puts the text on the clipboard of whoever clicks it: an address, a code
command /ip:
trigger:
send "&b[Click to copy the address]" with click copy "play.example.net"Try itsend <list> to <who> in pages of <n>since 1.7.61A long list a page at a time, with arrows under it to click for the page before and after. titled <text> puts a heading over it, with the page beside it: send {_warps} to player in pages of 8 titled "&6Warps"
command /warps:
trigger:
set {_names} to keys of {warp}
send {_names} to player in pages of 8 titled "&6Warps"Try itset chat slow mode to <duration>since 1.7.61So long between one chat message of a player and their next; who writes sooner is told how long is left. set chat slow mode off ends it. It is kept across restarts, and players with the permission hyperscript.chat.bypass are not slowed
command /slow <time:duration>:
permission: "staff.slow"
trigger:
set chat slow mode to arg.1
send "&eChat is slowed down." to all playersTry itsend <text> to <who> when they joinsince 1.7.60Said now if they are online; if not, kept and said the next time they join. For somebody who has played here before. The last 50 are kept for each player
command /thank <who:offline player>:
trigger:
send "&a%player.name% says thank you!" to arg.1 when they join
send "&7They will be told."Try itbroadcast <text>Message every online player and the console. announce <text> is the same
broadcast "&7Remember to vote!"Try itlog <text>Write to the server console
log "%player.name% left"Try itexecute console command <text>Run a command as the console
execute console command "stop"Try itexecute player command <text>Run a command as the player
execute player command "spawn"Try itgive <who> <item> or give <item> to <who>since 1.3.0Put an item in an inventory; whatever does not fit is dropped at their feet
give player 3 diamond
give 16 bread to playerTry itgive <item> to <who> [or drop]since 1.7.45The same: or drop only says out loud what happens when the inventory is full
give 16 bread to playerTry itset helmet of <who> to <item>since 1.5.7Put an item on a player or in their hand; see below
set helmet of player to 1 diamond helmet enchanted with protection 4Try itset name of <place> to <text>since 1.7.61Rename the item that is there, without making a new one: set name of tool of player to "&6Excalibur". The place is what an item can be read from: tool of player, helmet of player, inventory slot 3 of player
command /rename <words:text>:
trigger:
set name of tool of player to arg.1
send "&aRenamed."Try itset lore of <place> to <text>, <text>since 1.7.61Its description, a line for each text; a list gives as many lines as it has elements
command /describe:
trigger:
set lore of tool of player to "&7Forged in the deep", "&7Owner: %player.name%"Try itadd <text> to lore of <place>since 1.7.61One more line under what it has
command /bind:
trigger:
add "&cSoulbound" to lore of tool of playerTry itremove line <n> of lore of <place>since 1.7.61Take one line out, counting from 1
command /unline:
trigger:
remove line 1 of lore of tool of playerTry itdelete lore of <place>since 1.7.61Take all of it away
command /plain:
trigger:
delete lore of tool of playerTry itclear inventory of <who>since 1.5.7Empty an inventory
clear inventory of playerTry itsave inventory of <who> as <name>since 1.7.15Put a copy of everything they carry away under a name: the inventory, the armour and the off hand. Saving again under the same name replaces it
command /arena:
trigger:
save inventory of player as "before-arena"
clear inventory of player
give player 1 iron sword
send "&7Your things are safe. &f/leave &7gives them back."Try itrestore inventory of <who> from <name>since 1.7.15Give it back, in place of what they carry now. The copy is kept until it is deleted
command /leave:
trigger:
if player has saved inventory "before-arena":
restore inventory of player from "before-arena"
delete saved inventory "before-arena"
send "&aYour things are back."Try itsave state of <who> as <name>since 1.7.59Put away everything a game changes about a player, under a name: what they carry, health, food, experience, game mode and where they stand
command /joinarena:
trigger:
save state of player as "before-arena"
clear inventory of player
give 1 iron sword to playerTry itrestore state of <who> from <name>since 1.7.59Give all of it back and take them to where they stood. The copy is kept, so it can be given back again
command /leavearena:
trigger:
restore state of player from "before-arena"
send "&7Everything is as it was."Try itdelete saved inventory <name>since 1.7.15Throw the copy away; of <who> for someone else
on player join:
# Left over from a round that never ended properly.
if player has saved inventory "before-arena":
restore inventory of player from "before-arena"
delete saved inventory "before-arena"Try itteleport <who> to <position>since 1.3.0Move a player. tp for short: tp player to {spawn}
teleport player to {_loc}Try itheal, feed, apply <effect>, freeze, vanishsince 1.5.8See Players
heal player
apply regeneration 2 to player for 10 secondsTry itkick, ban, unbansince 1.5.7See Moderation
kick arg.1 because "&cPlease calm down."
ban arg.1 for 7 days because "&cGriefing"Try itadd <who> to team <name>since 1.5.7See Teams
add player to team "red"Try itset block at <position> to <block>since 1.5.5Place or replace a block; see Worlds and regions
set block at {_ahead} to stoneTry itset block at <position> to <block> for <duration>since 1.7.50The same for a time: afterwards what was there is put back. Also put back when the scripts are reloaded or the server stops, so nothing is left behind
set block at player to glass for 5 secondsTry itsummon [<amount>] <entity> [named <text>] at <position>since 1.5.1Spawn mobs or other entities
summon {boss_type} at {arena}Try itsummon ... at <position> with health <n> holding <item> dropping <item>, ...since 1.7.15A creature with details of its own, written after the position in any order; see Entities
command /boss:
permission: boss.spawn
trigger:
summon zombie named "&cThe Warden" at player glowing with health 200 with damage 12 holding diamond sword wearing diamond helmet dropping 5 diamond, 1 nether star
broadcast "&cA boss has appeared!"Try itpermission <who> add <node> / permission <who> remove <node>since 1.5.1Give or take back a permission; see Permissions
permission player add "server.fly"
permission player remove "server.fly"Try itplay sound <name> ...since 1.4.0Play a sound; see Sounds
play sound "block.note_block.pling" for playerTry itsend resource pack <url> ...since 1.4.0Offer a resource pack; see Resource packs
send resource pack "https://example.com/pack.zip" with hash "da39a3ee5e6b4b0d3255bfef95601890afd80709" to playerTry itset time in world ..., set weather in world ...since 1.4.0set time in world "%player.world%" to 1000Try itcreate region ..., delete region ...since 1.4.0create region "spawn_protection" from -20, 0, -20 to 20, 255, 20 in "world"Try itsend get request to ..., send post request to ...since 1.4.0See Web requests
set {_data} to send get request to "https://hyperscript.monoforge.net/api/test"Try itcreate file, set file at, append ... to file at, delete file atsince 1.3.0Work with text files; see Files
create file "proplayer300data.txt" at "plugins/HyperScript/"Try itfire event <name>since 1.7.10Run every on event "<name>": block, in this script and every other. Add with {_a}, {_b} to hand local variables over; the blocks read them under the same names
on player kill:
set {_victim} to victim
fire event "kill" with {_victim}
on event "kill":
add 1 to {%player%.kills}
send "&7You defeated &f%{_victim}%"Try itcancel eventCancel the current event, where the event allows it
cancel eventTry itwait <duration>since 1.5.2Pause this trigger; see Waiting
wait 1 tickTry itbreak / continuesince 1.5.7Leave a loop, or skip to its next round; see Loops
for each {_name} in {queue}:
if {_name} is "Steve":
continue
send "&7Next: %{_name}%"
breakTry itstopEnd the trigger immediately
stopTry itstop if <condition> / stop unless <condition>since 1.7.57End it there if the condition holds, or unless it does. break and continue take the same
command /vip:
trigger:
stop unless player has permission "vip.use"
send "&6Welcome to the lounge."Try itstop with <text> [if <condition>]since 1.7.57Send the text to the player, then end the trigger
command /heal:
trigger:
stop with "&cYou are in a fight." if player is in combat
heal playerTry itreturn [<value>]since 1.5.6Leave a function, handing back a value; see Functions
function double({_n}):
return {_n} * 2Try itreturn if <condition> / return unless <condition>since 1.7.58Leave the function there, handing nothing back, if the condition holds or unless it does
function pay({_who}, {_amount}):
return if {_amount} < 1
add {_amount} to {%{_who}%.coins}Try ithelmet, chestplate, leggings, bootssince 1.5.7The four armour places
set chestplate of player to 1 iron chestplate
delete boots of playerTry ittoolsince 1.5.7What is in the main hand
if tool of player is not set:
send "&7Your hand is empty."Try itoffhandsince 1.5.7What is in the other hand
set offhand of player to 1 shieldTry itinventory slot <n>since 1.5.7One of the 36 inventory slots; 1 to 9 are the hotbar
set inventory slot 1 of player to 1 compass named "&bMenu"Try itwith click command <text>since 1.5.7Runs the command as the player who clicks
send "&a[Accept]" with click command "/accept"Try itwith click suggestion <text>since 1.5.7Puts the text in their chat box without sending it
send "&7[Reply]" with click suggestion "/msg Alex "Try itwith click url <text>since 1.5.7Offers to open the web page
send "&b[Website]" with click url "https://example.com"Try itwith hover <text>since 1.5.7Shown while the mouse is over the message
send "&6Rules" with hover "&7Be kind.\n&7No griefing."Try it| Statement | Effect |
|---|---|
set <variable> to <value> | Assign |
set <variable>, <variable> to <value> | The same value for several: set {_a}, {_b} to 0 |
set <variable> to <value> for <duration> | Assign for a time; afterwards it is unset again by itself, also across a restart. For saved variables |
add <value> to <variable> | Increase a number (or append to a list) |
add <n>% to <variable> / subtract <n>% from <variable> | Change a number by a share of itself: add 10% to {_price} makes 100 into 110 |
subtract <value> from <variable> | Decrease a number |
multiply <variable> by <value> / divide <variable> by <value> | Change a number in place: multiply {_price} by 2. An unset variable counts as 0; dividing by 0 is refused |
append <value> to <variable> | Add to a list |
remove <value> from <variable> | Remove from a list |
remove <item> from <who> | Take items out of an inventory. The player may be in a variable: remove 5 diamond from {_target} |
increase <variable> by <n> / decrease <variable> by <n> | The same as add and subtract, in other words |
toggle <variable> | Flip between true and false; an unset variable becomes true |
swap <variable> and <variable> | Exchange two values |
default <variable> to <value> | Set it only if it has no value yet |
delete <variable> | Unset; several at once with commas: delete {_a}, {_b} |
delete <variable> for all players | Unset a variable each player has, for everybody who has it, online or not: delete {coins} for all players. For the end of a season |
set <variable> to <value> for all players | Give it that value for everybody who has ever played: set {coins} to 100 for all players |
delete all variables of <who> | Everything the scripts keep for one player. What HyperScript itself keeps for them, such as permissions it gave and saved inventories, stays |
send <text> | Message whoever triggered the script (player or console) |
send <text> to player | The same |
send <text> to <player name> | Message a named online player |
tell <who> <text> | Another way to say send <text> to <who>: tell player "Hello". message <who> <text> is the same |
send <text> to all players | Message every online player |
send <text> to all players with permission <node> | Only those who have it. Also in world <name>, within <n> blocks of <location> and where <condition> with loop-player as each of them. These work wherever all players does |
send <text> with click command <text> | A message that runs a command when clicked; see below |
send <text> with hover <text> | A message that shows more when the mouse is over it |
send <text> with click copy <text> | A message that puts the text on the clipboard of whoever clicks it: an address, a code |
send <list> to <who> in pages of <n> | A long list a page at a time, with arrows under it to click for the page before and after. titled <text> puts a heading over it, with the page beside it: send {_warps} to player in pages of 8 titled "&6Warps" |
set chat slow mode to <duration> | So long between one chat message of a player and their next; who writes sooner is told how long is left. set chat slow mode off ends it. It is kept across restarts, and players with the permission hyperscript.chat.bypass are not slowed |
send <text> to <who> when they join | Said now if they are online; if not, kept and said the next time they join. For somebody who has played here before. The last 50 are kept for each player |
broadcast <text> | Message every online player and the console. announce <text> is the same |
log <text> | Write to the server console |
execute console command <text> | Run a command as the console |
execute player command <text> | Run a command as the player |
give <who> <item> or give <item> to <who> | Put an item in an inventory; whatever does not fit is dropped at their feet |
give <item> to <who> [or drop] | The same: or drop only says out loud what happens when the inventory is full |
set helmet of <who> to <item> | Put an item on a player or in their hand; see below |
set name of <place> to <text> | Rename the item that is there, without making a new one: set name of tool of player to "&6Excalibur". The place is what an item can be read from: tool of player, helmet of player, inventory slot 3 of player |
set lore of <place> to <text>, <text> | Its description, a line for each text; a list gives as many lines as it has elements |
add <text> to lore of <place> | One more line under what it has |
remove line <n> of lore of <place> | Take one line out, counting from 1 |
delete lore of <place> | Take all of it away |
clear inventory of <who> | Empty an inventory |
save inventory of <who> as <name> | Put a copy of everything they carry away under a name: the inventory, the armour and the off hand. Saving again under the same name replaces it |
restore inventory of <who> from <name> | Give it back, in place of what they carry now. The copy is kept until it is deleted |
save state of <who> as <name> | Put away everything a game changes about a player, under a name: what they carry, health, food, experience, game mode and where they stand |
restore state of <who> from <name> | Give all of it back and take them to where they stood. The copy is kept, so it can be given back again |
delete saved inventory <name> | Throw the copy away; of <who> for someone else |
teleport <who> to <position> | Move a player. tp for short: tp player to {spawn} |
heal, feed, apply <effect>, freeze, vanish | See Players |
kick, ban, unban | See Moderation |
add <who> to team <name> | See Teams |
set block at <position> to <block> | Place or replace a block; see Worlds and regions |
set block at <position> to <block> for <duration> | The same for a time: afterwards what was there is put back. Also put back when the scripts are reloaded or the server stops, so nothing is left behind |
summon [<amount>] <entity> [named <text>] at <position> | Spawn mobs or other entities |
summon ... at <position> with health <n> holding <item> dropping <item>, ... | A creature with details of its own, written after the position in any order; see Entities |
permission <who> add <node> / permission <who> remove <node> | Give or take back a permission; see Permissions |
play sound <name> ... | Play a sound; see Sounds |
send resource pack <url> ... | Offer a resource pack; see Resource packs |
set time in world ..., set weather in world ... | See Worlds and regions |
create region ..., delete region ... | See Worlds and regions |
send get request to ..., send post request to ... | See Web requests |
create file, set file at, append ... to file at, delete file at | Work with text files; see Files |
fire event <name> | Run every on event "<name>": block, in this script and every other. Add with {_a}, {_b} to hand local variables over; the blocks read them under the same names |
cancel event | Cancel the current event, where the event allows it |
wait <duration> | Pause this trigger; see Waiting |
break / continue | Leave a loop, or skip to its next round; see Loops |
stop | End the trigger immediately |
stop if <condition> / stop unless <condition> | End it there if the condition holds, or unless it does. break and continue take the same |
stop with <text> [if <condition>] | Send the text to the player, then end the trigger |
return [<value>] | Leave a function, handing back a value; see Functions |
return if <condition> / return unless <condition> | Leave the function there, handing nothing back, if the condition holds or unless it does |
Colours. Anywhere text is shown (chat, titles, sidebars, the tab list, item names, holograms) three kinds of colour work:
send "&aGreen, &lbold&r and plain again"
send "&#ff5555Any colour by its hex number, or <#55ffff>written like this"
send "<gradient:#ff5555:#ffaa00:#55ff55>A gradient through three colours</gradient>"
set tab name of player to "<gradient:#4ade9f:#6aa9ff>&l%player.name%</gradient>"
&0 to &9, &a to &f, &l bold, &o italic, &n underline, &m strikethrough, &k scrambled, &r back to normal.&#rrggbb and <#rrggbb> are the same thing: any of sixteen million colours. They need Minecraft 1.16 or newer on the player's side, as every supported server has.<gradient:#from:#to>text</gradient> shades the text letter by letter. Give more colours for more stops. A format code inside, such as &l, applies to the whole gradient after it.uncolored <text> takes all of them out again.send and broadcast translate & colour codes (&a, &l, ...). Inside a string, write \" for a quote, \\ for a backslash and \n for a line break. On-screen text, GUI, world, async and Discord statements are described in their own sections below.
Giving items. give puts an item in a player's inventory; anything that does not fit is dropped at their feet. The recipient may be written first or last:
give player 1 diamond sword named "&6Excalibur" with lore "&7A legendary blade", "&7Forged in fire."
give 16 bread to player
give 3 golden apple to all players
give {%player%.backpack.item} to arg.1
The item is anything described under Value types: plain words, a variable holding an item, or text holding a material name ("%{_material}%"). Up to 2304 can be given at a time. Recipient-first works with player and all players; to give to a named player, put them last after to.
Enchantments. After an item's name and lore come its enchantments and two flags:
give 1 diamond sword named "&6Excalibur" enchanted with sharpness 5, fire aspect 2 unbreakable to player
give player 1 stick glowing
set {reward} to 1 bow enchanted with power 3
enchanted with takes one or more enchantments with a level each (1 if left out). Names are Minecraft's own, written as words (fire aspect, protection) and checked when the script loads. Levels above the normal maximum are allowed. unbreakable makes the item never wear out, and glowing makes it shimmer like an enchanted item without being one. All of it is kept when the item is stored in a variable.
Tags and models. Two more things can follow an item:
give 1 blaze rod named "&dMagic wand" tagged "wand" to player
give 1 paper named "&6Ticket" model 12 to player
on right click:
if tool of player is tagged "wand":
apply levitation 2 to player for 3 seconds
tagged "<name>" puts a hidden label on the item. It stays with the item wherever it goes, players cannot see it, and an anvil cannot fake it, so it is how a script recognises its own items: <item> is tagged "wand", or tag of <item> for the label itself. player has 1 stick tagged "wand" and remove ... from only count items with that tag, whatever name or lore the item has. model <number> sets the custom model number a resource pack uses to draw the item differently.
Wearing and holding. What a player wears and holds can be read and set directly:
set helmet of player to 1 diamond helmet enchanted with protection 4
set tool of player to 1 stone sword
if helmet of player is not set:
send "&7You are not wearing a helmet."
delete boots of player
clear inventory of player
| Place | Meaning |
|---|---|
helmet, chestplate, leggings, boots | The four armour places |
tool | What is in the main hand |
offhand | What is in the other hand |
inventory slot <n> | One of the 36 inventory slots; 1 to 9 are the hotbar |
Each is written <place> of <who>. Reading gives an item, or unset when the place is empty; set ... to <item> replaces what is there (it is not dropped); delete empties it.
Naming an item once. An item that several lines need can be described once, at the left margin of a file, and then asked for by name wherever an item is expected, in that file or any other:
item magic wand:
blaze rod named "&dMagic wand" with lore "&7Right-click to cast" glowing
command /wand:
trigger:
give player magic wand
on right click with magic wand:
apply levitation 2 to player for 3 seconds
Under the header goes one line: an item exactly as give takes it. The name is one to five plain words and may not be the name of a Minecraft item. give player 3 magic wand, player has magic wand, player is holding magic wand and slot 5 is magic wand all work, and more can be added for one use: magic wand named "&6Golden wand".
Such an item carries its name as a hidden tag (magic_wand), so it is still recognised after a player renames it on an anvil, and a plain blaze rod is never mistaken for it. on right click with <item>: and on left click with <item>: run only for players holding that item, in either hand; any item can be written there, not only a named one.
Tools. What a player is holding can be worn down, mended and enchanted in place:
damage tool of player by 25
repair tool of player
enchant tool of player with efficiency 5
Clickable messages. A chat message can do something when clicked and show more when the mouse is over it:
send "&a[Go home]" with click command "/home" with hover "&7Teleports you home"
send "&b[Our website]" with click url "https://example.com" to all players
send "&7[Reply]" with click suggestion "/msg %player.name% " to arg.1
| Part | Effect |
|---|---|
with click command <text> | Runs the command as the player who clicks |
with click suggestion <text> | Puts the text in their chat box without sending it |
with click url <text> | Offers to open the web page |
with hover <text> | Shown while the mouse is over the message |
The whole message is clickable. Write with before each part, as in the first example; to <who> may come before or after them.
Taking items. remove takes items out of an inventory, and has tests for them first:
if player has 5 diamond:
remove 5 diamond from player
add 100 to {%player%.coins}
It takes up to the amount given and simply stops when there is no more, so test with has when the amount matters. remove 1 diamond from all players and remove 1 diamond from arg.1 work too. What comes after from decides the meaning: a variable is a list to take a value out of, anything else is a player. For a player whose name is in a variable, write it as text: remove 1 diamond from "%{_who}%".
Teleporting. teleport player to {%player%.home} or teleport player to 0, 80, 0 in "world" moves a player and keeps the direction they are facing.
Summoning. summon spawns entities at a position:
summon zombie at player's location
summon 3 chicken at event's location
summon iron golem named "&6Town Guard" at 0, 80, 0 in "world"
summon {boss_type} at {arena}
The entity is a Minecraft entity type written as plain words (zombie, iron golem), checked when the script loads, or any value holding a type name. Up to 50 can be summoned at a time, and named gives them a visible custom name.
Who a statement is for. Statements that take a recipient accept player (the player of this trigger), all players, or anything that gives a player name such as %arg.1% or "Alex".
What a player is and has, and players together.
heal <who> / feed <who>since 1.5.8Full health (and no longer burning) / a full hunger bar
heal player
feed playerTry ithealth of <who>since 1.5.8Health in half hearts; 20 is ten hearts. Setting it to 0 kills
if health of player < 6:
send "&cYou are badly hurt!"Try itmax health of <who>since 1.5.8The most health they can have
set max health of player to 40Try itfood of <who>since 1.5.8Hunger, 0 to 20
set food of player to 20Try itlevel of <who>since 1.5.8Experience level
add 5 to level of playerTry itgamemode of <who>since 1.5.8survival, creative, adventure or spectator
set gamemode of player to creativeTry itflight of <who>since 1.5.8Whether they may fly: true or false
set flight of player to trueTry itapply <effect> [<level>] to <who> [for <duration>]since 1.5.8Give a potion effect; level 1 and 30 seconds unless said otherwise
apply speed 2 to player for 30 secondsTry itclear effects of <who> / clear <effect> effect of <who>since 1.5.8Take every effect away, or one
clear effects of player
clear speed effect of playerTry itignite <who> [for <duration>] / extinguish <who>since 1.5.8Set on fire (5 seconds unless said otherwise), or put out
ignite arg.1 for 3 seconds
extinguish playerTry itfreeze <who> / unfreeze <who>since 1.5.8Hold a player in place; they can still look around
freeze arg.1
send "&cYou have been frozen." to arg.1Try itrespawn <who>since 1.7.1Bring a dead player back at once, skipping the death screen
on player death:
wait 1 tick
respawn playerTry itshow <who> a book titled <text> with pages <text>, <text>since 1.7.1Open a book on their screen; nothing is put in their inventory
show player a book titled "Rules" with pages "&lRules\n\n1. Be kind.", "2. No griefing."Try ithide <who> from tab list of <who>since 1.7.42Take a player off the list another player sees when they hold Tab. They are still seen in the world; only the list changes. Needs a Paper server, 1.20 or newer
hide player from tab list of arg.1Try itshow <who> in tab list of <who>since 1.7.42Put them back on it. show <who> from tab list of <who> means the same
show player in tab list of arg.1Try itset <who>'s yaw to <number>since 1.7.42Turn them left or right: the same as set yaw of <who> to. 0 is south, 90 west, 180 north, -90 east
set player's yaw to -90Try itset <who>'s pitch to <number>since 1.7.42Make them look up or down: the same as set pitch of <who> to. -90 is straight up, 90 straight down
set player's pitch to 0Try ithide <who> from <who> / show <who> to <who>since 1.7.1Make one player invisible to another, or visible again
hide player from arg.1
send "&7%arg.1% can no longer see you."Try itclear title of <who>since 1.7.1Remove a title from the screen
clear title of playerTry ittab name of <who>since 1.7.1Their name in the tab list; settable
set tab name of player to "&6[VIP] &f%player.name%"Try itfree slots of <who>since 1.7.1How many of their inventory slots are empty
if free slots of player < 3:
send "&eYour inventory is nearly full."Try itping of <who>since 1.7.1Their connection delay in milliseconds. Unset on servers older than 1.17, where %player.ping% still works
send "&7Ping of %arg.1%: &f" + ping of arg.1Try itsend toast <text> [with icon <item>] [as goal] [to <who>]since 1.7.2The pop-up in the top corner that advancements use. as task (the default), as goal or as challenge picks the frame and sound
send toast "&aQuest complete!" with icon diamond as challenge to playerTry itgive head of <name> to <who>since 1.7.2A player head wearing that player's skin
on player kill:
give head of victim to playerTry itset item cooldown of <item> for <who> to <duration>since 1.7.2Grey out an item so it cannot be used for a while, as ender pearls are. item cooldown of <item> for <who> reads what is left
on right click:
if event.item is "blaze_rod":
if item cooldown of blaze rod for player > 0 seconds:
stop
set item cooldown of blaze rod for player to 5 seconds
strike lightning at target block of playerTry itstop sound <name> [for <who>] / stop all sounds [for <who>]since 1.7.2Cut a sound short. stop all sounds needs Minecraft 1.17 or newer
stop sound "music_disc.cat" for playerTry itlocation of <who>since 1.7.3Where another player is, as a location; for the player of the trigger, player's location
if distance between player's location and location of arg.1 > 10:
send "&c%arg.1% is too far away."Try ityaw from <location> to <location>since 1.7.55Which way to turn at the first place to face the second, as the game counts it: 0 is south, 90 west
set {_way} to yaw from player's location to {spawn}
set player's yaw to {_way}Try itpitch from <location> to <location>since 1.7.55How far to look up or down: below nothing is up
set {_tilt} to pitch from player's location to {spawn}
set player's pitch to {_tilt}Try it<location> moved <n> blocks towards <location>since 1.7.55The place that far along the way from one to the other; never beyond it
set {_step} to player's location moved 3 blocks towards {spawn}
teleport player to {_step}Try it<who>'s locationsince 1.7.7The same, written after the player: loop-player's location, arg.1's location, {_name}'s location
loop all players:
draw particle circle with radius 2 using particle "flame" at loop-player's locationTry itabsorption of <who>since 1.7.2Their golden extra hearts, in half hearts; settable
set absorption of player to 8Try itprotocol version of <who>since 1.7.2The number of the game version their client speaks, e.g. 754 for 1.16.5. Asked from ViaVersion if it is installed, otherwise from Paper; unset on plain Spigot
if protocol version of player < 765:
send "&eYou are on an old version; some things may look different."Try itclient brand of <who>since 1.7.2What their game calls itself: vanilla, fabric, forge. Paper only
log "%player.name% plays with " + client brand of playerTry itask <who> <text> into <variable>since 1.7.3Ask a question and wait for the answer. The next thing the player says in chat is the answer and nobody else sees it. Add for at most 30 seconds to change how long to wait (a minute by default); with no answer the variable is unset
command /clan <action>:
trigger:
ask player "&eWhat should your clan be called?" into {_name} for at most 30 seconds
if {_name} is not set:
send "&cToo slow."
stop
send "&aClan %{_name}% created."Try itask <who> <text> as number into <variable>since 1.7.60The same, for an amount: an answer that is no number is said to be none and the question asked again. 1.5k counts
command /deposit:
trigger:
ask player "&eHow much?" as number into {_amount}
if {_amount} is set:
add {_amount} to {%player%.bank}Try itask <who> <text> with options <text>, <text> into <variable>since 1.7.3The same, with answers to click on. Typing one in chat works too
ask player "&ePick a team:" with options "Red", "Blue" into {_team}
if {_team} is set:
add player to team lowercase {_team}Try itask <who> <text> with anvil into <variable>since 1.7.23The question opens as an anvil with a box to type in; what the player types and takes out is the answer. Good inside menus, where chat is out of the way. The question stands on top of the window and the box starts empty, so the answer is simply typed; on an older server, where the question has to stand in the box, it is taken off the answer if it was left there. Needs a Paper server; elsewhere the question is asked in chat. Closing the anvil gives an empty answer
command /pet:
players only: true
trigger:
ask player "Name your pet" with anvil into {_name}
if {_name} is "":
send "&7Maybe later."
stop
set {%player%.pet} to {_name}
send "&aYour pet is called %{_name}%."Try itconfirm <text>:since 1.7.3Ask yes or no; the block runs only if the player answers yes. confirm <text> for <who>: asks someone else
command /delhome:
trigger:
confirm "&cDelete your home? This cannot be undone.":
delete {%player%.home}
send "&eHome deleted."Try ititems in ender chest of <who>since 1.7.3A list of the items in their ender chest
send "&7Your ender chest holds " + size of (items in ender chest of player) + " stack(s)."Try ititems in inventory of <who>since 1.7.57A list of the items they carry, without the armour and the other hand
command /carrying:
trigger:
loop items in inventory of player:
send "&7%loop-index%. &f%loop-value%"
else:
send "&7You carry nothing."Try itadd <item> to ender chest of <who> / clear ender chest of <who>since 1.7.3Put items in an ender chest, or empty it
add 3 diamond to ender chest of player
send "&bA gift is waiting in your ender chest."Try itmake <who> say <text>since 1.7.0Send a chat message, or run a command if it starts with /, as that player
make player say "I love this server!"Try itopen workbench for <who> / open enderchest for <who>since 1.7.0Show a crafting grid or their ender chest
open workbench for playerTry itfly speed of <who> / walk speed of <who>since 1.7.0From -1 to 1; the usual values are 0.1 for flying and 0.2 for walking
set walk speed of player to 0.4Try ittool durability of <who>since 1.7.70How many uses the thing in their hand has left; unset for what does not wear out. set tool durability of player to 50 sets it
set {_left} to tool durability of player
if {_left} is set and {_left} < 20:
send "&cYour tool is about to break."Try itset time of <who> to <ticks>since 1.7.70The time of day that player sees, standing still, whatever the world's clock says: 1000 day, 6000 noon, 13000 night, 18000 midnight. Nobody else sees it. reset time of <who> gives them the world's own again
command /midnight:
trigger:
set time of player to 18000
command /daylight:
trigger:
reset time of playerTry itset weather of <who> to rainsince 1.7.70The weather that player sees: rain or clear. reset weather of <who> gives them the world's own again
set weather of player to rain
wait 30 seconds
reset weather of playerTry itsaturation of <who> / air of <who>since 1.7.0Hidden hunger reserve; seconds of breath left (15 is full)
if air of player < 3:
send "&cYou are running out of breath!"Try itheld slot of <who>since 1.7.0The selected hotbar slot, 1 to 9
set held slot of player to 1Try itcompass target of <who>since 1.7.27Where their compass points
set compass target of player to {spawn}Try itbed location of <who>since 1.7.27Where they respawn; unset without a bed. Change it with set bed spawn of <who> to <location>
command /bed:
players only: true
trigger:
if bed location of player is not set:
send "&7You have not slept in a bed yet."
stop
teleport player to bed location of playerTry ityaw of <who> / pitch of <who> / direction of <who>since 1.7.0Which way they face; direction is north, east, south or west
send "&7You are facing &f" + direction of playerTry itgame version of <who>since 1.7.20What their game calls its version, e.g. 1.21.4, for servers that let several versions in. From the number in protocol version of; one the list does not know yet comes as protocol <n>
on player join:
if game version of player is not "1.21.4":
send "&eYou are on %game version of player%. Some things look best on 1.21.4."Try itip of <who> / locale of <who>since 1.7.0Their address and game language, e.g. en_us
log "%player.name% uses the language " + locale of playerTry ittime played of <who>since 1.7.0Total time on the server, as a duration
send "&7Played: &f" + time played of playerTry itfall distance of <who>since 1.7.0How far they have fallen so far
if fall distance of player > 20:
send "&cBrace yourself!"Try itvanish <who> / unvanish <who>since 1.5.8Hide a player from everyone else, or show them again
vanish player
send "&7Nobody can see you now."Try it<who> has effect <effect> / does not have effect <effect>since 1.5.8They have that potion effect
if player has effect speed:
send "&bYou are fast."Try it<who> is frozen / is vanished / is flyingsince 1.5.8As it says; is not works too
if arg.1 is frozen:
send "&7%arg.1% is frozen."Try it<who> is falling / is glidingsince 1.7.70Coming down through the air, or flying with an elytra
if player is falling:
send action bar "&7Mind the landing." to playerTry itWhat a player is like right now can be read and changed.
command /heal:
permission: "staff.heal"
trigger:
heal player
feed player
send "&aYou feel much better."
on player join:
if level of player < 5:
apply speed 1 to player for 2 minutes
send "&7A little speed boost for a new player."
| Syntax | Meaning |
|---|---|
heal <who> / feed <who> | Full health (and no longer burning) / a full hunger bar |
health of <who> | Health in half hearts; 20 is ten hearts. Setting it to 0 kills |
max health of <who> | The most health they can have |
food of <who> | Hunger, 0 to 20 |
level of <who> | Experience level |
gamemode of <who> | survival, creative, adventure or spectator |
flight of <who> | Whether they may fly: true or false |
apply <effect> [<level>] to <who> [for <duration>] | Give a potion effect; level 1 and 30 seconds unless said otherwise |
clear effects of <who> / clear <effect> effect of <who> | Take every effect away, or one |
ignite <who> [for <duration>] / extinguish <who> | Set on fire (5 seconds unless said otherwise), or put out |
freeze <who> / unfreeze <who> | Hold a player in place; they can still look around |
respawn <who> | Bring a dead player back at once, skipping the death screen |
show <who> a book titled <text> with pages <text>, <text> | Open a book on their screen; nothing is put in their inventory |
hide <who> from tab list of <who> | Take a player off the list another player sees when they hold Tab. They are still seen in the world; only the list changes. Needs a Paper server, 1.20 or newer |
show <who> in tab list of <who> | Put them back on it. show <who> from tab list of <who> means the same |
set <who>'s yaw to <number> | Turn them left or right: the same as set yaw of <who> to. 0 is south, 90 west, 180 north, -90 east |
set <who>'s pitch to <number> | Make them look up or down: the same as set pitch of <who> to. -90 is straight up, 90 straight down |
hide <who> from <who> / show <who> to <who> | Make one player invisible to another, or visible again |
clear title of <who> | Remove a title from the screen |
tab name of <who> | Their name in the tab list; settable |
free slots of <who> | How many of their inventory slots are empty |
ping of <who> | Their connection delay in milliseconds. Unset on servers older than 1.17, where %player.ping% still works |
send toast <text> [with icon <item>] [as goal] [to <who>] | The pop-up in the top corner that advancements use. as task (the default), as goal or as challenge picks the frame and sound |
give head of <name> to <who> | A player head wearing that player's skin |
set item cooldown of <item> for <who> to <duration> | Grey out an item so it cannot be used for a while, as ender pearls are. item cooldown of <item> for <who> reads what is left |
stop sound <name> [for <who>] / stop all sounds [for <who>] | Cut a sound short. stop all sounds needs Minecraft 1.17 or newer |
location of <who> | Where another player is, as a location; for the player of the trigger, player's location |
yaw from <location> to <location> | Which way to turn at the first place to face the second, as the game counts it: 0 is south, 90 west |
pitch from <location> to <location> | How far to look up or down: below nothing is up |
<location> moved <n> blocks towards <location> | The place that far along the way from one to the other; never beyond it |
<who>'s location | The same, written after the player: loop-player's location, arg.1's location, {_name}'s location |
absorption of <who> | Their golden extra hearts, in half hearts; settable |
protocol version of <who> | The number of the game version their client speaks, e.g. 754 for 1.16.5. Asked from ViaVersion if it is installed, otherwise from Paper; unset on plain Spigot |
client brand of <who> | What their game calls itself: vanilla, fabric, forge. Paper only |
ask <who> <text> into <variable> | Ask a question and wait for the answer. The next thing the player says in chat is the answer and nobody else sees it. Add for at most 30 seconds to change how long to wait (a minute by default); with no answer the variable is unset |
ask <who> <text> as number into <variable> | The same, for an amount: an answer that is no number is said to be none and the question asked again. 1.5k counts |
ask <who> <text> with options <text>, <text> into <variable> | The same, with answers to click on. Typing one in chat works too |
ask <who> <text> with anvil into <variable> | The question opens as an anvil with a box to type in; what the player types and takes out is the answer. Good inside menus, where chat is out of the way. The question stands on top of the window and the box starts empty, so the answer is simply typed; on an older server, where the question has to stand in the box, it is taken off the answer if it was left there. Needs a Paper server; elsewhere the question is asked in chat. Closing the anvil gives an empty answer |
confirm <text>: | Ask yes or no; the block runs only if the player answers yes. confirm <text> for <who>: asks someone else |
items in ender chest of <who> | A list of the items in their ender chest |
items in inventory of <who> | A list of the items they carry, without the armour and the other hand |
add <item> to ender chest of <who> / clear ender chest of <who> | Put items in an ender chest, or empty it |
make <who> say <text> | Send a chat message, or run a command if it starts with /, as that player |
open workbench for <who> / open enderchest for <who> | Show a crafting grid or their ender chest |
fly speed of <who> / walk speed of <who> | From -1 to 1; the usual values are 0.1 for flying and 0.2 for walking |
tool durability of <who> | How many uses the thing in their hand has left; unset for what does not wear out. set tool durability of player to 50 sets it |
set time of <who> to <ticks> | The time of day that player sees, standing still, whatever the world's clock says: 1000 day, 6000 noon, 13000 night, 18000 midnight. Nobody else sees it. reset time of <who> gives them the world's own again |
set weather of <who> to rain | The weather that player sees: rain or clear. reset weather of <who> gives them the world's own again |
saturation of <who> / air of <who> | Hidden hunger reserve; seconds of breath left (15 is full) |
held slot of <who> | The selected hotbar slot, 1 to 9 |
compass target of <who> | Where their compass points |
bed location of <who> | Where they respawn; unset without a bed. Change it with set bed spawn of <who> to <location> |
yaw of <who> / pitch of <who> / direction of <who> | Which way they face; direction is north, east, south or west |
game version of <who> | What their game calls its version, e.g. 1.21.4, for servers that let several versions in. From the number in protocol version of; one the list does not know yet comes as protocol <n> |
ip of <who> / locale of <who> | Their address and game language, e.g. en_us |
time played of <who> | Total time on the server, as a duration |
fall distance of <who> | How far they have fallen so far |
vanish <who> / unvanish <who> | Hide a player from everyone else, or show them again |
The ones written <something> of <who> are values: read them, set them, and add to or subtract from the numeric ones.
set gamemode of player to creative
set flight of arg.1 to true
add 5 to level of player
subtract 4 from health of player
if health of player < 6:
send "&cYou are badly hurt!"
| Condition | True when |
|---|---|
<who> has effect <effect> / does not have effect <effect> | They have that potion effect |
<who> is frozen / is vanished / is flying | As it says; is not works too |
<who> is falling / is gliding | Coming down through the air, or flying with an elytra |
speed, jump boost, night vision, regeneration, slowness, invisibility and so on. They are checked when the script loads.freeze and vanish last until they are undone or the player logs out. Someone who joins while a player is vanished does not see them.<text> as offlineplayersince 1.7.26That player, online or not. If they have played here, the name is written the way the server has it: "progamer52" as offlineplayer gives Progamer52. A name that has never joined stays as written
command /seen <player>:
trigger:
set {_who} to arg.1 as offlineplayer
if {_who} has not played before:
send "&c%arg.1% has never played here."
stop
send "&7%{_who}% was last on " + last seen of {_who} formatted as "d MMMM yyyy"Try it<who> has played beforesince 1.7.26Whether they have ever joined this server
command /known <player>:
trigger:
if arg.1 has played before:
send "&a%arg.1% has been here."
else:
send "&c%arg.1% has never joined."Try ituuid of <who>since 1.7.26Their id, which stays the same when they change their name
command /uuid <player>:
trigger:
set {_who} to arg.1 as offlineplayer
if {_who} has played before:
send "&7%{_who}%: &f" + uuid of {_who}Try itname of <who>since 1.7.26Their name as the server has it
command /realname <player>:
trigger:
send "&7That is &f" + name of arg.1Try itall offline playerssince 1.7.26A list of the names of everybody who has ever played here, online or not
command /everyone:
permission: staff.everyone
trigger:
async:
set {_all} to all offline players
send "&7%size of {_all}% player(s) have played here."Try itA player is somebody who is online or who has played here before, and much of what a script knows about a player it also knows when they are away:
command /coins <player>:
trigger:
set {_who} to arg.1 as offlineplayer
if {_who} has not played before:
send "&c%arg.1% has never played here."
stop
send "&e%{_who}% &7has &f%{%{_who}%.coins}% &7coins."
| Syntax | Meaning |
|---|---|
<text> as offlineplayer | That player, online or not. If they have played here, the name is written the way the server has it: "progamer52" as offlineplayer gives Progamer52. A name that has never joined stays as written |
<who> has played before | Whether they have ever joined this server |
uuid of <who> | Their id, which stays the same when they change their name |
name of <who> | Their name as the server has it |
all offline players | A list of the names of everybody who has ever played here, online or not |
{%{_who}%.coins}), uuid of, name of, first join date of, last seen of, balance of with an economy plugin, is online, is op, is banned, has played before, ban, unban and the top lists.as offlineplayer only looks at who has played on this server. It never asks Mojang, so it does not slow the server down. A name that has never joined is kept as it was written, because it can still be banned before it ever joins; has not played before tells the two apart.all offline players reads the server's list of players from disk. On a server with many thousands of them, ask for it in an async: block.set tab header of <who> to <text>since 1.5.2anywhere · Text above the player list. \n makes more lines
set tab header of player to "&6&lMy Server"Try itset tab footer of <who> to <text>since 1.5.2anywhere · Text below it
set tab footer of player to "&7Online: %server.online_players%"Try itset display name of <who> to <text>since 1.5.2anywhere · The name used in chat and in the tab list
set display name of player to "&6[VIP] %player.name%"Try itset join message to <text>since 1.5.2on player join · Replaces "Steve joined the game"
set join message to "&a+ &f%player.name%"Try itset quit message to <text>since 1.5.2on player quit · Replaces "Steve left the game"
on player quit:
set quit message to "&c- &f%player.name%"Try ithide join message / hide quit messagesince 1.5.2those events · Shows nothing
on player join:
hide join messageTry itset chat format to <text>since 1.5.2on player chat · The whole chat line, built from placeholders
set chat format to "&7%player.name% &8>> &f%event.message%"Try itset chat message to <text>since 1.5.2on player chat · Replaces what the player said
on player chat:
if message contains "badword":
set chat message to "(removed)"Try iton player join:
set join message to "&a+ &f%player.name%"
set tab header of player to "&6&lMy Server"
set tab footer of player to "&7Online: %server.online_players%"
if player has permission "rank.vip":
set display name of player to "&6[VIP] %player.name%"
on player quit:
hide quit message
on player chat:
set chat format to "&7%player.name% &8>> &f%event.message%"
| Statement | Where | Effect |
|---|---|---|
set tab header of <who> to <text> | anywhere | Text above the player list. \n makes more lines |
set tab footer of <who> to <text> | anywhere | Text below it |
set display name of <who> to <text> | anywhere | The name used in chat and in the tab list |
set join message to <text> | on player join | Replaces "Steve joined the game" |
set quit message to <text> | on player quit | Replaces "Steve left the game" |
hide join message / hide quit message | those events | Shows nothing |
set chat format to <text> | on player chat | The whole chat line, built from placeholders |
set chat message to <text> | on player chat | Replaces what the player said |
every 5 seconds for all players:.on player join.set chat format writes the line exactly as given, so include %event.message% where the message should go. Other chat plugins that set a format of their own may override it.wait; elsewhere they log a warning.add <who> to team <name>since 1.5.7Put a player in a team, leaving the one they were in
add player to team "red"Try itremove <who> from teamsince 1.5.7Take a player out of their team
remove player from teamTry itremove <who> from team <name>since 1.5.7The same, but only if they are in that team
remove player from team "red"Try itset color of team <name> to <colour>since 1.5.7The colour of names: red, dark_blue, gold, or a code such as "&a"
set color of team "red" to redTry itset prefix of team <name> to <text> / set suffix of team <name> to <text>since 1.5.7Text before or after each name
set prefix of team "red" to "&c[Red] "Try itset friendly fire of team <name> to <true or false>since 1.5.7Whether team mates can hurt each other
set friendly fire of team "red" to falseTry itdelete team <name>since 1.5.7Remove a team; its players are in no team afterwards
delete team "red"Try itteam of <who>since 1.5.7The name of a player's team; unset if they have none
if team of player is "red":
send "&cGo red!"Try itplayers of team <name>since 1.5.7A list of the names in a team, online or not
for each {_mate} in players of team "red":
send "&cRed team, assemble!" to {_mate}Try itA team colours its players' names in chat, in the tab list and above their heads, and can put a tag in front of them.
on load:
set color of team "red" to red
set prefix of team "red" to "&c[Red] "
set friendly fire of team "red" to false
command /red:
trigger:
add player to team "red"
send "&cYou joined the red team."
| Syntax | Effect |
|---|---|
add <who> to team <name> | Put a player in a team, leaving the one they were in |
remove <who> from team | Take a player out of their team |
remove <who> from team <name> | The same, but only if they are in that team |
set color of team <name> to <colour> | The colour of names: red, dark_blue, gold, or a code such as "&a" |
set prefix of team <name> to <text> / set suffix of team <name> to <text> | Text before or after each name |
set friendly fire of team <name> to <true or false> | Whether team mates can hurt each other |
delete team <name> | Remove a team; its players are in no team afterwards |
team of <who> | The name of a player's team; unset if they have none |
players of team <name> | A list of the names in a team, online or not |
on load: so that they exist as soon as the script is loaded.invite <who> to partysince 1.7.17The player invites someone. Whoever invites without a party becomes the leader of a new one when the first invitation is accepted. An invitation stands for a minute
command /invite <player>:
players only: true
trigger:
invite arg.1 to party
send "&7%player% invites you to a party." to arg.1Try itaccept party invite / decline party invitesince 1.7.17The player answers the newest invitation they have; add from <who> to answer a particular one
command /accept:
players only: true
trigger:
accept party invite
if player is in a party:
send "&a%player% joined." to party of playerTry itleave partysince 1.7.17The player leaves. If they led it, whoever joined after them leads; a party of one is no party
command /leaveparty:
players only: true
trigger:
leave party
send "&7You left the party."Try itremove <who> from partysince 1.7.17The leader takes someone out
command /partykick <player>:
players only: true
trigger:
remove arg.1 from partyTry itdisband partysince 1.7.17The leader ends it
command /disbandparty:
players only: true
trigger:
send "&cThe party was ended." to party of player
disband partyTry itparty of <who>since 1.7.17A list of the names of everyone in their party, the leader first; empty for someone without one. It can be sent to: send "..." to party of player reaches every member who is online
on chat:
if message starts with "!":
cancel event
send "&d[Party] &f%player%: %message%" to party of playerTry itparty leader of <who>since 1.7.17The leader's name; unset without a party
command /leader:
trigger:
if player is in a party:
send "&7Your party is led by &f" + party leader of playerTry itparty invites of <who>since 1.7.17The names of those who have invited them
command /invites:
trigger:
send "&7Invited by: &f" + party invites of playerTry it<who> is in a partysince 1.7.17A condition; is not in a party likewise
on hit:
if attacker is in a party:
if party of attacker contains victim:
cancel eventTry iton queue <name> of <n>:since 1.7.17At the left margin: runs each time n players are waiting. They are taken out of the queue and handed over as the list {_players}, first come first
on queue "duels" of 2:
for each {_name} in {_players}:
send "&aA match was found!" to {_name}Try itadd <who> to queue <name>since 1.7.17Put someone in the line; nothing happens if they are in it already
command /duel:
players only: true
trigger:
add player to queue "duels"
send "&7Waiting for an opponent..."Try itremove <who> from queue <name>since 1.7.17Take them out. remove <who> from all queues for every queue at once
command /leavequeue:
players only: true
trigger:
remove player from all queues
send "&7You are no longer waiting."Try itqueue <name>since 1.7.17A list of the names of those waiting
command /waiting:
trigger:
send "&7In line: &f" + size of queue "duels"Try it<who> is in queue <name>since 1.7.17A condition
command /duel2:
players only: true
trigger:
if player is in queue "duels":
send "&cYou are already waiting."
stop
add player to queue "duels"Try itA party is a group of players with a leader. HyperScript keeps track of who is in which; what being in one means (a shared chat, teleporting together, friendly fire) is up to your scripts.
command /party <invite|accept|leave> [player]:
players only: true
trigger:
if arg.1 is "invite":
invite arg.2 to party
send "&7%player% invites you to a party. &f/party accept" to arg.2
else if arg.1 is "accept":
accept party invite
send "&a%player% joined the party." to party of player
else:
leave party
| Syntax | Meaning |
|---|---|
invite <who> to party | The player invites someone. Whoever invites without a party becomes the leader of a new one when the first invitation is accepted. An invitation stands for a minute |
accept party invite / decline party invite | The player answers the newest invitation they have; add from <who> to answer a particular one |
leave party | The player leaves. If they led it, whoever joined after them leads; a party of one is no party |
remove <who> from party | The leader takes someone out |
disband party | The leader ends it |
party of <who> | A list of the names of everyone in their party, the leader first; empty for someone without one. It can be sent to: send "..." to party of player reaches every member who is online |
party leader of <who> | The leader's name; unset without a party |
party invites of <who> | The names of those who have invited them |
<who> is in a party | A condition; is not in a party likewise |
A queue collects players until there are enough, and then runs a block with them:
on queue "duels" of 2:
set {_a} to item 1 of {_players}
set {_b} to item 2 of {_players}
broadcast "&6%{_a}% &7fights &6%{_b}%&7!"
command /duel:
players only: true
trigger:
add player to queue "duels"
send "&7Waiting for an opponent..."
| Syntax | Meaning |
|---|---|
on queue <name> of <n>: | At the left margin: runs each time n players are waiting. They are taken out of the queue and handed over as the list {_players}, first come first |
add <who> to queue <name> | Put someone in the line; nothing happens if they are in it already |
remove <who> from queue <name> | Take them out. remove <who> from all queues for every queue at once |
queue <name> | A list of the names of those waiting |
<who> is in queue <name> | A condition |
send "..." to {_a}, or loop over {_players}).kick <who> [because <text>]since 1.5.7Disconnect a player with a message
kick arg.1 because "&cPlease calm down."Try itban <who> [for <duration>] [because <text>]since 1.5.7Ban by name, for good or for a while, and kick them if online
ban arg.1 for 7 days because "&cGriefing"Try itunban <who>since 1.5.7Lift a ban
unban arg.1Try it<who> is banned / is not bannedsince 1.5.7A condition
if arg.1 is not banned:
send "&7%arg.1% is not banned."Try itrefuse login [because <text>]since 1.5.7Inside on player login:, turn the player away
on player login:
if {maintenance}:
refuse login because "&eBack soon!"Try itcommand /mute-kick <player>:
permission: "staff.kick"
trigger:
kick arg.1 because "&cPlease calm down."
on player login:
if {maintenance} and {%player%.staff} is not set:
refuse login because "&eThe server is being worked on. Back soon!"
| Syntax | Effect |
|---|---|
kick <who> [because <text>] | Disconnect a player with a message |
ban <who> [for <duration>] [because <text>] | Ban by name, for good or for a while, and kick them if online |
unban <who> | Lift a ban |
<who> is banned / is not banned | A condition |
refuse login [because <text>] | Inside on player login:, turn the player away |
ban ... for 7 days ends by itself. Without for, the ban lasts until unban./ban and /pardon use), so they work for players who are offline and survive restarts.on player login: runs while someone is connecting, before they are in the game. There is no player yet, so send reaches nobody and player.name is unset; use %event.name% for their name. {%player%.<name>} does work and is the variables of whoever is logging in, which is what makes checks such as a ban of your own or a whitelist possible.top <n> players by {<name>}since 1.5.8A list of up to n player names, best first
set {_place} to 0
for each {_name} in top 10 players by {coins}:
add 1 to {_place}
send "&e#%{_place}% &f%{_name}%"Try itrank of <who> by {<name>}since 1.5.8Where that player stands, 1 being the best; unset if they have no value
set {_mine} to rank of player by {coins}
send "&7You are #%{_mine}%"Try ittop orders every player who has ever played by one of their own variables, highest first, whether they are online or not:
command /baltop:
trigger:
send "&6Richest players"
set {_place} to 0
for each {_name} in top 10 players by {coins}:
add 1 to {_place}
send "&e#%{_place}% &f%{_name}% &7- %{%{_name}%.coins}% coins"
set {_mine} to rank of player by {coins}
send "&7You are #%{_mine}%"
| Syntax | Result |
|---|---|
top <n> players by {<name>} | A list of up to n player names, best first |
rank of <who> by {<name>} | Where that player stands, 1 being the best; unset if they have no value |
{coins} here means the same as {%player%.coins}, and both spellings are accepted.currency "<name>":since 1.7.28At the left margin: says what a new player starts with (start: 10) and the most anybody can have (max: 100000). Optional: without it a currency starts at 0 and has no most
currency "tokens":
start: 5
command /tokens:
players only: true
trigger:
set {_tokens} to currency "tokens" of player
send "&7Tokens: &e%{_tokens}%"Try itcurrency <name> of <who>since 1.7.28What they have. Change it with set, add and subtract; it stops at nothing and at the most
on player kill:
add 1 to currency "tokens" of player
send "&e+1 token."Try itpay <n> of currency <name> from <who> to <who>since 1.7.28Move that much from one player to the other. Nothing happens if the first does not have it
command /tip <player>:
players only: true
trigger:
if currency "tokens" of player < 1:
send "&cYou have no tokens."
stop
pay 1 of currency "tokens" from player to arg.1
send "&aYou tipped %arg.1% a token."Try itMoney without another plugin: currency "gems" of player is a balance that is saved with the player, never goes below nothing, and can be ranked.
currency "gems":
start: 10
max: 100000
command /gems:
players only: true
trigger:
set {_gems} to currency "gems" of player
send "&7You have &b%{_gems}% &7gems."
command /givegems <player> <amount>:
permission: "gems.admin"
trigger:
set {_amount} to parse arg.2 as integer
if {_amount} is not set:
send "&cThat is not a number."
stop
add {_amount} to currency "gems" of arg.1
set {_now} to currency "gems" of arg.1
send "&a%arg.1% now has %{_now}% gems."
command /paygems <player> <amount>:
players only: true
trigger:
set {_amount} to parse arg.2 as integer
if {_amount} is not set or {_amount} < 1:
send "&cHow many?"
stop
if currency "gems" of player < {_amount}:
send "&cYou do not have that many gems."
stop
pay {_amount} of currency "gems" from player to arg.1
send "&aYou paid %arg.1% %{_amount}% gems."
| Syntax | Meaning |
|---|---|
currency "<name>": | At the left margin: says what a new player starts with (start: 10) and the most anybody can have (max: 100000). Optional: without it a currency starts at 0 and has no most |
currency <name> of <who> | What they have. Change it with set, add and subtract; it stops at nothing and at the most |
pay <n> of currency <name> from <who> to <who> | Move that much from one player to the other. Nothing happens if the first does not have it |
{%player%.currency.<name>}. So it works for someone who is offline, top 10 players by {currency.gems} ranks it, and other plugins can show it as %hyperscript_player_currency.gems%.pay to a player who is already at the most moves what fits and the rest is lost; check first if that can happen on your server.balance of player is Vault's money; a currency here is the script's own. The addon HyperEconomy makes the two one: it hands Vault a currency of yours as the server's money.Everything a script can put on a player's screen or in their ears.
send action bar <text> [to <who>]Text above the hotbar; it fades after a couple of seconds. send actionbar, in one word, is the same
send action bar "&a+100 Coins!" to playerTry itsend title <text>Large text in the middle of the screen
send title "&cServer restarting" to all playersTry itwith subtitle <text>Optional smaller line underneath. with description <text> is the same
send title "&6Victory!" with subtitle "&eYou won!" to player with fadein 10 stay 70 fadeout 20Try itto <who>Optional; the default is the player of this trigger
send action bar "&a+100 Coins!" to playerTry itwith fadein <n> stay <n> fadeout <n>Optional timings in ticks (20 ticks = 1 second). Any of the three may be left out; the defaults are 10, 70 and 20
send title "&6Victory!" with subtitle "&eYou won!" to player with fadein 10 stay 70 fadeout 20Try itsend action bar "&a+100 Coins!" to player
send title "&6Victory!" with subtitle "&eYou won!" to player with fadein 10 stay 70 fadeout 20
send title "&cServer restarting" to all players
| Part | Meaning |
|---|---|
send action bar <text> [to <who>] | Text above the hotbar; it fades after a couple of seconds. send actionbar, in one word, is the same |
send title <text> | Large text in the middle of the screen |
with subtitle <text> | Optional smaller line underneath. with description <text> is the same |
to <who> | Optional; the default is the player of this trigger |
with fadein <n> stay <n> fadeout <n> | Optional timings in ticks (20 ticks = 1 second). Any of the three may be left out; the defaults are 10, 70 and 20 |
An action bar fades after a couple of seconds. To keep one, say how long: send action bar "&cIn combat" to player for 10 seconds, or until <condition> or while <condition>, which look at the condition four times a second. The text is the one it had when the line ran; for a text that changes, resend it from a timer: every 1 second for all players:. Sending another action bar ends one that was staying.
create bossbar [<id>]The id names the bar so it can be updated or removed later; without one the id is default
create bossbar titled "&r&lEvent Boss" with color red with progress 100 for all playersTry ittitled <text>The text on the bar
create bossbar titled "&r&lEvent Boss" with color red with progress 100 for all playersTry itwith color <colour>pink, blue, red, green, yellow, purple or white (the default)
create bossbar titled "&r&lEvent Boss" with color red with progress 100 for all playersTry itwith progress <0-100>How full the bar is, in percent; the default is 100
create bossbar titled "&r&lEvent Boss" with color red with progress 100 for all playersTry itwith segments <n>since 1.7.3Notches along the bar: 6, 10, 12 or 20. Any other number gives a plain bar
create bossbar "lives" titled "&cLives" with color red with segments 10 with progress 70 for playerTry itfor <who>Who sees it
create bossbar titled "&r&lEvent Boss" with color red with progress 100 for all playersTry itfor <n> secondsOptional: remove the bar after this long
create bossbar "raid" titled "&cRaid: %{_left}% left" with progress {_left} / 8 * 100 for player for 30 secondsTry itfor <n> seconds counting downsince 1.7.59The bar empties by itself as the time runs, and is removed at the end
command /round:
trigger:
create bossbar "round" titled "&cRound ends" for all players for 30 seconds counting downTry itremove bossbar [<id>]Remove the bar for everyone
remove bossbar "raid"Try itcreate bossbar titled "&r&lEvent Boss" with color red with progress 100 for all players
create bossbar "raid" titled "&cRaid: %{_left}% left" with progress {_left} / 8 * 100 for player for 30 seconds
remove bossbar "raid"
| Part | Meaning |
|---|---|
create bossbar [<id>] | The id names the bar so it can be updated or removed later; without one the id is default |
titled <text> | The text on the bar |
with color <colour> | pink, blue, red, green, yellow, purple or white (the default) |
with progress <0-100> | How full the bar is, in percent; the default is 100 |
with segments <n> | Notches along the bar: 6, 10, 12 or 20. Any other number gives a plain bar |
for <who> | Who sees it |
for <n> seconds | Optional: remove the bar after this long |
for <n> seconds counting down | The bar empties by itself as the time runs, and is removed at the end |
remove bossbar [<id>] | Remove the bar for everyone |
create bossbar line run again with a new progress.all players is also shown to players who join later.set title of <who>'s scoreboard to <text>The heading of the sidebar
set title of player's scoreboard to "&e&lMY SERVER"Try itset line <n> of <who>'s scoreboard to <text>Line 1 is the top line; there are 15
set line 2 of player's scoreboard to "&7Rank: &bVIP"Try itupdate scoreboard of <who> every <duration>:since 1.7.64The lines under it run now, and again that often, for as long as that player is on the server: a sidebar that keeps itself up to date, without a timer of its own. Asking again for the same player replaces what was running
on player join:
set title of player's scoreboard to "&e&lMy server"
update scoreboard of player every 2 seconds:
set line 1 of player's scoreboard to "&7Coins: &f%{%player%.coins}%"
set line 2 of player's scoreboard to "&7Online: &f%server.online_players%"Try itstop updating scoreboard of <who>since 1.7.64It is no longer kept up to date; what it shows stays
command /quiet:
trigger:
stop updating scoreboard of player
send "&7Your sidebar is no longer kept up to date."Try itdelete line <n> of <who>'s scoreboardRemove one line
delete line 3 of player's scoreboardTry itclear <who>'s scoreboardRemove the sidebar and return to the server's normal scoreboard
clear player's scoreboardTry itEach player can have their own sidebar, built line by line.
set title of player's scoreboard to "&e&lSERVER NAME"
set line 1 of player's scoreboard to "&7Coins: &a%{%player%.coins}%"
set line 2 of player's scoreboard to "&7Rank: &bVIP"
| Statement | Effect |
|---|---|
set title of <who>'s scoreboard to <text> | The heading of the sidebar |
set line <n> of <who>'s scoreboard to <text> | Line 1 is the top line; there are 15 |
update scoreboard of <who> every <duration>: | The lines under it run now, and again that often, for as long as that player is on the server: a sidebar that keeps itself up to date, without a timer of its own. Asking again for the same player replaces what was running |
stop updating scoreboard of <who> | It is no longer kept up to date; what it shows stays |
delete line <n> of <who>'s scoreboard | Remove one line |
clear <who>'s scoreboard | Remove the sidebar and return to the server's normal scoreboard |
The red numbers Minecraft puts beside every line are left out, on a Paper server for Minecraft 1.20.3 or newer; older servers and Spigot cannot hide them. sidebar-numbers: true in config.yml shows them again.
<who> is player or anything that gives a player name, such as {_name}'s scoreboard.
every 1 second for all players:
set title of player's scoreboard to "&e&lMY SERVER"
set line 1 of player's scoreboard to "&7Coins: &a%{%player%.coins}%"
set line 2 of player's scoreboard to "&7Ping: &f%player.ping% ms"
set line 3 of player's scoreboard to "&7Online: &f%server.online_players%"
update scoreboard of player every ...: belongs.with title <text>Window title; & colour codes work
open gui with title "&8Warps" with 3 rows for player:
set {_slot} to 0
for each {_name} in keys of {warp}:
add 1 to {_slot}
slot {_slot} is "ender_pearl" named "&b%{_name}%" lore "&7Click to go":
teleport player to {warp.%{_name}%}
close gui
if player has permission "warps.admin":
slot 27 is "anvil" named "&eManage warps"Try itwith <n> rowsOptional, 1 to 6; the default is 3
open gui with title "&8Warps" with 3 rows for player:
set {_slot} to 0
for each {_name} in keys of {warp}:
add 1 to {_slot}
slot {_slot} is "ender_pearl" named "&b%{_name}%" lore "&7Click to go":
teleport player to {warp.%{_name}%}
close gui
if player has permission "warps.admin":
slot 27 is "anvil" named "&eManage warps"Try itfor playerWho sees it. Use a name instead to show it to someone else: for %arg.1%
open gui with title "&8Warps" with 3 rows for player:
set {_slot} to 0
for each {_name} in keys of {warp}:
add 1 to {_slot}
slot {_slot} is "ender_pearl" named "&b%{_name}%" lore "&7Click to go":
teleport player to {warp.%{_name}%}
close gui
if player has permission "warps.admin":
slot 27 is "anvil" named "&eManage warps"Try itslot <n> is "<item>"Slots are numbered from 1, left to right, top to bottom (row 2 starts at 10)
open gui with title "&8Warps" with 3 rows for player:
set {_slot} to 0
for each {_name} in keys of {warp}:
add 1 to {_slot}
slot {_slot} is "ender_pearl" named "&b%{_name}%" lore "&7Click to go":
teleport player to {warp.%{_name}%}
close gui
if player has permission "warps.admin":
slot 27 is "anvil" named "&eManage warps"Try itowned by <name>since 1.7.3In a menu, for a "player_head": whose face it shows. Comes before named
open gui with title "&8Online" with 1 rows for player:
slot 1 is "player_head" owned by player.name named "&f%player.name%"Try itnamed <text>Optional item name
open gui with title "&8Warps" with 3 rows for player:
set {_slot} to 0
for each {_name} in keys of {warp}:
add 1 to {_slot}
slot {_slot} is "ender_pearl" named "&b%{_name}%" lore "&7Click to go":
teleport player to {warp.%{_name}%}
close gui
if player has permission "warps.admin":
slot 27 is "anvil" named "&eManage warps"Try itlore <text>Optional description lines, separated by |
open gui with title "&8Warps" with 3 rows for player:
set {_slot} to 0
for each {_name} in keys of {warp}:
add 1 to {_slot}
slot {_slot} is "ender_pearl" named "&b%{_name}%" lore "&7Click to go":
teleport player to {warp.%{_name}%}
close gui
if player has permission "warps.admin":
slot 27 is "anvil" named "&eManage warps"Try itclose guiCloses the window for the player
close guiTry itslots <a> to <b> are <item>since 1.7.64The same button in several slots at once: slots 1 to 9 are "black_stained_glass_pane", slots 11, 13, 15 are "barrier" named "&cLocked". With a block under it, clicking any of them runs it
command /frame:
trigger:
open gui with title "&8Kits" with 3 rows for player:
slots 1 to 9 are "black_stained_glass_pane" named " "
slots 11, 13, 15 are "iron_sword" named "&fStarter":
send "&aYou picked a kit."Try itslot <n> takes items:since 1.7.63A slot a player can put an item into, from their cursor or by shift-clicking it in their own inventory. The block under it runs then, with the item as {_item}; the item is taken, so give it back if they should keep it. shown as <item>, named <text> and lore <text> say what the empty slot looks like
command /sell:
trigger:
open gui with title "&8Sell diamonds" with 3 rows for player:
fill empty slots with "gray_stained_glass_pane"
slot 14 takes items shown as "hopper" named "&ePut diamonds here":
if type of {_item} is "diamond":
add amount of {_item} * 10 to {%player%.coins}
send "&aSold for %amount of {_item} * 10% coins."
else:
give {_item} to player
send "&cOnly diamonds are bought here."Try itfill empty slots with <item>since 1.7.61In the block: every slot no slot line took shows that item, with no name and nothing to click. It may stand anywhere in the block
command /menu:
trigger:
open gui with title "&8Menu" with 3 rows for player:
fill empty slots with "gray_stained_glass_pane"
slot 14 is "diamond" named "&bShop":
send "&7The shop is not open yet."Try itborder with <item>since 1.7.61The same for the slots along the edge only
command /framed:
trigger:
open gui with title "&8Kits" with 3 rows for player:
border with "black_stained_glass_pane"
slot 14 is "iron_sword" named "&fStarter"Try iton close:since 1.7.61In the block: the lines under it run when the window closes, as the player it was open for, with the local variables as they were. Opening another window closes this one too
command /bank:
trigger:
open gui with title "&6Bank" for player:
slot 5 is "gold_ingot" named "&eYour coins: %{%player%.coins}%"
on close:
send "&7Come again."Try itrefresh every <duration>since 1.7.61In the block: while the window is open it draws itself again that often, on the page it is on, so that a time or a balance in it stays right
command /clock:
trigger:
open gui with title "&8Clock" for player:
refresh every 1 second
slot 5 is "clock" named "&f%server.time%"Try itgui pagesince 1.5.8The page being shown
open gui with title "&8Menu" with 1 rows for player:
slot 5 is "paper" named "&fPage %gui page%"Try itpage <n> of <list> with <k> per pagesince 1.5.8The part of a list that page n shows
set {_shown} to page 2 of {names} with 9 per pageTry itpages of <list> with <k> per pagesince 1.5.8How many pages the list needs; at least 1
set {_count} to pages of {names} with 9 per pageTry itnext page / previous pagesince 1.5.8In a click block: show the page after or before
open gui with title "&8Menu" with 1 rows for player:
slot 1 is "arrow" named "&ePrevious":
previous page
slot 9 is "arrow" named "&eNext":
next pageTry itset gui page to <n>since 1.5.8In a click block: jump to a page
open gui with title "&8Menu" with 1 rows for player:
slot 5 is "compass" named "&eBack to the first page":
set gui page to 1Try itrefresh guisince 1.5.8In a click block: draw the gui again on the same page, after the click changed what it shows
open gui with title "&8Clicker" with 1 rows for player:
slot 5 is "gold_ingot" named "&6Clicks: %{%player%.clicks}%":
add 1 to {%player%.clicks}
refresh guiTry itopen gui builds a chest menu and shows it to a player. Each slot line places an item; a slot line that ends with : gets a block that runs when the slot is clicked.
open gui with title "&8Coin Shop" with 3 rows for player:
slot 12 is "diamond" named "&bDiamond" lore "&7Price: &e50 coins|&7Click to buy":
if {%player%.coins} < 50:
send "&cYou need 50 coins for that."
else:
subtract 50 from {%player%.coins}
execute console command "give %player.name% diamond 1"
close gui
slot 14 is "gold_ingot" named "&6Balance: &e%{%player%.coins}% coins"
slot 16 is "barrier" named "&cClose":
close gui
| Part | Meaning |
|---|---|
with title <text> | Window title; & colour codes work |
with <n> rows | Optional, 1 to 6; the default is 3 |
for player | Who sees it. Use a name instead to show it to someone else: for %arg.1% |
slot <n> is "<item>" | Slots are numbered from 1, left to right, top to bottom (row 2 starts at 10) |
owned by <name> | In a menu, for a "player_head": whose face it shows. Comes before named |
named <text> | Optional item name |
lore <text> | Optional description lines, separated by | |
close gui | Closes the window for the player |
slots <a> to <b> are <item> | The same button in several slots at once: slots 1 to 9 are "black_stained_glass_pane", slots 11, 13, 15 are "barrier" named "&cLocked". With a block under it, clicking any of them runs it |
slot <n> takes items: | A slot a player can put an item into, from their cursor or by shift-clicking it in their own inventory. The block under it runs then, with the item as {_item}; the item is taken, so give it back if they should keep it. shown as <item>, named <text> and lore <text> say what the empty slot looks like |
fill empty slots with <item> | In the block: every slot no slot line took shows that item, with no name and nothing to click. It may stand anywhere in the block |
border with <item> | The same for the slots along the edge only |
on close: | In the block: the lines under it run when the window closes, as the player it was open for, with the local variables as they were. Opening another window closes this one too |
refresh every <duration> | In the block: while the window is open it draws itself again that often, on the page it is on, so that a time or a balance in it stays right |
"diamond" or "oak_planks". An unknown name shows a barrier and logs a warning.open gui is ordinary code in which every slot line adds a slot, so slots can come out of a loop or sit behind an if:open gui with title "&8Warps" with 3 rows for player:
set {_slot} to 0
for each {_name} in keys of {warp}:
add 1 to {_slot}
slot {_slot} is "ender_pearl" named "&b%{_name}%" lore "&7Click to go":
teleport player to {warp.%{_name}%}
close gui
if player has permission "warps.admin":
slot 27 is "anvil" named "&eManage warps"
gui page is that number, starting at 1, and a click can turn it. The gui is drawn again in the same window, without closing:open gui with title "&8Warps" with 5 rows for player:
set {_names} to keys of {warp}
set {_slot} to 0
for each {_name} in page (gui page) of {_names} with 36 per page:
add 1 to {_slot}
slot {_slot} is "ender_pearl" named "&b%{_name}%":
teleport player to {warp.%{_name}%}
close gui
if gui page > 1:
slot 37 is "arrow" named "&ePrevious":
previous page
if gui page < pages of {_names} with 36 per page:
slot 45 is "arrow" named "&eNext":
next page
| Syntax | Meaning |
|---|---|
gui page | The page being shown |
page <n> of <list> with <k> per page | The part of a list that page n shows |
pages of <list> with <k> per page | How many pages the list needs; at least 1 |
next page / previous page | In a click block: show the page after or before |
set gui page to <n> | In a click block: jump to a page |
refresh gui | In a click block: draw the gui again on the same page, after the click changed what it shows |
open gui block again, with the local variables as they were when the gui was first opened, so the list is looked up afresh each time.slot 5 is 1 nether star glowing named "&dRewards".slot line ran, so each slot made in a loop remembers its own round; saved variables such as {%player%.coins} are always current.open trades <title>:since 1.7.23Opens the trading window for the player; open trades <title> for <who>: for someone else. The lines under it are the offers
command /baker:
players only: true
trigger:
open trades "&eBaker":
1 emerald for 6 bread
3 emerald for 1 cakeTry it<cost> for <result>since 1.7.23An offer: what is paid on the left, what is got on the right. Any item with its amount, name and enchantments, or one named with item <name>:
command /miner:
players only: true
trigger:
open trades "&7Miner":
16 cobblestone for 1 emeraldTry it<cost> and <cost> for <result>since 1.7.23An offer that takes two things
command /smith:
players only: true
trigger:
open trades "&6Smith":
4 emerald and 1 stick for 1 iron swordTry itThe window villagers trade in, with offers of your own:
command /blacksmith:
players only: true
trigger:
open trades "&6Blacksmith":
5 emerald for 1 iron sword
8 emerald and 1 stick for 1 diamond sword named "&bFrostbite" enchanted with sharpness 2
1 diamond for 12 emerald
| Written | Meaning |
|---|---|
open trades <title>: | Opens the trading window for the player; open trades <title> for <who>: for someone else. The lines under it are the offers |
<cost> for <result> | An offer: what is paid on the left, what is got on the right. Any item with its amount, name and enchantments, or one named with item <name>: |
<cost> and <cost> for <result> | An offer that takes two things |
give instead.balance of player.advancement "<name>":since 1.7.20At the left margin. The name is what it is granted by
advancement "first kill":
title: "&cFirst blood"
description: "Win a fight against another player"
icon: iron sword
frame: challengeTry ittitle: / description:since 1.7.20What players read. Without a title, the name is shown
advancement "rich":
title: "&6Rich"
description: "Own a thousand coins"Try iticon: <item>since 1.7.20The item drawn in its frame; a book unless said otherwise
advancement "miner":
icon: diamond pickaxeTry itframe: task, goal or challengesince 1.7.20The shape of the frame, and how grandly it is announced
advancement "dragon":
frame: challengeTry itparent: "<name>"since 1.7.20The advancement it hangs under in the screen. Without one it hangs under the server's own first entry
advancement "miner":
icon: diamond pickaxe
advancement "master miner":
parent: "miner"
icon: netherite pickaxeTry itannounce: falsesince 1.7.20Do not tell everybody in chat
advancement "tutorial":
announce: falseTry ithidden: truesince 1.7.20Out of sight until somebody has it
advancement "secret room":
hidden: trueTry itgrant advancement <name> to <who>since 1.7.20Give it. The pop-up, the sound and the line in chat are the game's own
advancement "welcome":
title: "Welcome"
on first join:
grant advancement "welcome" to playerTry itrevoke advancement <name> from <who>since 1.7.20Take it back
advancement "welcome":
title: "Welcome"
command /again:
trigger:
revoke advancement "welcome" from playerTry it<who> has advancement <name>since 1.7.20A condition; does not have advancement likewise
advancement "vip":
title: "VIP"
command /lounge:
trigger:
if player has advancement "vip":
send "&aWelcome in."
else:
send "&cMembers only."Try itA script can add advancements of its own to the game's advancement screen, and hand them out:
advancement "first kill":
title: "&cFirst blood"
description: "Win a fight against another player"
icon: iron sword
frame: challenge
on player kill:
grant advancement "first kill" to player
| Written | Meaning |
|---|---|
advancement "<name>": | At the left margin. The name is what it is granted by |
title: / description: | What players read. Without a title, the name is shown |
icon: <item> | The item drawn in its frame; a book unless said otherwise |
frame: task, goal or challenge | The shape of the frame, and how grandly it is announced |
parent: "<name>" | The advancement it hangs under in the screen. Without one it hangs under the server's own first entry |
announce: false | Do not tell everybody in chat |
hidden: true | Out of sight until somebody has it |
grant advancement <name> to <who> | Give it. The pop-up, the sound and the line in chat are the game's own |
revoke advancement <name> from <who> | Take it back |
<who> has advancement <name> | A condition; does not have advancement likewise |
grant advancement does. That makes them a way of remembering as well; player has advancement "first kill" is saved by the game itself.play sound <name>since 1.4.0A Minecraft sound id such as "entity.player.levelup", or a custom one from your resource pack
play sound "ui.toast.challenge_complete" for all players in world "world"Try itwith pitch <n>since 1.4.0Optional, 0.5 (low) to 2.0 (high); the default is 1.0
play sound "block.note_block.pling" with pitch 2.0 and volume 0.5 for playerTry itand volume <n>since 1.4.0Optional; the default is 1.0. Above 1.0 the sound is not louder but carries further
play sound "block.note_block.pling" with pitch 2.0 and volume 0.5 for playerTry itat <position>since 1.4.0Play it in the world: everyone within earshot hears it coming from that spot
play sound "entity.experience_orb.pickup" with pitch 1.8 and volume 1.0 at player's locationTry itfor <who>Play it to those players only, wherever they are
play sound "ui.toast.challenge_complete" for all players in world "world"Try itfor all players in world <name>since 1.4.0To everyone in one world
play sound "ui.toast.challenge_complete" for all players in world "world"Try itfor players within <n> blocks of <location>since 1.7.45To everyone that close to a place, each hearing it as if it were beside them
play sound "entity.slime.jump" for players within 10 blocks of player's locationTry itplay sound "entity.experience_orb.pickup" with pitch 1.8 and volume 1.0 at player's location
play sound "block.note_block.pling" with pitch 2.0 and volume 0.5 for player
play sound "ui.toast.challenge_complete" for all players in world "world"
| Part | Meaning |
|---|---|
play sound <name> | A Minecraft sound id such as "entity.player.levelup", or a custom one from your resource pack |
with pitch <n> | Optional, 0.5 (low) to 2.0 (high); the default is 1.0 |
and volume <n> | Optional; the default is 1.0. Above 1.0 the sound is not louder but carries further |
at <position> | Play it in the world: everyone within earshot hears it coming from that spot |
for <who> | Play it to those players only, wherever they are |
for all players in world <name> | To everyone in one world |
for players within <n> blocks of <location> | To everyone that close to a place, each hearing it as if it were beside them |
Pitch and volume may be given in either order, or one without the other (with volume 0.5). With neither at nor for, the sound is played to the player of the trigger. An unknown sound id plays nothing and is not reported, because the server cannot know which sounds a client's resource pack adds.
send resource pack <url>since 1.4.0A direct download link to the pack's .zip file
send resource pack "https://example.com/pack.zip" with hash "da39a3ee5e6b4b0d3255bfef95601890afd80709" to playerTry itwith hash <sha1>since 1.4.0Optional: the file's SHA-1 hash, which is 40 hexadecimal characters
send resource pack "https://example.com/pack.zip" with hash "da39a3ee5e6b4b0d3255bfef95601890afd80709" to playerTry itto <who>Optional; the default is the player of this trigger
send action bar "&aDownloading server resource pack..." to playerTry iton player join:
send resource pack "https://example.com/pack.zip" with hash "da39a3ee5e6b4b0d3255bfef95601890afd80709" to player
on resource pack accept:
send action bar "&aDownloading server resource pack..." to player
on resource pack decline:
send "&cYou declined the resource pack! Some custom items may appear incorrectly."
on resource pack successfully loaded:
send "&aResource pack loaded successfully!"
play sound "ui.toast.challenge_complete" at player's location
| Part | Meaning |
|---|---|
send resource pack <url> | A direct download link to the pack's .zip file |
with hash <sha1> | Optional: the file's SHA-1 hash, which is 40 hexadecimal characters |
to <who> | Optional; the default is the player of this trigger |
accept and then either successfully loaded or failed; decline comes instead of all of those.Blocks, places, creatures and things that float in the air.
set time in world <name> to <ticks>since 1.4.0Time of day: 0 is sunrise, 1000 day, 6000 noon, 13000 night, 18000 midnight
set time in world "%player.world%" to 1000Try itset weather in world <name> to <weather>since 1.4.0clear, rain or thunder
set weather in world "%player.world%" to clearTry itset block at <position> to <block>since 1.5.5Replace 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 airTry itset <variable> to <block name>since 1.7.65Keep 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 itplace <block> at <position>since 1.7.67Another 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 itblock data at <position>since 1.7.67The 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 itblock at <position>since 1.5.5The 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 itcreate region <name> from <location> to <location>since 1.4.0Define (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 itdelete region <name>since 1.4.0Remove it
delete region "spawn"Try itspawn firework at <location>since 1.7.1Launch 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 1Try itplay effect <name> at <location>since 1.7.1A built-in visual such as smoke, ender_signal or mobspawner_flames
play effect ender_signal at player's locationTry itset line <n> of sign at <location> to <text>since 1.7.1Write on a sign; line <n> of sign at <location> reads it
set line 1 of sign at {shop.sign} to "&a[Open]"Try ititems in chest at <location>since 1.7.1A list of the items in a chest or other container
for each {_item} in items in chest at {reward.chest}:
give {_item} to playerTry itadd <item> to chest at <location> / clear chest at <location>since 1.7.1Put items in a container, or empty it
clear chest at {reward.chest}
add 3 diamond to chest at {reward.chest}Try itremove <item> from chest at <location>since 1.7.44Take 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 itnumber of <item> in chest at <location>since 1.7.44How many of that item the container holds, over all its slots
set {_gold} to number of gold ingot in chest at {_chest}Try itchest slot <n> at <location>since 1.7.44The 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 itset gamerule <name> of world <name> to <value>since 1.7.1Change 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 trueTry itset difficulty of world <name> to <level>since 1.7.1peaceful, easy, normal or hard; difficulty of world <name> reads it
set difficulty of world "world" to hardTry itset pvp of world <name> to <true or false>since 1.7.1Whether players can hurt each other in that world
set pvp of world "world" to falseTry itset pvp of region <name> to <true or false>since 1.7.1The same for one region; HyperScript stops the fighting itself
on load:
set pvp of region "spawn" to falseTry itset build of region <name> to <true or false>since 1.7.1Whether blocks can be broken and placed in a region
on load:
set build of region "spawn" to falseTry itplayers in region <name>since 1.7.1A list of the names of the players inside
for each {_name} in players in region "arena":
send "&cThe match starts now!" to {_name}Try itentities in region <name>since 1.7.44A list of the creatures inside, players not among them
set {_inside} to size of entities in region "arena"Try itrandom location in region <name>since 1.7.44A 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 itspawn of world <name>since 1.7.1The world's spawn point, as a location
teleport player to spawn of world "world"Try itcreate hologram <name> at <location> with lines <text>, <text>since 1.7.2Floating 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 itset line <n> of hologram <name> to <text>since 1.7.2Rewrite 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 itdelete hologram <name>since 1.7.2Take a hologram away
delete hologram "welcome"Try ithologramssince 1.7.2A list of the names of every hologram
send "&7Holograms: &f" + join holograms with ", "Try itset fake block at <position> to <block>since 1.7.13Show 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 itclear fake block at <position>since 1.7.13Show 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 playerTry itset fake blocks from <location> to <location> to <block>since 1.7.14A 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 itclear fake blocks from <location> to <location>since 1.7.14Shows 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 itclear all fake blockssince 1.7.14Every fake block scripts have shown the player, wherever it is; for <who> or for all players likewise
on world change:
clear all fake blocksTry itstrike lightning at <location>since 1.7.0A real bolt; strike fake lightning at only looks like one
strike lightning at player's locationTry itcreate explosion at <location> [with power <n>]since 1.7.0Power 4 is TNT. Add without breaking blocks and with fire as needed
create explosion at player's location with power 3 without breaking blocksTry itfill from <location> to <location> with <block>since 1.7.0Set 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 stoneTry itfill from <location> to <location> with <block> replacing <block>since 1.7.67Only 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 stoneTry itfill from <location> to <location> with <block> hollowsince 1.7.67Only 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 hollowTry itbreak blocks from <location> to <location>since 1.7.67Break 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 dropsTry itshow cracks <n> on block at <location>since 1.7.67The 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 itclear cracks on block at <location>since 1.7.67Take them away again
set {_loc} to location below player's location
clear cracks on block at {_loc}Try itdrop block <block> at <location>since 1.7.67The 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 locationTry itcopy blocks from <location> to <location> as <name>since 1.7.15Remember 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 itpaste <name>since 1.7.15Put 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 itdelete copy <name>since 1.7.15Forget a copy
command /forgetarena:
permission: arena.admin
trigger:
delete copy "arena-clean"Try itbreak block at <location>since 1.7.0As if mined: it drops what it would, with the crumbs and the sound of a block breaking
break block at location below player's locationTry itbreak block at <location> over <duration>since 1.7.66The 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 itbreak block at <location> without dropssince 1.7.66The 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 dropsTry itbreak block at <location> without particlessince 1.7.65The 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 particlesTry itgrow tree at <location>since 1.7.0Needs dirt below and room above
grow tree at player's locationTry itdrop <item> at <location>since 1.7.0Put an item on the ground
drop 1 diamond at event's locationTry itdrop loot <table> at <location>since 1.7.20Drop 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 locationTry itfill chest at <location> with loot <table>since 1.7.20Put 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 itcreate world <name>since 1.7.6Make 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 itload world <name> / unload world <name>since 1.7.6Bring 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 itdelete world <name>since 1.7.6Unload 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 itcreated worldssince 1.7.6A 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 itworld <name> existssince 1.7.36Whether 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 itset spawn of world <name> to <location>since 1.7.0Where new players and bedless respawns appear
set spawn of world "world" to player's locationTry itset world border of world <name> to <size> [over <duration>]since 1.7.0Width in blocks; over makes it move there gradually
set world border of world "world" to 500 over 5 minutesTry itregion at <location>since 1.4.0A 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 locationTry itevent's locationsince 1.4.0The block an event is about: the block being broken or clicked
if block at event's location is "bedrock":
cancel eventTry itTime and weather
set time in world "%player.world%" to 1000
set weather in world "%player.world%" to clear
| Statement | Effect |
|---|---|
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
| Syntax | Meaning |
|---|---|
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.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
| Syntax | Meaning |
|---|---|
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 |
holograms | A 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 blocks | Every 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> hollow | Only 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 drops | 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 |
break block at <location> without particles | The 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 worlds | A list of the names of the worlds scripts have made or brought in with load world, loaded or not |
world <name> exists | Whether 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 location | The 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."
plugins/HyperScript/holograms.yml. A hologram a script keeps up to date is best made in on load:, which simply replaces the old one.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.position is written as for set block: at player, at event's location, at 10, 64, -5 in "world".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.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.event's location rather than player's location. The player can stand outside a region and still reach a block inside it.<location> offset by <x>, <y>, <z>since 1.7.0The place that far away
teleport player to player's location offset by 0, 10, 0Try itlocation above <location> / location below <location>since 1.7.0One block up or down
set block at location below player's location to stoneTry itlocation <n> blocks in front of <who>since 1.7.0Where they are looking, that far away
set {_ahead} to location 3 blocks in front of playerTry itlocation <n> blocks behind <who>since 1.7.68That 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 itlocation <n> blocks left of <who>since 1.7.68That 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 itmidpoint between <a> and <b>since 1.7.0Halfway between two places
set {_middle} to midpoint between {arena.corner1} and {arena.corner2}Try ithighest block at <location>since 1.7.0The top block of that column, as a location
teleport player to location above highest block at player's locationTry itbiome at <location>since 1.7.0The biome's name, e.g. plains
send "&7Biome: &f" + biome at player's locationTry itlight level at <location>since 1.7.00 (dark) to 15 (bright)
if light level at player's location < 8:
send "&7Mobs can spawn here."Try ittarget block of <who>since 1.7.0The 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 itblock (below/above) <who>since 1.7.45The 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 2Try itvehicle of <who>since 1.7.45What they are riding, as a creature; unset if they are on foot
set {_mount} to vehicle of playerTry it<location> is within <n> blocks of <location>since 1.7.0A condition
if player's location is within 10 blocks of {spawn}:
send "&aYou are near spawn."Try it<location> is loadedsince 1.7.0Whether that part of the world is loaded
if {arena} is loaded:
summon zombie at {arena}Try itWays 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
| Syntax | Result |
|---|---|
<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 loaded | Whether 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".
last summoned entitysince 1.7.0The creature the last summon of this trigger made
set {_boss} to last summoned entityTry itevent entitysince 1.7.0The creature the current event is about
on mob spawn:
set {_mob} to event entity
set name of {_mob} to "&cWild thing"Try itvictim entity / attacker entitysince 1.7.0In on entity damage: the creatures themselves, not their names
push victim entity backward with force 0.8Try itclicked entitysince 1.7.0In on entity click
on entity click:
push clicked entity upward with force 0.6Try ittarget entity of <who>since 1.7.0What they are looking at, up to 50 blocks away
set {_looking} to target entity of player
if {_looking} is set:
send "&7You are looking at &f%{_looking}%"Try itname of <entity> / health of <entity>since 1.7.27Read or set. How much health it can have is given when it is summoned: with health <n>
set name of {_boss} to "&c&lThe Boss"Try itkill <who>since 1.7.0Works on a player or an entity
kill arg.1 as playerTry itkill <who> as <who>since 1.7.39The same, but the server takes it for a kill by the second one, a player or a creature: the death message names them, %event.killer% is them, and they get the drops, the experience and the credit other plugins give for a kill. kill arg.1 as player
kill arg.1 as playerTry itmake <creature> follow <who>since 1.7.17It walks after them until told otherwise, or until either is gone. make <creature> stop following ends it. Needs a Paper server
command /pet:
trigger:
summon wolf named "&b%player%'s pet" at player
set {%player%.pet} to last summoned entity
make {%player%.pet} follow playerTry itmake <creature> walk to <location>since 1.7.17It finds its own way there, if there is one. Needs a Paper server
command /callguard:
trigger:
summon iron golem at player
make last summoned entity walk to location 10 blocks in front of playerTry itmake <creature> stay still / make <creature> move againsince 1.7.17Takes away its own will, so it neither walks nor turns nor is pushed; and gives it back
command /statue:
trigger:
summon zombie named "&7Statue" at player silent
make last summoned entity stay stillTry itmake <who> look at <location>since 1.7.37Turn a player or a creature so that they face that place. The place is a location, x, y, z, or somebody: make player look at arg.1 looks them in the eyes. They stay where they are; only where they look changes
make player look at arg.1Try itmake <who> look northsince 1.7.37Turn them straight north, east, south or west, or make them look up or down
make player look northTry itmake <who> ride <creature> / make <who> dismountsince 1.7.17Seat a player, or another creature, on top of one
command /mount:
trigger:
summon horse at player
make player ride last summoned entityTry itmake <who> swing armsince 1.7.70The movement of a hit, without hitting anything
make player swing armTry itdamage <who> by <n>since 1.7.0Hurt by that much; 2 is one heart
damage tool of player by 25Try itpush <who> upward / downward / forward / backward [with force <n>]since 1.7.0Shove in a direction. forwards, backwards, upwards and downwards are read the same, and at speed <n> says what with force <n> does: push player forwards at speed 2
push player upward with force 1.2Try itpush <who> towards <location> [with force <n>]since 1.7.0Shove towards a place
push player towards {spawn} with force 0.8Try itpush <who> away from <location> [with force <n>]since 1.7.67Shove the other way: away from an explosion, a boss, a wall
push player away from {boss.place} with force 1.5Try itpush <who> left / right [with force <n>]since 1.7.67Shove sideways, as they stand
push player left with force 0.8Try itlaunch <who> [upward] [at speed <n>] [without fall damage]since 1.7.67A push, upward unless another direction is named. With without fall damage the landing does not hurt, which is what a jump pad wants; push takes those words too
on right click:
if block is "slime_block":
launch player upward at speed 2 without fall damageTry itmake <entity> target <who>since 1.7.0Send a mob after someone
make {_boss} target playerTry itremove entity <entity>since 1.7.0Make it disappear
summon zombie at player's location
set {_mob} to last summoned entity
wait 10 seconds
remove entity {_mob}Try itremove all <type> within <n> blocks of <location>since 1.7.0Clear out every creature of a kind nearby
remove all zombies within 20 blocks of player's locationTry itwith health <n>since 1.7.15Its health, in half hearts, up to 2048. It starts at full health
summon iron golem named "&bGuardian" at player with health 400Try itwith speed <n>since 1.7.15How fast it moves, as a multiple of what is normal for it: 2 is twice as fast, 0.5 half
summon 5 zombie at player with speed 1.6Try itwith damage <n>since 1.7.15How hard it hits, in half hearts. Only creatures that attack have it
summon zombie named "&4Brute" at player with damage 20Try itholding <item>since 1.7.15What it has in its hand
summon zombie at player holding iron sword enchanted with sharpness 3Try itwearing <item>, <item>since 1.7.15Its armour; each piece goes where it belongs, and anything that is not armour goes on its head
summon zombie at player wearing diamond helmet, iron chestplate, iron bootsTry itdropping <item>, <item>since 1.7.15What it leaves behind when it dies, instead of what such a creature usually drops. dropping nothing for nothing at all
summon chicken named "&6Golden hen" at player dropping 3 gold ingotTry itglowing, silent, babysince 1.7.15An outline that shows through walls; no sounds; a young one
summon villager at player glowing silent babyTry itinvisiblesince 1.7.17It cannot be seen; what it holds and wears still can. Minecraft 1.16.3 or newer
summon armor stand at player invisible holding diamond swordTry itsmall, marker, with arms, without gravity, without base platesince 1.7.17For an armor stand: half size; nothing can touch or select it; arms to hold things in; it floats where it was put; no stone plate under it. without gravity works on any creature
command /trophy:
trigger:
summon armor stand named "&6Champion" at player small with arms without base plate holding golden apple wearing diamond helmetTry itset drops to <item>, <item>since 1.7.15Replace what falls. set drops to nothing, or clear drops, for nothing
on entity death:
if event.entity is "creeper":
set drops to 3 gunpowder, 1 tntTry itadd <item> to dropssince 1.7.15One more thing, on top of the rest
on entity death:
if event.entity is "zombie":
if chance of 10%:
add 1 emerald to dropsTry itmake <who> shoot a <projectile>since 1.7.42The same as shoot <projectile> from <who>, said the other way round. Add at speed <n>: make player shoot an arrow at speed 3
make player shoot a small fireball at speed 2Try itshoot <projectile> from <who>since 1.7.15Launch an arrow, snowball, egg, fireball, small fireball, ender pearl, trident or the like, the way they are looking. Add with speed <n>: 1 is a gentle throw, 3 a fully drawn bow
on right click with blaze rod:
if player is on cooldown "fireball":
stop
start cooldown "fireball" of 2 seconds
shoot small fireball from player with speed 2Try itA mob or animal can be kept in a variable and told what to do, just like a player.
command /boss:
permission: op
trigger:
summon zombie at player's location with health 100
set {_boss} to last summoned entity
set name of {_boss} to "&c&lThe Boss"
make {_boss} target player
on entity damage:
if attacker is "zombie":
push victim entity backward with force 0.8
| Syntax | Meaning |
|---|---|
last summoned entity | The creature the last summon of this trigger made |
event entity | The creature the current event is about |
victim entity / attacker entity | In on entity damage: the creatures themselves, not their names |
clicked entity | In on entity click |
target entity of <who> | What they are looking at, up to 50 blocks away |
name of <entity> / health of <entity> | Read or set. How much health it can have is given when it is summoned: with health <n> |
kill <who> | Works on a player or an entity |
kill <who> as <who> | The same, but the server takes it for a kill by the second one, a player or a creature: the death message names them, %event.killer% is them, and they get the drops, the experience and the credit other plugins give for a kill. kill arg.1 as player |
make <creature> follow <who> | It walks after them until told otherwise, or until either is gone. make <creature> stop following ends it. Needs a Paper server |
make <creature> walk to <location> | It finds its own way there, if there is one. Needs a Paper server |
make <creature> stay still / make <creature> move again | Takes away its own will, so it neither walks nor turns nor is pushed; and gives it back |
make <who> look at <location> | Turn a player or a creature so that they face that place. The place is a location, x, y, z, or somebody: make player look at arg.1 looks them in the eyes. They stay where they are; only where they look changes |
make <who> look north | Turn them straight north, east, south or west, or make them look up or down |
make <who> ride <creature> / make <who> dismount | Seat a player, or another creature, on top of one |
make <who> swing arm | The movement of a hit, without hitting anything |
damage <who> by <n> | Hurt by that much; 2 is one heart |
push <who> upward / downward / forward / backward [with force <n>] | Shove in a direction. forwards, backwards, upwards and downwards are read the same, and at speed <n> says what with force <n> does: push player forwards at speed 2 |
push <who> towards <location> [with force <n>] | Shove towards a place |
push <who> away from <location> [with force <n>] | Shove the other way: away from an explosion, a boss, a wall |
push <who> left / right [with force <n>] | Shove sideways, as they stand |
launch <who> [upward] [at speed <n>] [without fall damage] | A push, upward unless another direction is named. With without fall damage the landing does not hurt, which is what a jump pad wants; push takes those words too |
make <entity> target <who> | Send a mob after someone |
remove entity <entity> | Make it disappear |
remove all <type> within <n> blocks of <location> | Clear out every creature of a kind nearby |
"%{_boss}%" works in text.push player upward with force 1.2, kill arg.1. <who> means a player or an entity; <entity> means it only makes sense for one.remove all takes zombie, zombies, any other type, mobs (every hostile and passive mob) or entities (everything but players), up to 128 blocks away. Players are never removed.Creatures of your own. After the position, summon takes any of these, in any order:
| Written | Effect |
|---|---|
with health <n> | Its health, in half hearts, up to 2048. It starts at full health |
with speed <n> | How fast it moves, as a multiple of what is normal for it: 2 is twice as fast, 0.5 half |
with damage <n> | How hard it hits, in half hearts. Only creatures that attack have it |
holding <item> | What it has in its hand |
wearing <item>, <item> | Its armour; each piece goes where it belongs, and anything that is not armour goes on its head |
dropping <item>, <item> | What it leaves behind when it dies, instead of what such a creature usually drops. dropping nothing for nothing at all |
glowing, silent, baby | An outline that shows through walls; no sounds; a young one |
invisible | It cannot be seen; what it holds and wears still can. Minecraft 1.16.3 or newer |
small, marker, with arms, without gravity, without base plate | For an armor stand: half size; nothing can touch or select it; arms to hold things in; it floats where it was put; no stone plate under it. without gravity works on any creature |
glowing, silent and baby before the items. After an item, glowing belongs to the item (dropping 1 stick glowing drops a shimmering stick).dropping.What a creature leaves behind can also be changed when it dies, in on entity death::
on entity death:
if event.entity is "zombie":
add 1 emerald to drops
if event.entity is "creeper":
set drops to 3 gunpowder, 1 tnt
| Statement | Effect |
|---|---|
set drops to <item>, <item> | Replace what falls. set drops to nothing, or clear drops, for nothing |
add <item> to drops | One more thing, on top of the rest |
make <who> shoot a <projectile> | The same as shoot <projectile> from <who>, said the other way round. Add at speed <n>: make player shoot an arrow at speed 3 |
shoot <projectile> from <who> | Launch an arrow, snowball, egg, fireball, small fireball, ender pearl, trident or the like, the way they are looking. Add with speed <n>: 1 is a gentle throw, 3 a fully drawn bow |
%event.drops% is the list of what is about to fall, in on entity death: as in on block break:.
Shooting, turning and the tab list:
command /blast:
trigger:
set player's pitch to 0
set player's yaw to -90
make player shoot a small fireball at speed 2
make player shoot an arrow
command /ghost <player>:
permission: "ghost.use"
trigger:
hide player from tab list of arg.1
send "&7%arg.1% no longer sees you on the list."
wait 30 seconds
show player in tab list of arg.1
A kill that counts for somebody:
command /smite <player>:
permission: "smite.use"
trigger:
if arg.1 is not a player:
send "&c%arg.1% is not online."
stop
strike fake lightning at player's location
kill arg.1 as player
send "&eYou smote %arg.1%."
Turning somebody to face a place, a player or a direction:
command /lookat <player>:
trigger:
make player look at arg.1
make arg.1 look at player's location
command /spawnview:
trigger:
make player look at 0, 80, 0
wait 2 seconds
make player look north
type: <creature>since 1.7.28What kind of creature it is: zombie, skeleton, iron golem. A zombie if left out
mob "Guard Dog":
type: wolf
health: 40
command /dog:
players only: true
trigger:
spawn mob "Guard Dog" at player's locationTry itname: <text>since 1.7.28The name shown above it; the block's own name if left out, and name: none for no name
mob "elite":
type: zombie
name: "&c&lElite Zombie"
health: 60Try ithealth: <n>since 1.7.28Its health, in half hearts, up to 2048
mob "Tank":
type: iron golem
health: 400Try itdamage: <n>since 1.7.28How hard it hits, for a creature that attacks
mob "Brute":
type: zombie
damage: 12Try itspeed: <n>since 1.7.28How fast it is, as a multiple of what such a creature usually is: 1.5 is half as fast again
mob "Runner":
type: zombie
speed: 1.6
baby: trueTry itholding: <item>since 1.7.28What it has in its hand
mob "Knight":
type: zombie
holding: diamond swordTry itwearing: <item>, <item>since 1.7.28Its armour; each piece goes where it belongs
mob "Knight":
type: zombie
wearing: diamond helmet, diamond chestplateTry itdrops: <item>, <item>since 1.7.28What it leaves when it dies, in place of what such a creature usually drops. drops: nothing for nothing
mob "Treasure Zombie":
type: zombie
drops: 5 diamond, 1 golden appleTry itexperience: <n>since 1.7.28The experience it leaves
mob "Sage":
type: villager
experience: 200
drops: nothingTry itglowing: true / silent: true / baby: truesince 1.7.28As it says
mob "Marked One":
type: zombie
glowing: true
silent: trueTry iton spawn:since 1.7.28Runs when one is spawned. player is whoever's script spawned it, if anybody
mob "Herald":
type: zombie
on spawn:
broadcast "&cA herald has appeared!"Try iton death:since 1.7.28Runs when one dies. player is who killed it; there is none if nobody did
mob "Bounty":
type: zombie
health: 80
on death:
if player is set:
add 100 to {%player%.coins}
send "&a+100 coins for the bounty."Try iton hit:since 1.7.17Runs when it hurts a player, who is player
enchantment lightning:
on hit:
if chance of 20%:
strike lightning at victimTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.attacker% | attacker | text | Who dealt the damage: a player's name or a mob type such as zombie. For an arrow or other projectile this is whoever shot it. Unset for damage with no attacker, such as falling |
%event.victim% | victim | text | Who was hurt: a player's name or a mob type |
%event.damage% | damage | number | Damage actually taken, after armour and effects; 2 is one heart |
%event.cause% | cause | text | Why: FALL, FIRE, ENTITY_ATTACK, PROJECTILE, DROWNING, VOID and so on |
%event.entity% | entity | text | The victim's entity type, e.g. player or zombie |
%event.location% | location | Where the victim is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The victim if a player was hurt; otherwise the attacker if a player dealt the damage; otherwise nobodyon hurt:since 1.7.17Runs when a player hurts it; player is that player
enchantment dodge:
on hurt:
if chance of 10%:
cancel event
send "&7Dodged!"Try itspawn mob <name> at <location>since 1.7.28Make one of a described mob there. last summoned entity is the creature
command /boss:
permission: op
players only: true
trigger:
spawn mob "Frost Giant" at player's location
set {_giant} to last summoned entity
make {_giant} target playerTry itmob name of <entity>since 1.7.28Which mob block a creature was made from, as its name; unset for any other creature
command /summongiant:
permission: op
players only: true
trigger:
spawn mob "Frost Giant" at player's location
set {_made} to last summoned entity
send "&7That is a &f" + mob name of {_made}Try itA mob block describes a creature once: what it is, how strong, what it carries and drops, and what happens when it dies. spawn mob then makes one wherever you like.
mob "&bFrost Giant":
type: zombie
health: 100
damage: 8
holding: diamond axe
wearing: diamond helmet, diamond chestplate
drops: 3 diamond, 1 ice
experience: 50
on death:
broadcast "&bThe Frost Giant has fallen to %player.name%!"
on hit:
apply slowness 2 to player for 3 seconds
command /giant:
permission: "mobs.spawn"
players only: true
trigger:
spawn mob "Frost Giant" at player's location
| Inside the block | Meaning |
|---|---|
type: <creature> | What kind of creature it is: zombie, skeleton, iron golem. A zombie if left out |
name: <text> | The name shown above it; the block's own name if left out, and name: none for no name |
health: <n> | Its health, in half hearts, up to 2048 |
damage: <n> | How hard it hits, for a creature that attacks |
speed: <n> | How fast it is, as a multiple of what such a creature usually is: 1.5 is half as fast again |
holding: <item> | What it has in its hand |
wearing: <item>, <item> | Its armour; each piece goes where it belongs |
drops: <item>, <item> | What it leaves when it dies, in place of what such a creature usually drops. drops: nothing for nothing |
experience: <n> | The experience it leaves |
glowing: true / silent: true / baby: true | As it says |
on spawn: | Runs when one is spawned. player is whoever's script spawned it, if anybody |
on death: | Runs when one dies. player is who killed it; there is none if nobody did |
on hit: | Runs when it hurts a player, who is player |
on hurt: | Runs when a player hurts it; player is that player |
| Syntax | Meaning |
|---|---|
spawn mob <name> at <location> | Make one of a described mob there. last summoned entity is the creature |
mob name of <entity> | Which mob block a creature was made from, as its name; unset for any other creature |
{_mob} is the creature and {_name} its mob's name; in on hit: and on hurt: {_damage} is how much damage was done. cancel event in those two stops the damage."Frost Giant" or "frost giant".mob block of that name.health: {boss.health} takes the saved variable as it is then. Local variables cannot be used in them.create npc <name> at <location>since 1.7.23Make a character there, a villager unless said otherwise. With a name that is taken, the character is moved. Colours in the name are shown; it is known by the name without them, in lower case
command /setguide:
permission: npc.admin
players only: true
trigger:
create npc "&aGuide" at player's location
send "&aThe guide stands here now."Try itcreate npc <name> as <entity> at <location>since 1.7.23The same as another creature: as iron golem, as armor stand
command /setguard:
permission: npc.admin
players only: true
trigger:
create npc "&7Guard" as iron golem at player's locationTry itdelete npc <name>since 1.7.23Take a character away
command /removeguide:
permission: npc.admin
trigger:
delete npc "guide"Try iton npc click <name>:since 1.7.23At the left margin: runs when a player right-clicks that character; without a name, any character. {_npc} is its name
on npc click "guide":
send "&aGuide: &fThe arena is that way."Try itnpc <name>since 1.7.23The creature itself, for what works on a creature: set name of npc "guide" to "...", make player ride npc "guide", remove entity npc "guide". To move a character, create npc it again at the new place
command /announce:
permission: npc.admin
trigger:
make npc "guide" say "The event starts in five minutes!"Try itall npcssince 1.7.23A list of the names of every character
command /npcs:
trigger:
send "&7Characters: &f" + join all npcs with ", "Try itA character is a creature that stands where you put it, cannot be hurt or pushed, and runs a block of your script when a player clicks it: a shopkeeper, a quest giver, a guide.
on load:
create npc "&aGuide" at 10.5, 64, -3.5 in "world"
on npc click "guide":
send "&aGuide: &fWelcome, %player%! The shop is to your left."
| Syntax | Meaning |
|---|---|
create npc <name> at <location> | Make a character there, a villager unless said otherwise. With a name that is taken, the character is moved. Colours in the name are shown; it is known by the name without them, in lower case |
create npc <name> as <entity> at <location> | The same as another creature: as iron golem, as armor stand |
delete npc <name> | Take a character away |
on npc click <name>: | At the left margin: runs when a player right-clicks that character; without a name, any character. {_npc} is its name |
npc <name> | The creature itself, for what works on a creature: set name of npc "guide" to "...", make player ride npc "guide", remove entity npc "guide". To move a character, create npc it again at the new place |
all npcs | A list of the names of every character |
on load: is safe, because making it again only moves it.create npc and on npc click are its, and make Citizens characters.spawn text display <text> at <position>Floating text that always faces the viewer
spawn text display "&6Welcome, %player.name%!" at player for 10 secondsTry itspawn block display <block> at <position>A floating block that cannot be walked into or broken
spawn block display "diamond_block" at 0, 80, 0 in "world"Try itspawn particle <name> at <position>One particle
spawn particle "flame" at playerTry it... colored "<#rrggbb>"Hex colour, for the "dust" particle
spawn particle "dust" colored "#ff8800" count 20 at player.x, player.y + 2, player.zTry it... count <n>Number of particles (1 to 1000), spread slightly around the position
spawn particle "dust" colored "#ff8800" count 20 at player.x, player.y + 2, player.zTry it... for <n> secondsDisplays only: remove it after this long
make event entity glow for player for 10 secondsTry itshow text <text> in front of <who>since 1.7.49Text that floats in front of a player's face and follows where they look. Only that player sees it
show text "&6Welcome!%nl%&7Have a look around" in front of playerTry itshow text <text> in front of <who> for <duration>since 1.7.49The same, gone after that long
show text "&aSaved." in front of player for 3 secondsTry itshow text <text> in front of <who> until <condition>since 1.7.49The same, gone as soon as the condition holds
show text "&7Sneak to close this" in front of player until player is sneakingTry itshow text <text> in front of <who> while <condition>since 1.7.49The same, gone as soon as the condition no longer holds
show text "&cYou are in the arena" in front of player while player is in region "arena"Try itshow text <text> in front of <who> at distance <n>since 1.7.49How many blocks in front of the eyes, from 0.5 to 16; 2.2 when it is not said. Goes before for, until or while
show text "&eLook here" in front of player at distance 4 for 5 secondsTry itshow text <text> in front of <who> lockedsince 1.7.51The same, fastened to the player: it keeps up with them as they walk and turn instead of gliding after them. Goes before for, until or while too
show text "&aSaved." in front of player locked for 3 secondsTry ithide text in front of <who>since 1.7.49Take it away now
hide text in front of playerTry itspawn text display "&6Welcome, %player.name%!" at player for 10 seconds
spawn block display "diamond_block" at 0, 80, 0 in "world"
spawn particle "flame" at player
spawn particle "dust" colored "#ff8800" count 20 at player.x, player.y + 2, player.z
| Statement | Effect |
|---|---|
spawn text display <text> at <position> | Floating text that always faces the viewer |
spawn block display <block> at <position> | A floating block that cannot be walked into or broken |
spawn particle <name> at <position> | One particle |
... colored "<#rrggbb>" | Hex colour, for the "dust" particle |
... count <n> | Number of particles (1 to 1000), spread slightly around the position |
... for <n> seconds | Displays only: remove it after this long |
show text <text> in front of <who> | Text that floats in front of a player's face and follows where they look. Only that player sees it |
show text <text> in front of <who> for <duration> | The same, gone after that long |
show text <text> in front of <who> until <condition> | The same, gone as soon as the condition holds |
show text <text> in front of <who> while <condition> | The same, gone as soon as the condition no longer holds |
show text <text> in front of <who> at distance <n> | How many blocks in front of the eyes, from 0.5 to 16; 2.2 when it is not said. Goes before for, until or while |
show text <text> in front of <who> locked | The same, fastened to the player: it keeps up with them as they walk and turn instead of gliding after them. Goes before for, until or while too |
hide text in front of <who> | Take it away now |
A position is either at player or at <x>, <y>, <z>, optionally followed by in "<world>". Without a world, the player's world is used. at player places a display just above the player's head and a particle at body height.
Text in front of a player. show text ... in front of <who> puts text before one player's eyes. It moves with them and turns as they look around, nobody else sees it, and it goes when they leave the server.
command /tutorial:
trigger:
show text "&6Welcome!%nl%&7Open the chest in front of you" in front of player until player is sneaking
wait 1 second
send "&7Sneak to close the hint."
on player death:
show text "&cYou died%nl%&7Respawning..." in front of victim for 3 seconds
%nl% in the text starts a new line; a list gives a line for each element: show text ["&6Shop", "&7Right-click to buy"] in front of player.hide text in front of <who> or until the player leaves or dies. for 10 seconds gives it a time. until <condition> looks at the condition four times a second and takes the text away once it is true; while <condition> is the other way round. for and one of the two can be used together, and whichever comes first ends it.{_local} variables, with the values they had at the end of the trigger.locked it is put where the player is about to be, going on as they are going, and gets there within a tick: show text "&aSaved." in front of player locked for 3 seconds. It is as quick as a server can make it; what the player sees still depends on their connection.Numbers that float up. show floating text <text> at <position> puts text there that drifts up a block and is gone after a second or so (for 2 seconds to say how long). Everybody nearby sees it. It is how damage numbers are made:
on entity damage:
show floating text "&c-%event.damage%" at victim
on block break:
add 5 to {%player%.coins}
show floating text "&6+5" at player
Each one is put a little to one side, so that several do not hide one another.
Pointing the way. point <who> to <location> draws a short trail of sparks from the player towards a place, which only they see and which moves as they do. It ends when they are within a few blocks of the place, when they change world, with stop pointing <who>, or with for, until or while as above.
command /quest:
trigger:
point player to {quest.chest} until {%player%.quest} is "done"
send "&7Follow the sparks."
A glow one player sees. make <entity> glow for <who> gives a creature or a player the white outline that shows through walls, for that one player only; for 30 seconds gives it a time, and make <entity> stop glowing for <who> takes it away.
on entity click:
make event entity glow for player for 10 seconds
This one talks to the game in a way the server has no official means for, so it needs a Paper server, version 1.20.5 or newer. Anywhere else it does nothing and says so once in the log. The outline is white; a colour of one's own is not possible this way.
for ... seconds stays until the server restarts or the plugin is disabled. Displays are never written to the world file, so they cannot be left behind."flame", "heart", "cloud", "end_rod". Use "dust" for coloured particles; it works on every supported version.villager_happy became happy_villager, spell_witch became witch, fireworks_spark became firework, and so on). Either name works on every version. /hyperscript particle lists the ones your server has, and /hyperscript particle flame shows one in front of you.player's location, which means the same as player, or be a location held in a variable: at {%player%.home}.circledraw particle circle with radius <r> using particle <name> at <position> · A flat ring. Around a player it lies on the ground at their feet
draw particle circle with radius 2 using particle "flame" at player's locationTry itspheredraw particle sphere with radius <r> using particle <name> at <position> · A hollow ball with evenly spread points
draw particle sphere with radius 3 using particle "dust" colored "#00ffaa" with 200 points at 0, 80, 0Try itlinedraw particle line from <position> to <position> using particle <name> · A straight line; both ends must be in the same world
draw particle line from player to 0, 80, 0 using particle "end_rod"Try itboxsince 1.7.53draw particle box from <position> to <position> using particle <name> · The edges of a box between two corners
draw particle box from 0, 60, 0 to 10, 70, 10 using particle "flame" for 10 secondsTry itoutlinesince 1.7.53draw particle outline of region <name> using particle <name> · The edges of a script region
draw particle outline of region arg.1 using particle "end_rod" visible to player for 10 secondsTry ithelixsince 1.7.53draw particle helix with radius <r> and height <h> using particle <name> at <position> · A coil that winds upwards; add and 3 turns to say how often
draw particle helix with radius 1 and height 2 using particle "end_rod" at effect location rising 1 blocks over 1 secondTry itspiralsince 1.7.53draw particle spiral with radius <r> using particle <name> at <position> · A flat line winding outwards from the middle
draw particle spiral with radius 3 using particle "end_rod" at playerTry itstarsince 1.7.53draw particle star with radius <r> using particle <name> at <position> · A flat star with five tips
draw particle star with radius 2 using particle "flame" at player spinning for 5 secondsTry itheartsince 1.7.53draw particle heart with size <n> using particle <name> at <position> · A heart standing upright, turned towards the player of the trigger
draw particle heart with size 2 using particle "dust" colored "#ff3366" at player for 3 secondsTry itbeamsince 1.7.53draw particle beam from <position> to <position> using particle <name> · A short stretch of light that travels from one end to the other; over 1 second says how long it takes
draw particle beam from player to 0, 80, 0 using particle "end_rod" over 1 secondTry ittextsince 1.7.53draw particle text <text> using particle <name> at <position> · Letters made of particles, turned towards the player of the trigger; with size 2 after the text for bigger ones
show floating text "&6+5" at playerTry itfor <duration>since 1.7.53The shape stays that long instead of fading after a second
give player a trail of "dust" colored "#ffaa00" for 5 minutesTry ituntil <condition> / while <condition>since 1.7.53It stays until the condition holds, or while it does
set {_left} to time until schedule "restart"Try itaround <who> (in place of at <position>)since 1.7.53It stays with that creature or player as they move
draw particle circle with radius 1 using particle "flame" around player for 30 secondsTry itvisible to <who>since 1.7.53Only they see it; only for <who> says the same
draw particle outline of region arg.1 using particle "end_rod" visible to player for 10 secondsTry itspinningsince 1.7.53It turns round its middle; spinning at speed 2 for two turns a second
draw particle circle with radius 1 using particle "dust" colored "#ff66cc" to "#66ccff" around player spinning for 30 secondsTry itgrowing to radius <r> over <duration>since 1.7.53It grows (or shrinks) from its radius to that one: a shockwave
draw particle circle with radius 0.5 using particle "flame" at effect location growing to radius 3 over 1 secondTry itrising <n> blocks over <duration>since 1.7.53It lifts that far
draw particle helix with radius 1 and height 2 using particle "end_rod" at effect location rising 1 blocks over 1 secondTry itcolored "<#rrggbb>"since 1.7.53The colour, for "dust"
give player a trail of "dust" colored "#ffaa00" for 5 minutesTry itcolored "<#a>" to "<#b>"since 1.7.53A shape that runs from one colour at its start to another at its end
draw particle circle with radius 1 using particle "dust" colored "#ff66cc" to "#66ccff" around player spinning for 30 secondsTry itfading to "<#rrggbb>"since 1.7.53Each particle changes to that colour while it lives. Needs Minecraft 1.17 or newer
spawn particle "dust" colored "#ff0000" fading to "#000000" count 20 at playerTry itof <block or item>since 1.7.53For "block" and "item": what the crumbs are made of, as in "block" of stone
give player a trail of "dust" colored "#ffaa00" for 5 minutesTry itcount <n>since 1.7.53How many at each point
spawn particle "witch" count 20 at event.locationTry itwith speed <n>since 1.7.15How fast they fly apart
summon 5 zombie at player with speed 1.6Try itspread <n> or spread <x>, <y>, <z>since 1.7.53How far from the point each may appear
spawn particle "cloud" count 30 spread 2, 0.2, 2 at playerTry itdraw particle renders a whole shape in one statement.
draw particle circle with radius 2 using particle "flame" at player's location
draw particle sphere with radius 3 using particle "dust" colored "#00ffaa" with 200 points at 0, 80, 0
draw particle line from player to 0, 80, 0 using particle "end_rod"
| Shape | Syntax | Result |
|---|---|---|
circle | draw particle circle with radius <r> using particle <name> at <position> | A flat ring. Around a player it lies on the ground at their feet |
sphere | draw particle sphere with radius <r> using particle <name> at <position> | A hollow ball with evenly spread points |
line | draw particle line from <position> to <position> using particle <name> | A straight line; both ends must be in the same world |
Options, written after the particle name: colored "<#rrggbb>" (for "dust") and with <n> points. Without a point count the shape picks a density that looks solid for its size. A shape never uses more than 1000 particles.
every 5 ticks for all players:
if {%player%.trail}:
draw particle circle with radius 0.6 using particle "dust" colored "#ff66cc" at player
More shapes.
| Shape | Syntax | Draws |
|---|---|---|
box | draw particle box from <position> to <position> using particle <name> | The edges of a box between two corners |
outline | draw particle outline of region <name> using particle <name> | The edges of a script region |
helix | draw particle helix with radius <r> and height <h> using particle <name> at <position> | A coil that winds upwards; add and 3 turns to say how often |
spiral | draw particle spiral with radius <r> using particle <name> at <position> | A flat line winding outwards from the middle |
star | draw particle star with radius <r> using particle <name> at <position> | A flat star with five tips |
heart | draw particle heart with size <n> using particle <name> at <position> | A heart standing upright, turned towards the player of the trigger |
beam | draw particle beam from <position> to <position> using particle <name> | A short stretch of light that travels from one end to the other; over 1 second says how long it takes |
text | draw particle text <text> using particle <name> at <position> | Letters made of particles, turned towards the player of the trigger; with size 2 after the text for bigger ones |
What can follow any shape, after its place:
| Written | Does |
|---|---|
for <duration> | The shape stays that long instead of fading after a second |
until <condition> / while <condition> | It stays until the condition holds, or while it does |
around <who> (in place of at <position>) | It stays with that creature or player as they move |
visible to <who> | Only they see it; only for <who> says the same |
spinning | It turns round its middle; spinning at speed 2 for two turns a second |
growing to radius <r> over <duration> | It grows (or shrinks) from its radius to that one: a shockwave |
rising <n> blocks over <duration> | It lifts that far |
What can follow the particle's name, in spawn particle and in a shape:
| Written | Does |
|---|---|
colored "<#rrggbb>" | The colour, for "dust" |
colored "<#a>" to "<#b>" | A shape that runs from one colour at its start to another at its end |
fading to "<#rrggbb>" | Each particle changes to that colour while it lives. Needs Minecraft 1.17 or newer |
of <block or item> | For "block" and "item": what the crumbs are made of, as in "block" of stone |
count <n> | How many at each point |
with speed <n> | How fast they fly apart |
spread <n> or spread <x>, <y>, <z> | How far from the point each may appear |
command /aura:
trigger:
draw particle circle with radius 1 using particle "dust" colored "#ff66cc" to "#66ccff" around player spinning for 30 seconds
on player death:
draw particle circle with radius 0.5 using particle "cloud" at victim's location growing to radius 5 over 1 second
command /show <region>:
trigger:
draw particle outline of region arg.1 using particle "end_rod" visible to player for 10 seconds
Trails. give <who> a trail of <particle> leaves particles where a player walks, until remove trail of <who>, or with for, until or while. Standing still leaves none.
command /trail:
trigger:
give player a trail of "dust" colored "#ffaa00" for 5 minutes
Effects with a name. A particle effect "<name>": block, at the left margin like a function, holds the particle lines of one effect; play particle effect "<name>" at <position> plays it there. Inside the block, effect location is that place.
particle effect "level up":
draw particle helix with radius 1 and height 2 using particle "end_rod" at effect location rising 1 blocks over 1 second
draw particle circle with radius 0.5 using particle "flame" at effect location growing to radius 3 over 1 second
on level up:
play particle effect "level up" at player
Things to know:
! ? . - + :; small letters are drawn as capitals, and it takes up to 24 characters."block" and "item" are the crumbs of breaking a block and of eating; the game calls them block_crack and item_crack before 1.20.5, and either name works.noise generator <kind>since 1.7.37Makes a generator. The kind is "perlin" (soft hills), "simplex" (the same, rounder), "value" (blockier blobs), "cells" (0 at points scattered about and rising between them: cracked ground, islands), "ridged" (sharp lines: ridges, rivers) or "white" (every block on its own: static)
set {_cave} to noise generator "simplex" with seed 7Try itnoise generator <kind> with seed <number>since 1.7.37Which noise it is. The same seed gives the same numbers every time, on every server; without one each generator is different. A text works as a seed too
set {_cave} to noise generator "simplex" with seed 7Try itnoise generator <kind> with scale <blocks>since 1.7.37How many blocks one hill spans; 32 if nothing is said. Larger is smoother
set {flowers} to noise generator "cells" with seed "meadow" with scale 8Try itnoise generator <kind> with octaves <n>since 1.7.37How many layers are laid over each other, each finer than the last: 1 to 8, and 1 if nothing is said. More gives more detail
set {_blobs} to noise generator "value" with octaves 2Try itnoise of <generator> at <location>since 1.7.37The number there, between 0 and 1, as on a map: only x and z count, so it is the same at every height
set {_here} to noise of {flowers} at player's locationTry itnoise of <generator> at <x>, <z>since 1.7.37The same for two numbers, and at <x>, <y>, <z> for three
set {_here} to noise of {flowers} at player's locationTry itsolid noise of <generator> at <location>since 1.7.37The number at that exact spot, height included: for caves and anything else that is not a surface
if solid noise of {_cave} at player's location > 0.6:
send "&7It feels hollow here."Try itNoise is a number for every place that changes smoothly from one place to the next: the thing hills, caves, ore veins and patches of flowers are made of. A noise generator is a value like any other, kept in a variable and asked for a number wherever one is needed. That number is always between 0 and 1.
command /hills:
permission: "hills.make"
trigger:
set {_hills} to noise generator "perlin" with seed 42 and scale 24 and octaves 3
loop 16 times:
set {_x} to x of player's location + loop-number
loop 16 times:
set {_z} to z of player's location + loop-number
set {_height} to round(noise of {_hills} at {_x}, {_z} * 12)
set block at {_x}, y of player's location + {_height}, {_z} to stone
send "&aHills made."
| Syntax | What it does |
|---|---|
noise generator <kind> | Makes a generator. The kind is "perlin" (soft hills), "simplex" (the same, rounder), "value" (blockier blobs), "cells" (0 at points scattered about and rising between them: cracked ground, islands), "ridged" (sharp lines: ridges, rivers) or "white" (every block on its own: static) |
noise generator <kind> with seed <number> | Which noise it is. The same seed gives the same numbers every time, on every server; without one each generator is different. A text works as a seed too |
noise generator <kind> with scale <blocks> | How many blocks one hill spans; 32 if nothing is said. Larger is smoother |
noise generator <kind> with octaves <n> | How many layers are laid over each other, each finer than the last: 1 to 8, and 1 if nothing is said. More gives more detail |
noise of <generator> at <location> | The number there, between 0 and 1, as on a map: only x and z count, so it is the same at every height |
noise of <generator> at <x>, <z> | The same for two numbers, and at <x>, <y>, <z> for three |
solid noise of <generator> at <location> | The number at that exact spot, height included: for caves and anything else that is not a surface |
on player join:
# The same generator every time, because it has a seed.
set {flowers} to noise generator "cells" with seed "meadow" with scale 8
set {_here} to noise of {flowers} at player's location
if {_here} < 0.2:
send "&dYou are standing in a flower patch."
set {_cave} to noise generator "simplex" with seed 7
if solid noise of {_cave} at player's location > 0.6:
send "&7It feels hollow here."
set {_static} to noise generator "white" with seed 1
set {_ridge} to noise generator "ridged" with seed 3 with scale 64 with octaves 4
set {_blobs} to noise generator "value" with octaves 2
send "%noise of {_static} at 1, 2% %noise of {_ridge} at 1, 2, 3% %noise of {_blobs} at 5, 5%"
with or and: with seed 42 and scale 24 and octaves 3.{hills}; it is the recipe that is kept, not a table of numbers, so it costs nothing to store.noise of {_n} at {_x}, {_z} * 20 is a height between 0 and 20, and if noise of ... > 0.7: picks out about the highest third.move camera of <who> from <location> to <location> over <duration>since 1.7.17They watch from a point that travels between the two places, starting and stopping gently. Add looking at <location> to keep something in view; otherwise the camera looks the way it travels
on first join:
set {_high} to player's location offset by 0, 25, 0
move camera of player from {_high} to player's location over 4 secondsTry itstop camera of <who>since 1.7.17End it early
command /skip:
trigger:
stop camera of player
send "&7Skipped."Try itset border of <who> to <n> blocks around <location>since 1.7.17A world border only they have, n blocks from edge to edge. Needs Minecraft 1.18.2 or newer
command /plot:
trigger:
set border of player to 32 blocks around player's location
send "&7This is your plot."Try itreset border of <who>since 1.7.17They get the world's own border back
on world change:
reset border of playerTry itFor an entrance, an introduction or the moment a boss appears: a camera that glides through the world, and a border only one player has.
command /intro:
players only: true
trigger:
set {_from} to player's location offset by 0, 20, -30
set {_to} to player's location offset by 0, 6, -6
move camera of player from {_from} to {_to} over 6 seconds looking at player's location
wait 6 seconds
send title "&6Welcome" to player
| Statement | Effect |
|---|---|
move camera of <who> from <location> to <location> over <duration> | They watch from a point that travels between the two places, starting and stopping gently. Add looking at <location> to keep something in view; otherwise the camera looks the way it travels |
stop camera of <who> | End it early |
set border of <who> to <n> blocks around <location> | A world border only they have, n blocks from edge to edge. Needs Minecraft 1.18.2 or newer |
reset border of <who> | They get the world's own border back |
wait for as long as it takes, as above, when the next thing should happen at the end.Items of your own making.
enchantment <name>:since 1.7.17At the left margin. One to four plain words, not the name of one of the game's enchantments
enchantment lifesteal:
max level: 3
on hit:
add {_level} to health of playerTry itmax level: <n>since 1.7.17The highest level that counts, 5 unless you say otherwise; an item with more acts as if it had this many
enchantment thorns of fire:
max level: 2
on hurt:
ignite attacker for 3 secondsTry iton hit:since 1.7.17Runs when a player hits something with the item in their main hand. victim, damage and the rest are there as in on hit:
enchantment lightning:
on hit:
if chance of 20%:
strike lightning at victimTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%event.attacker% | attacker | text | Who dealt the damage: a player's name or a mob type such as zombie. For an arrow or other projectile this is whoever shot it. Unset for damage with no attacker, such as falling |
%event.victim% | victim | text | Who was hurt: a player's name or a mob type |
%event.damage% | damage | number | Damage actually taken, after armour and effects; 2 is one heart |
%event.cause% | cause | text | Why: FALL, FIRE, ENTITY_ATTACK, PROJECTILE, DROWNING, VOID and so on |
%event.entity% | entity | text | The victim's entity type, e.g. player or zombie |
%event.location% | location | Where the victim is | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The victim if a player was hurt; otherwise the attacker if a player dealt the damage; otherwise nobodyon hurt:since 1.7.17Runs when a player is hurt by someone while wearing the item, or holding it in either hand
enchantment dodge:
on hurt:
if chance of 10%:
cancel event
send "&7Dodged!"Try iton block break:Runs when a player breaks a block with the item in their main hand
enchantment prospector:
on block break:
if event.block is "stone":
if chance of 5%:
give player 1 gold nuggetTry itWhat this event gives a script
| Placeholder | Short form | Type | Meaning |
|---|---|---|---|
%player% | player | player | The player the event is about; use it wherever a player is expected |
%event.block% | block | text | The block type, e.g. diamond_ore |
%event.location% | location | Where the block is | |
%event.drops% | list | The items the block will drop with the tool in the player's hand | |
x of event's location | number | The x of %event.location%, as a number | |
y of event's location | number | The y of %event.location%, as a number: how high it is | |
z of event's location | number | The z of %event.location%, as a number |
player is: The player breaking the blockA script can make up an enchantment: a name, and what happens when an item that carries it is used.
enchantment lifesteal:
max level: 3
on hit:
add {_level} to health of player
command /vampire:
trigger:
give player 1 iron sword enchanted with lifesteal 2
| Line | Meaning |
|---|---|
enchantment <name>: | At the left margin. One to four plain words, not the name of one of the game's enchantments |
max level: <n> | The highest level that counts, 5 unless you say otherwise; an item with more acts as if it had this many |
on hit: | Runs when a player hits something with the item in their main hand. victim, damage and the rest are there as in on hit: |
on hurt: | Runs when a player is hurt by someone while wearing the item, or holding it in either hand |
on block break: | Runs when a player breaks a block with the item in their main hand |
{_level} is the level on the item, and player is whoever holds it.enchanted with lifesteal 2, alone or among the game's own (enchanted with sharpness 5, lifesteal 1), in give, in an item <name>:, or with enchant tool of player with .... Any script can use an enchantment another file defines.Lifesteal II) and has no enchantment shimmer because of it; add glowing for that. They cannot be had from an enchanting table or combined on an anvil.recipe for <item>:since 1.7.14At the left margin. What is made: any item, with an amount if more than one, such as 4 oak planks or an item of your own
recipe for 4 oak planks:
ingredients: oak logTry itshape: "<row>", "<row>", "<row>"since 1.7.14One to three rows of the crafting grid, each one to three characters and all the same length. A letter is an ingredient, a space is an empty square
recipe for 1 golden apple:
shape: " g ", "gag", " g "
g: gold ingot
a: appleTry it<letter>: <item>since 1.7.14What a letter of the shape stands for, such as d: diamond
recipe for 2 arrow:
shape: "f", "s"
f: feather
s: stickTry itingredients: <item>, <item>since 1.7.14Instead of a shape: what is needed, in any arrangement. 2 stick counts twice; nine at most
recipe for 1 name tag:
ingredients: paper, 2 stickTry itsmelting recipe for <item>:since 1.7.15At the left margin: a furnace recipe. Under it from: <item> says what is smelted; time: 10 seconds and experience: 0.5 may follow
smelting recipe for 2 gold ingot:
from: gold block
time: 5 seconds
experience: 1Try itA script can add crafting recipes to the server:
item magic wand:
blaze rod named "&dMagic wand" glowing
recipe for magic wand:
shape: " d ", " s ", " s "
d: diamond
s: stick
recipe for 4 oak planks:
ingredients: oak log
| Line | Meaning |
|---|---|
recipe for <item>: | At the left margin. What is made: any item, with an amount if more than one, such as 4 oak planks or an item of your own |
shape: "<row>", "<row>", "<row>" | One to three rows of the crafting grid, each one to three characters and all the same length. A letter is an ingredient, a space is an empty square |
<letter>: <item> | What a letter of the shape stands for, such as d: diamond |
ingredients: <item>, <item> | Instead of a shape: what is needed, in any arrangement. 2 stick counts twice; nine at most |
smelting recipe for <item>: | At the left margin: a furnace recipe. Under it from: <item> says what is smelted; time: 10 seconds and experience: 0.5 may follow |
shape: or ingredients:, not both.recipe for is for the crafting table and smelting recipe for for the furnace; smithing recipes are not covered.Brewing. A brewing recipe for <item>: says what a brewing stand makes: from: is what stands in the bottles' place, and with: what is put in on top.
brewing recipe for 1 gold block:
from: stone
with: diamond
Brewing recipes need a Paper server, version 1.18 or newer; elsewhere the script says so when it loads. on brew: runs whenever a stand finishes, on every server. Potions themselves are items like any other: give player 1 potion with potion "swiftness".
nbt <key> of tool of <who>since 1.7.42What is kept under that key on the item in their hand; unset if there is nothing. It can be set and deleted: set nbt "kills" of tool of player to 5, delete nbt "kills" of tool of player
send "&7%nbt of tool of player%"Try itnbt <key> of block at <location>since 1.7.42The same on a block that can keep data: a chest, a barrel, a sign, a furnace and the like. A plain block such as stone cannot
set nbt "locked" of block at {_chest} to trueTry itnbt <key> of <who>since 1.7.42The same on a player or a creature
delete nbt "tutorial" of playerTry it<item> with nbt <key> <value>since 1.7.43An item that carries that data from the start: give player diamond sword with nbt "owner" player.name. It may be said several times, and goes with named, with lore and the rest
set {_trophy} to gold ingot named "&6Trophy" with nbt "winner" player.name with nbt "year" 2026Try itnbt <key> of <item>since 1.7.43The same read from an item in a variable: nbt "owner" of {_item}
delete nbt "tutorial" of playerTry itnbt of tool of <who>since 1.7.42The whole NBT of the item as one text, to look at; nbt of <who> likewise for a creature. Only where the server can say it; elsewhere it is unset
send "&7%nbt of tool of player%"Try itset nbt of tool of <who> to <text>since 1.7.43Lays the game's own tags over what the item has, written as the game writes them: "{Unbreakable:1b}". On Minecraft 1.20.5 and newer an item's tags are written in square brackets, as /give takes them
set nbt of tool of player to "{Unbreakable:1b}"Try itset nbt of <creature> to <text>since 1.7.43The same for a creature: set nbt of {_mob} to "{NoAI:1b,Silent:1b}". The game does not let a player's own NBT be changed
set nbt of event entity to "{Silent:1b}"Try itset nbt of block at <location> to <text>since 1.7.43The same for a block that has NBT, such as a chest or a spawner
set nbt of block at target block of player to "{Lock:\"secret\"}"Try itData can be kept on a thing itself: on the item in somebody's hand, on a creature or a player, or on a block that holds something (a chest, a sign, a furnace). The server saves it in the thing's NBT, so it travels with the item from player to player and is still there after a restart.
command /soulbind:
trigger:
set nbt "owner" of tool of player to player.name
set nbt "kills" of tool of player to 0
send "&dThis item is yours now."
on entity death:
if killer is set:
if nbt "owner" of tool of player is player.name:
set {_kills} to nbt "kills" of tool of player + 1
set nbt "kills" of tool of player to {_kills}
send action bar "&7Kills with this item: &f%{_kills}%" to player
on right click:
if nbt "locked" of block at event's location is true:
if nbt "owner" of block at event's location is not player.name:
cancel event
send "&cThis is not yours."
command /lock:
trigger:
set {_chest} to target block of player
set nbt "locked" of block at {_chest} to true
set nbt "owner" of block at {_chest} to player.name
set nbt "visits" of player to nbt "visits" of player + 1
delete nbt "tutorial" of player
send "&7%nbt of tool of player%"
command /trophy:
permission: "trophy.give"
trigger:
set {_trophy} to gold ingot named "&6Trophy" with nbt "winner" player.name with nbt "year" 2026
give player {_trophy}
set {_winner} to nbt "winner" of {_trophy}
send "&7It says: %{_winner}%"
set nbt of tool of player to "{Unbreakable:1b}"
on mob spawn:
if event.entity is "zombie":
set nbt of event entity to "{Silent:1b}"
command /fillchest:
permission: "fill.use"
trigger:
set nbt of block at target block of player to "{Lock:\"secret\"}"
| Syntax | What it does |
|---|---|
nbt <key> of tool of <who> | What is kept under that key on the item in their hand; unset if there is nothing. It can be set and deleted: set nbt "kills" of tool of player to 5, delete nbt "kills" of tool of player |
nbt <key> of block at <location> | The same on a block that can keep data: a chest, a barrel, a sign, a furnace and the like. A plain block such as stone cannot |
nbt <key> of <who> | The same on a player or a creature |
<item> with nbt <key> <value> | An item that carries that data from the start: give player diamond sword with nbt "owner" player.name. It may be said several times, and goes with named, with lore and the rest |
nbt <key> of <item> | The same read from an item in a variable: nbt "owner" of {_item} |
nbt of tool of <who> | The whole NBT of the item as one text, to look at; nbt of <who> likewise for a creature. Only where the server can say it; elsewhere it is unset |
set nbt of tool of <who> to <text> | Lays the game's own tags over what the item has, written as the game writes them: "{Unbreakable:1b}". On Minecraft 1.20.5 and newer an item's tags are written in square brackets, as /give takes them |
set nbt of <creature> to <text> | The same for a creature: set nbt of {_mob} to "{NoAI:1b,Silent:1b}". The game does not let a player's own NBT be changed |
set nbt of block at <location> to <text> | The same for a block that has NBT, such as a chest or a spawner |
true / false.is set: if nbt "owner" of tool of player is not set:."kills", is HyperScript's own and no other plugin touches it. A key written with a colon, such as "otherplugin:level", is what another plugin keeps under that name, and can be read and changed the same way.nbt "kills" of ...) is data of your own, kept apart from the game's, and it is what a script should use for its own bookkeeping. The whole NBT (set nbt of ... to "{...}") is the game's own tags, for what has no statement of its own. What is written there is handed to the game as it is, so a tag the game does not know is refused by the game, and the console says so.set health of, enchanting an item, unbreakable. They work the same on every version; the names of the game's tags do not.tagged and with model are still the simple way to mark an item a script hands out; see Players.Keeping things, and talking to everything that is not this server.
create file <name> [at <folder>]since 1.3.0Create an empty file, with any missing folders. An existing file is left untouched
create file "proplayer300data.txt" at "plugins/HyperScript/"Try itset file at <path> to <text>since 1.3.0Replace the file's content, creating the file if needed. A list is written one element per line
set file at "plugins/HyperScript/coins.csv" to csv of {_rows}Try itappend <text> to file at <path>since 1.3.0Add to the end of the file; write "%nl%..." to start a new line
append "\n%player.name% joined" to file at "plugins/HyperScript/log.txt"Try itread file at <path>since 1.3.0The file's whole text; unset if the file does not exist
set {_proplayer300data} to read file at "plugins/HyperScript/proplayer300data.txt"Try itfile at <path> existssince 1.3.0A condition: if file at {_path} exists:
if file at "plugins/HyperScript/notes.txt" exists:
send read file at "plugins/HyperScript/notes.txt"Try itdelete file at <path>since 1.3.0Remove the file; no error if it is not there
delete file at "plugins/HyperScript/notes/old.txt"Try itlines of file at <path>since 1.7.31The file's lines as a list, to loop over or count; unset if the file does not exist
set {_lines} to lines of file at {_path}Try itsize of file at <path>since 1.7.31How large the file is, in bytes; unset if it does not exist
add size of file at "%{_notes}%/%{_path}%" to {_bytes}Try itlast modified of file at <path>since 1.7.31When it was last written to, as a date; unset if it does not exist
set {_when} to last modified of file at {_path}Try itcopy file at <path> to <path>since 1.7.31A second copy under another name or in another folder. What is there already is replaced
copy file at "%{_notes}%/%{_path}%" to "%{_backup}%/%{_path}%"Try itmove file at <path> to <path>since 1.7.31The same file somewhere else, or under another name: this is how a file is renamed
move file at {_from} to "plugins/HyperScript/archive/%arg.1%.txt"Try itfiles in <folder>since 1.7.31The names of the files in a folder, as a list in the order of the alphabet
set {_names} to files in {_folder}Try itfolders in <folder>since 1.7.31The names of the folders in it
set {_groups} to folders in {_notes}Try itall files in <folder>since 1.7.31Every file in the folder and the folders inside it, each as its path from that folder: logs/monday.txt
for each {_path} in all files in {_notes}:
copy file at "%{_notes}%/%{_path}%" to "%{_backup}%/%{_path}%"
add size of file at "%{_notes}%/%{_path}%" to {_bytes}Try itfolder at <path> existssince 1.7.31A condition: if folder at "plugins/HyperScript/logs" exists:
if folder at {_backup} exists:
delete folder at {_backup} with its filesTry itcreate folder <path>since 1.7.31Make a folder, with any missing folders around it. One that is there is left as it is
create folder {_backup}Try itdelete folder at <path>since 1.7.31Remove an empty folder. Add with its files to remove one with everything in it
delete folder at {_backup} with its filesTry ityaml value <key> of file at <path>since 1.7.63One value out of a YAML file, such as another plugin's config.yml, by its path written with dots: yaml value "shop.prices.diamond" of file at "plugins/Shop/config.yml". A number, text, true or false, a list, or for a section a table of what is in it; unset if there is nothing there. Read only, and within the folders scripts may read
command /shopprice:
trigger:
set {_price} to yaml value "prices.diamond" of file at "plugins/HyperScript/shop.yml"
send "&7A diamond costs &f%{_price}%"Try itcsv of file at <path>since 1.7.49The rows of a .csv file as a list, each row a list of its cells: item 2 of item 1 of {_rows} is the second cell of the first row. Unset if the file does not exist
set {_rows} to csv of file at "plugins/HyperScript/prices.csv"
if {_rows} is not set:
send "&cThere is no prices.csv."
stop
send "&7The first cell is %item 1 of item 1 of {_rows}%."Try itcsv of file at <path> with headerssince 1.7.49The same with the first row as the names of the columns: each later row is a table, read as {_row.price}
set {_rows} to csv of file at "plugins/HyperScript/prices.csv" with headers
for each {_row} in {_rows}:
send "&e%{_row.item}% &7costs &f%{_row.price}%"Try itcolumn <which> of <rows>since 1.7.49One column of such rows, top to bottom: by its number, or by its name for rows read with headers
set {_rows} to csv of file at "plugins/HyperScript/prices.csv" with headers
set {_prices} to column "price" of {_rows}
send "&7Prices: %{_prices}%"Try itcsv of <rows>since 1.7.49Rows as CSV text, to write with set file at. A list of lists is a line each; a list of tables gets a first line with the names
set {_rows} to [["player", "coins"], [player.name, {%player%.coins}]]
set file at "plugins/HyperScript/coins.csv" to csv of {_rows}Try itparse <text> as csvsince 1.7.49Text with commas in it as rows; add with headers as above
set {_rows} to parse "diamond,120%nl%stick,0.5" as csv
send "&7%size of {_rows}% rows; the first costs %item 2 of item 1 of {_rows}%"Try itall scriptssince 1.7.32The names of the files in the scripts folder, as a list: Kits.hs, games/Duels.hs
for each {_script} in all scripts:
if {_script} is not this script:
delete script {_script}Try itthis scriptsince 1.7.32The name of the file the line is in
if {_script} is not this script:
delete script {_script}Try itscript <name> existssince 1.7.32A condition. The name may be written with or without .hs
if not script "Sidebar" exists:
send "&cThere is no Sidebar.hs here."
stopTry itenabled scriptssince 1.7.70The scripts that are switched on, as a list. disabled scripts for those that are not, by the names they have when they are on
command /loaded:
trigger:
send "&aOn: &f%enabled scripts%"
send "&7Off: &f%disabled scripts%"Try itscript <name> is enabledsince 1.7.70A condition; is disabled for the other. A script that is not there is neither
if script "Kits" is enabled:
send "&aKits are switched on."Try iterror of script <name>since 1.7.70What a script failed to load with, such as line 12: Expected 'to' but found 'too'; unset for one that loaded
command /why <script>:
trigger:
set {_error} to error of script arg.1
if {_error} is set:
send "&c%arg.1% did not load: &f%{_error}%"
else:
send "&a%arg.1% has no mistake in it."Try itdisable script <name>since 1.7.70Switch a script off, the way /hyperscript disable does: its file is kept, with disabled_ in front of its name, and the scripts are read again a moment later. enable script <name> switches it back on
command /events <state>:
permission: "events.admin"
trigger:
if arg.1 is "off":
disable script "Events"
else:
enable script "Events"Try itdelete script <name>since 1.7.32Take a script out of the scripts folder. It is not destroyed: it is moved to plugins/HyperScript/removed-scripts, from where it can be put back
delete script {_script}Try itoption <name> of script <name>since 1.7.32What that script's options: block says for one option, without quotes; unset if it has no such option
set option "name" of script "Sidebar" to arg.1Try itset option <name> of script <name> to <value>since 1.7.32Write another value into that script's options: block. The rest of the file, and a note after the value, stay as they are
set option "name" of script "Sidebar" to arg.1Try itScripts can keep plain text files inside the plugin folder.
create file "proplayer300data.txt" at "plugins/HyperScript/"
set file at "plugins/HyperScript/proplayer300data.txt" to "Coins:500"
set {_proplayer300data} to read file at "plugins/HyperScript/proplayer300data.txt"
set {_parts} to split {_proplayer300data} by ":"
| Syntax | Effect |
|---|---|
create file <name> [at <folder>] | Create an empty file, with any missing folders. An existing file is left untouched |
set file at <path> to <text> | Replace the file's content, creating the file if needed. A list is written one element per line |
append <text> to file at <path> | Add to the end of the file; write "%nl%..." to start a new line |
read file at <path> | The file's whole text; unset if the file does not exist |
file at <path> exists | A condition: if file at {_path} exists: |
delete file at <path> | Remove the file; no error if it is not there |
lines of file at <path> | The file's lines as a list, to loop over or count; unset if the file does not exist |
size of file at <path> | How large the file is, in bytes; unset if it does not exist |
last modified of file at <path> | When it was last written to, as a date; unset if it does not exist |
copy file at <path> to <path> | A second copy under another name or in another folder. What is there already is replaced |
move file at <path> to <path> | The same file somewhere else, or under another name: this is how a file is renamed |
files in <folder> | The names of the files in a folder, as a list in the order of the alphabet |
folders in <folder> | The names of the folders in it |
all files in <folder> | Every file in the folder and the folders inside it, each as its path from that folder: logs/monday.txt |
folder at <path> exists | A condition: if folder at "plugins/HyperScript/logs" exists: |
create folder <path> | Make a folder, with any missing folders around it. One that is there is left as it is |
delete folder at <path> | Remove an empty folder. Add with its files to remove one with everything in it |
yaml value <key> of file at <path> | One value out of a YAML file, such as another plugin's config.yml, by its path written with dots: yaml value "shop.prices.diamond" of file at "plugins/Shop/config.yml". A number, text, true or false, a list, or for a section a table of what is in it; unset if there is nothing there. Read only, and within the folders scripts may read |
csv of file at <path> | The rows of a .csv file as a list, each row a list of its cells: item 2 of item 1 of {_rows} is the second cell of the first row. Unset if the file does not exist |
csv of file at <path> with headers | The same with the first row as the names of the columns: each later row is a table, read as {_row.price} |
column <which> of <rows> | One column of such rows, top to bottom: by its number, or by its name for rows read with headers |
csv of <rows> | Rows as CSV text, to write with set file at. A list of lists is a line each; a list of tables gets a first line with the names |
parse <text> as csv | Text with commas in it as rows; add with headers as above |
CSV files. A .csv file is what a spreadsheet saves: a line for each row, commas between the cells. csv of file at reads one into rows, and the rows are lists inside a list, so every cell is reached with item:
command /prices:
trigger:
set {_rows} to csv of file at "plugins/HyperScript/prices.csv" with headers
for each {_row} in {_rows}:
send "&e%{_row.item}% &7costs &f%{_row.price}%"
set {_prices} to column "price" of {_rows}
send "&7All prices: %{_prices}%"
command /export:
trigger:
set {_rows} to [["player", "coins"]]
for each {_name} in server.players:
add [{_name}, {%{_name}%.coins}] to {_rows}
set file at "plugins/HyperScript/coins.csv" to csv of {_rows}
send "&aWritten."
true and false are themselves, an empty cell is not set, and everything else is text. 007 stays text, so that ids keep their zeros.with headers, the names of the columns are taken in lower case: a column Price is {_row.price}.Paths are written relative to the server folder, with forward slashes, as in "plugins/HyperScript/notes.txt".
command /notes:
permission: "notes.read"
trigger:
set {_folder} to "plugins/HyperScript/notes"
set {_names} to files in {_folder}
if size of {_names} == 0:
send "&7There are no notes."
stop
send "&6%size of {_names}% notes:"
for each {_name} in {_names}:
set {_path} to "%{_folder}%/%{_name}%"
set {_lines} to lines of file at {_path}
set {_when} to last modified of file at {_path}
set {_day} to {_when} formatted as "d MMM"
send " &f%{_name}% &8- &7%size of {_lines}% lines, changed %{_day}%"
command /archive <text>:
permission: "notes.admin"
trigger:
set {_from} to "plugins/HyperScript/notes/%arg.1%.txt"
if not file at {_from} exists:
send "&cThere is no note called %arg.1%."
stop
move file at {_from} to "plugins/HyperScript/archive/%arg.1%.txt"
send "&aArchived."
command /backupnotes:
permission: "notes.admin"
trigger:
set {_notes} to "plugins/HyperScript/notes"
set {_backup} to "plugins/HyperScript/notes-backup"
if folder at {_backup} exists:
delete folder at {_backup} with its files
create folder {_backup}
set {_bytes} to 0
for each {_path} in all files in {_notes}:
copy file at "%{_notes}%/%{_path}%" to "%{_backup}%/%{_path}%"
add size of file at "%{_notes}%/%{_path}%" to {_bytes}
set {_groups} to folders in {_notes}
send "&aCopied %{_bytes}% bytes from %size of {_groups}% folders of notes."
on load:
# An empty folder left over from last time goes; one with something in it is left alone.
if size of (files in "plugins/HyperScript/temp") == 0:
delete folder at "plugins/HyperScript/temp"
files in gives an empty list, not a mistake.files in and folders in may be asked of "plugins/HyperScript" itself; HyperScript's own files and folders are left out of the answer. A listing has at most 1000 names.move file and copy file make the folders the new place needs.Scripts that look after scripts. The scripts folder is closed to the statements above, so that a path made from what a player typed can never reach it. A script that sets a server up can still see which scripts there are, take one out, and read and change another's options:
command /cleanup:
permission: "hyperscript.admin"
trigger:
for each {_script} in all scripts:
if {_script} is not this script:
delete script {_script}
send "&aEvery other script was taken out."
command /servername <text>:
permission: "hyperscript.admin"
trigger:
if not script "Sidebar" exists:
send "&cThere is no Sidebar.hs here."
stop
set {_old} to option "name" of script "Sidebar"
set option "name" of script "Sidebar" to arg.1
send "&aThe sidebar was called %{_old}% and is now called %arg.1%."
| Syntax | Effect |
|---|---|
all scripts | The names of the files in the scripts folder, as a list: Kits.hs, games/Duels.hs |
this script | The name of the file the line is in |
script <name> exists | A condition. The name may be written with or without .hs |
enabled scripts | The scripts that are switched on, as a list. disabled scripts for those that are not, by the names they have when they are on |
script <name> is enabled | A condition; is disabled for the other. A script that is not there is neither |
error of script <name> | What a script failed to load with, such as line 12: Expected 'to' but found 'too'; unset for one that loaded |
disable script <name> | Switch a script off, the way /hyperscript disable does: its file is kept, with disabled_ in front of its name, and the scripts are read again a moment later. enable script <name> switches it back on |
delete script <name> | Take a script out of the scripts folder. It is not destroyed: it is moved to plugins/HyperScript/removed-scripts, from where it can be put back |
option <name> of script <name> | What that script's options: block says for one option, without quotes; unset if it has no such option |
set option <name> of script <name> to <value> | Write another value into that script's options: block. The rest of the file, and a note after the value, stay as they are |
/hyperscript reload, which a script can do with execute console command "hyperscript reload".set option stops the trigger and says so. Ask first with option ... of script ... is set.files.enabled like everything else here.plugins/HyperScript/. A path that leads anywhere else, including through .. or an absolute path, stops the trigger with a warning in the console.config.yml, data.json, the database, and the scripts and backups folders.%player.uuid%, over raw player input in a path.read file refuses files larger than 1 MB.async:.files.enabled: false in config.yml turns all of this off.run sql <statement>since 1.7.23Run a statement that changes something: INSERT, UPDATE, DELETE, CREATE TABLE
on load:
run sql "CREATE TABLE IF NOT EXISTS visits (player VARCHAR(16), day VARCHAR(10))"Try itsql rows of <query>since 1.7.23Run a SELECT. The result is a list with a table for each row, its columns by their names in lower case. Up to 10,000 rows
command /visits:
trigger:
async:
set {_rows} to sql rows of "SELECT day FROM visits WHERE player = ?" with player.name
send "&7You have visited on %size of {_rows}% day(s)."Try itwith <value>, <value>since 1.7.23After either: the values for the question marks in the statement, in order
on player join:
run sql "INSERT INTO visits (player, day) VALUES (?, ?)" with player.name, server.dateTry itWhen HyperScript keeps its variables in a database (storage.type is sqlite, h2 or mysql), scripts can ask that database questions of their own: read what a website or another plugin wrote, or keep a table that is theirs.
on load:
run sql "CREATE TABLE IF NOT EXISTS purchases (player VARCHAR(16), item VARCHAR(40), day VARCHAR(10))"
command /bought:
players only: true
trigger:
async:
set {_rows} to sql rows of "SELECT item, day FROM purchases WHERE player = ?" with player.name
send "&7You have bought %size of {_rows}% thing(s)."
| Syntax | Meaning |
|---|---|
run sql <statement> | Run a statement that changes something: INSERT, UPDATE, DELETE, CREATE TABLE |
sql rows of <query> | Run a SELECT. The result is a list with a table for each row, its columns by their names in lower case. Up to 10,000 rows |
with <value>, <value> | After either: the values for the question marks in the statement, in order |
with, never into the statement itself. ... WHERE name = ? with arg.1 is safe whatever arg.1 is; gluing arg.1 into the text lets a player rewrite your question.async: block, as above.hyperscript_variables and hyperscript_shared. Leave those two to HyperScript.storage.type: json or csv there is no database, and these two say so when they run.Variables several servers have in common. With storage.shared-variables: true and every server using the same database, a variable whose name starts with shared. is the same on all of them: set {shared.event} to "double coins" on one server is what {shared.event} gives on the others a couple of seconds later (storage.shared-refresh). Every other variable stays each server's own. A shared variable is written the moment it changes; two servers changing the same one at the same moment do not add up, the later one wins, so add 1 to {shared.votes} from several servers at once can lose a count. A player's shared value is written with their name or id in it: {shared.coins.%player.uuid%}.
send get request to <url>since 1.4.0Fetch a URL; the value is the response body as text
set {_response} to send get request to "https://api.mojang.com/users/profiles/minecraft/" + urlencoded arg.1Try itsend post request to <url> with body <text>since 1.4.0Send data. A body starting with { or [ is sent as JSON, anything else as plain text
send post request to "https://api.example.com/v1/analytics" with body "{\"event\":\"command_used\",\"player\":\"%player.name%\"}"Try itheaders <text>, <text>, ...since 1.4.0Optional, after the body: lines such as "Authorization: Bearer abc"
async:
send post request to "https://api.example.com/v1/events" with body "{\"type\":\"join\"}" headers "Authorization: Bearer abc123"Try it{_body}since 1.7.17What was sent, as text; json value "<path>" of {_body} reads from it if it is JSON
on web request "/announce":
broadcast "&e[Web] &f%{_body}%"Try it{_method}since 1.7.17GET, POST, ...
on web request "/ping":
log "%{_method}% from %{_address}%"Try it{_path}since 1.7.17The address asked for, e.g. /vote
on web request:
log "Something asked for %{_path}%"Try it{_query}since 1.7.17What came after ? in the address, without the token
on web request "/give":
log "Asked with: %{_query}%"Try it{_address}since 1.7.17Where the request came from
on web request "/vote":
log "A vote arrived from %{_address}%"Try itScripts can call web APIs. A request waits for the server on the other end, so one whose answer you use has to be inside an async: block; HyperScript refuses to run it on the server thread rather than freeze the game.
command /lookup <player>:
trigger:
send "&eFetching data from the API..."
async:
set {_response} to send get request to "https://api.mojang.com/users/profiles/minecraft/" + urlencoded arg.1
set {_uuid} to json value "id" of {_response}
sync:
if {_uuid} is set:
send "&aFound UUID for %arg.1%: &f%{_uuid}%"
else:
send "&cPlayer profile not found."
command /postanalytics:
trigger:
send post request to "https://api.example.com/v1/analytics" with body "{\"event\":\"command_used\",\"player\":\"%player.name%\"}"
| Syntax | Meaning |
|---|---|
send get request to <url> | Fetch a URL; the value is the response body as text |
send post request to <url> with body <text> | Send data. A body starting with { or [ is sent as JSON, anything else as plain text |
headers <text>, <text>, ... | Optional, after the body: lines such as "Authorization: Bearer abc" |
set {_r} to send get request ...), a request must be in async:. Used as a statement, where nothing reads the answer, it may appear anywhere and is sent in the background.json value "<path>" of <text> picks a value out of it, as the example does; see below.urlencoded before adding it to a URL, as above. Otherwise a player can type characters that change which address or parameters the request uses.localhost, 192.168.x.x, 10.x.x.x and similar) are refused, so a URL built from player input cannot be used to reach private services. Set web.allow-private-addresses: true in config.yml if your scripts need to call something on your own network.web.enabled: false turns web requests off.Reading JSON. json value takes a path and JSON text and gives the value found there.
set {_json} to "{\"name\":\"Steve\",\"stats\":{\"kills\":12},\"friends\":[\"Alex\",\"Bob\"]}"
log json value "name" of {_json}
log json value "stats.kills" of {_json}
log json value "friends.2" of {_json}
log size of (json value "friends" of {_json})
That logs Steve, 12, Bob and 2.
| Path step | Picks |
|---|---|
a name, such as stats | That field of an object. Capitals are ignored if there is no exact match |
a number, such as 2 | That element of a list, counting from 1 like the rest of HyperScript |
steps joined by dots, stats.kills | One inside the other |
json value.if {_value} is set: tells you whether it worked.Being called from outside. HyperScript can also listen: a voting site, a web shop or a Discord bot calls an address of the server, and a script runs.
on web request "/vote":
set {_name} to json value "username" of {_body}
broadcast "&a%{_name}% voted for the server!"
It is off until web.server.enabled is true in config.yml, and it needs web.server.token set to a secret of at least 12 characters. The address is then http://<your server>:8765/vote (the port is web.server.port), and every request has to carry the token: as a header Authorization: Bearer <token> or X-Token: <token>, or as ?token=<token> in the address.
| In the block | What it holds |
|---|---|
{_body} | What was sent, as text; json value "<path>" of {_body} reads from it if it is JSON |
{_method} | GET, POST, ... |
{_path} | The address asked for, e.g. /vote |
{_query} | What came after ? in the address, without the token |
{_address} | Where the request came from |
on web request: without an address hears every request.ok when a block ran and 404 when none listens at that address; a script cannot choose the answer. Without the right token the answer is 401 and no script runs.bind: "127.0.0.1" when it is.Everything in a trigger normally runs on the server thread, where slow code makes the whole server stutter. async: moves a block to a background thread; sync: inside it returns to the server thread.
command /highscores:
trigger:
async:
set {_ranked} to reversed sorted {scores}
set {_best} to item 1 of {_ranked}
sync:
send "&6Best score: &e%{_best}%"
send "&7Working on it..."
async: block works on its own copy of the local variables, taken when the block starts. Changes it makes are visible inside the block (including a nested sync:), not after it. Saved variables are shared as usual.sync: just to talk to the server. send, broadcast, execute, open gui and spawn are handed to the server thread automatically when used inside async:. Use sync: when several statements must happen together in one tick.cancel event has no effect inside async: because the event has already finished.set motd to <text>since 1.5.2The message of the day. \n starts the second line; & colour codes work · Spigot and Paper
set motd to random item of ["&6Welcome!", "&bNew: sky islands", "&dVote for rewards"]Try itset max players to <number>since 1.5.2The limit shown after the slash. The real limit stays as it is · Spigot and Paper
set max players to 100Try itset shown players to <number>since 1.5.2The online count shown · Paper
set shown players to server.online_players + 20Try itset player list to <text>, <text>, ...since 1.5.2The lines shown when the mouse rests on the player count; a list value works too · Paper
set player list to "&6Welcome!", "&7Survival and minigames", "&7discord.gg/example"Try ithide player countsince 1.5.2Shows ??? instead of the counts · Paper
on server ping:
hide player countTry itset server icon to <path>since 1.5.2The icon: a 64 by 64 pixel PNG inside the plugin folder, such as "plugins/HyperScript/icon.png" · Spigot and Paper
on server ping:
set server icon to "plugins/HyperScript/icon.png"Try iton server ping runs whenever a client refreshes its server list, and can change what that client sees: the message of the day, the player counts and the icon.
on server ping:
set motd to "&6My Server &7- &a%server.online_players% online\n&eDouble coins weekend!"
set max players to 100
set shown players to server.online_players + 20
set player list to "&6Welcome!", "&7Survival and minigames", "&7discord.gg/example"
| Statement | Changes | Server |
|---|---|---|
set motd to <text> | The message of the day. \n starts the second line; & colour codes work | Spigot and Paper |
set max players to <number> | The limit shown after the slash. The real limit stays as it is | Spigot and Paper |
set shown players to <number> | The online count shown | Paper |
set player list to <text>, <text>, ... | The lines shown when the mouse rests on the player count; a list value works too | Paper |
hide player count | Shows ??? instead of the counts | Paper |
set server icon to <path> | The icon: a 64 by 64 pixel PNG inside the plugin folder, such as "plugins/HyperScript/icon.png" | Spigot and Paper |
%server.motd% is the MOTD from server.properties, and %event.address% the IP address of the client asking. To rotate messages, pick one at random:
on server ping:
set motd to random item of ["&6Welcome!", "&bNew: sky islands", "&dVote for rewards"]
{%player%.*} variables and the player placeholders are unset. Global variables work.set lines: no loops, files or web requests.%hyperscript_<name>%since 1.5.6The global {<name>}
set {event_active} to true
# Any plugin that uses PlaceholderAPI can now show it:
# "Event running: %hyperscript_event_active%"Try it%hyperscript_player_<name>%since 1.5.6The viewing player's own {%player%.<name>}
set {%player%.coins} to 100
# Any plugin that uses PlaceholderAPI can now show it to that player:
# "Coins: %hyperscript_player_coins%"Try itplaceholder "<name>":since 1.7.28At the left margin of a script: a value worked out for whoever looks, shown by other plugins as %hyperscript_<name>%
placeholder "visits":
return {%player%.joins}Try itHyperScript works with two widely used plugins when they are installed. Neither is required.
Vault (money). With Vault and an economy plugin, balance of <who> is a player's money, and it can be changed like a variable:
if balance of player >= 500:
subtract 500 from balance of player
give player 1 diamond
add 100 to balance of arg.1
set balance of player to 0
PlaceholderAPI. With PlaceholderAPI, placeholder <text> fills in other plugins' placeholders:
set {_rank} to placeholder "%vault_rank%"
send placeholder "&7Your rank: %vault_rank% &8| &7Playtime: %statistic_time_played%"
set {_theirs} to placeholder "%player_level%" for arg.1
It also works the other way round. Any plugin that understands PlaceholderAPI can show script variables:
| Placeholder | Shows |
|---|---|
%hyperscript_<name>% | The global {<name>} |
%hyperscript_player_<name>% | The viewing player's own {%player%.<name>} |
placeholder "<name>": | At the left margin of a script: a value worked out for whoever looks, shown by other plugins as %hyperscript_<name>% |
placeholder "rank_colour":
if player has permission "rank.vip":
return "&6"
return "&7"
placeholder "coins_short":
if {%player%.coins} >= 1000:
set {_thousands} to round({%player%.coins} / 1000)
return "%{_thousands}%k"
return {%player%.coins}
A placeholder block is a function without anything handed to it. It runs each time another plugin asks, with player as the player the text is shown to, and what it returns is what is shown; colour codes work. A scoreboard or chat plugin may ask many times a second and not always from the server's own thread, so keep the block to reading values and working something out: no wait, and nothing that changes the world.
balance of and placeholder ... for take player or a name, and work for players who are offline. Without Vault and an economy plugin a balance is unset and cannot be changed; without PlaceholderAPI the text comes back unchanged. Either case is reported once in the console.placeholder "..." only. In ordinary text HyperScript leaves an unknown %name% exactly as written.send discord message <text> to channel <id>since 1.7.20The bot writes in that channel. The id is the long number from Discord's "Copy Channel ID". & colour codes are removed, and nobody is pinged
on player join:
send discord message "%player% joined the server" to channel "123456789012345678"Try iton discord message <id>:since 1.7.20Runs when somebody writes in that channel; without an id, in any channel the bot can read. {_message} is the text, {_user} who wrote it, {_user_id}, {_channel} and {_channel_id}
on discord message "123456789012345678":
broadcast "&9[Discord] &f%{_user}%&7: %{_message}%"Try itsend webhook <name or URL>A name from config.yml, or a full https:// URL
send webhook "alerts" with content "%player.name% joined the server" as "HyperScript"Try itwith content <text>The message, up to 2000 characters; & colour codes are removed
send webhook "alerts" with content "%player.name% joined the server" as "HyperScript"Try itas <text>Optional: the name the message is posted under
send webhook "alerts" with content "%player.name% joined the server" as "HyperScript"Try itWebhooks post a message to a Discord channel. They need no bot: create a webhook in the channel's settings, then give it a name in config.yml.
discord:
webhooks:
alerts: "https://discord.com/api/webhooks/123/abc"
on player join:
send webhook "alerts" with content "%player.name% joined the server" as "HyperScript"
| Part | Meaning |
|---|---|
send discord message <text> to channel <id> | The bot writes in that channel. The id is the long number from Discord's "Copy Channel ID". & colour codes are removed, and nobody is pinged |
on discord message <id>: | Runs when somebody writes in that channel; without an id, in any channel the bot can read. {_message} is the text, {_user} who wrote it, {_user_id}, {_channel} and {_channel_id} |
send webhook <name or URL> | A name from config.yml, or a full https:// URL |
with content <text> | The message, up to 2000 characters; & colour codes are removed |
as <text> | Optional: the name the message is posted under |
@everyone, roles or users, whatever text players manage to put in them.config.yml over URLs in scripts.Slash commands let Discord users run script code. They need a bot: create an application at the Discord developer portal, add a bot, invite it to your server with the applications.commands scope, and put its token in config.yml.
discord:
bot:
enabled: true
token: "your-bot-token"
guild-id: "123456789012345678"
on discord command "/online":
reply "%server.online_players% player(s) online: %server.players%"
on discord command "/link":
if arg.1 is not set:
reply "Usage: /link <code> (get a code with /link in game)"
stop
if {link.code.%arg.1%} is not set:
reply "That code is not valid."
stop
set {_player} to {link.code.%arg.1%}
set {link.discord.%{_player}%} to discord.user_id
delete {link.code.%arg.1%}
reply "Linked to Minecraft account %{_player}%."
reply <text> answers the person who ran the command. Reply at least once; if a trigger ends without replying, HyperScript answers "Done." so Discord is not left waiting.args. It is split on spaces into %arg.1%, %arg.2% and so on, exactly like an in-game command.{%player%.*} variables are unavailable. Use global variables or tables keyed by name, as the /link example does.guild-id set, commands appear in that server immediately. Without it they are registered globally, which Discord can take up to an hour to show.A bot that writes and listens. With the bot switched on (discord.bot in config.yml), send discord message lets a script write in any channel the bot is in, which a webhook cannot do without one address per channel. To hear what is written there, also set discord.bot.read-messages: true, and first switch on "Message Content Intent" for the bot in Discord's developer portal: without that, Discord refuses the connection. The bot never hears itself or other bots, so a script that answers cannot answer itself for ever.
Topics that have no group yet.
<who> is in combatsince 1.7.50They hit another player, or were hit by one, in the last 15 seconds
command /spawn:
trigger:
if player is in combat:
send "&cNot while you are fighting."
stop
teleport player to spawn of world "world" after 3 seconds unless they moveTry it<who> is afksince 1.7.50They have done nothing for 5 minutes: not moved, looked around, clicked, chatted or run a command
for each {_name} in server.players:
if {_name} is afk:
send "&7%{_name}% is away."Try itput <who> in combatsince 1.7.50Count them as fighting from now, as if they had been hit. for 30 seconds to say how long
put player in combat for 30 secondsTry ittake <who> out of combatsince 1.7.50The fight is over for them now
take player out of combatTry itteleport <who> to <location> after <duration>since 1.7.50Take them there once that time is over; it counts down on their action bar
teleport player to spawn of world "world" after 3 secondsTry itteleport <who> to <location> after <duration> unless they movesince 1.7.50The same, called off if they walk away meanwhile
teleport player to spawn of world "world" after 5 seconds unless they moveTry itHyperScript keeps track of two things about every player by itself, so that a script only has to ask.
| Syntax | Meaning |
|---|---|
<who> is in combat | They hit another player, or were hit by one, in the last 15 seconds |
<who> is afk | They have done nothing for 5 minutes: not moved, looked around, clicked, chatted or run a command |
put <who> in combat | Count them as fighting from now, as if they had been hit. for 30 seconds to say how long |
take <who> out of combat | The fight is over for them now |
teleport <who> to <location> after <duration> | Take them there once that time is over; it counts down on their action bar |
teleport <who> to <location> after <duration> unless they move | The same, called off if they walk away meanwhile |
command /spawn:
trigger:
if player is in combat:
send "&cNot while you are fighting."
stop
teleport player to spawn of world "world" after 5 seconds unless they move
on combat start:
send action bar "&cIn combat with %event.opponent%" to player while player is in combat
on player quit:
if player is in combat:
broadcast "&c%player.name% logged out in a fight."
on afk:
broadcast "&7%player.name% is away."
config.yml: combat-time: "15s" and afk-time: "5m". 0 switches one off.put victim in combat in on entity damage: does, if you want that.on combat start: runs once when a fight begins, not at every hit, and on combat end: when it is over. %event.opponent% is who the fight is with.on afk: and on afk return: run when a player goes away and comes back. Turning the head counts as doing something; being pushed along by water does not.config.yml under messages:, and can be changed or left empty. A second teleport ... after for the same player takes the place of the first.mute <who>since 1.7.52They cannot chat, or use the commands for talking, until unmute <who>. for 10 minutes gives it an end and because "<reason>" a reason they are told. Works for somebody who is offline, and lasts through restarts
mute arg.1Try itunmute <who>since 1.7.52They can talk again
unmute arg.1Try it<who> is mutedsince 1.7.52Whether they are; mute time left of <who> and mute reason of <who> say the rest
if arg.1 is muted:
send "&7%arg.1% is muted."Try itmake <who> invulnerablesince 1.7.52Nothing hurts them. for 5 seconds, until <condition> or while <condition> to say how long
make player invulnerableTry itmake <who> vulnerablesince 1.7.52They can be hurt again; also written unmake <who> invulnerable
make player vulnerableTry it<who> is invulnerablesince 1.7.52Whether a script made them so
if player is invulnerable:
send "&7Nothing can hurt you right now."Try itkill streak of <who>since 1.7.52How many players they have killed in a row since they last died; reset kill streak of <who> sets it back
send "&7Your streak: &c%kill streak of player%"Try itlast location of <who>since 1.7.52Where they were before they were last taken somewhere: a teleport of more than a few blocks, or to another world. Unset if there was none
command /back:
trigger:
set {_place} to last location of player
if {_place} is not set:
send "&cThere is nowhere to go back to."
stop
teleport player to {_place}Try itdeath location of <who>since 1.7.52Where they last died
set {_place} to death location of player
if {_place} is set:
teleport player to {_place}Try itstart stopwatch <name>since 1.7.52Start counting for the player, under a name; for <who> for somebody else
start stopwatch "race"Try itstop stopwatch <name>since 1.7.52Stop it. It goes on saying how long it ran
stop stopwatch "race"
set {_time} to stopwatch "race" of player
send "&aYou finished in %{_time}%."Try itstopwatch <name> of <who>since 1.7.52How long it has run, or ran until it was stopped, as a duration; unset if it was never started
set {_time} to stopwatch "race" of player
send action bar "&e%{_time}%" to playerTry itstopwatch <name> of <who> is runningsince 1.7.52Whether it is counting now
if stopwatch "race" of player is running:
send "&7You are in a race."Try itreset stopwatch <name>since 1.7.52As if it had never been started
reset stopwatch "race"Try itkeep inventorysince 1.7.52In on player death:: whoever died keeps what they carried, and nothing is dropped
on player death:
keep inventoryTry itkeep experiencesince 1.7.52In on player death:: they keep their levels
on player death:
keep experienceTry itrandom safe location within <n> blocks of <location>since 1.7.52A place around there to put a player: ground to stand on, room for the body, nothing that burns or drowns. Unset if none was found
command /rtp:
cooldown: 1 minute
trigger:
set {_place} to random safe location within 2000 blocks of spawn of world "world"
if {_place} is not set:
send "&cNo safe place was found. Try again."
stop
teleport player to {_place} after 3 seconds unless they moveTry itMore that HyperScript remembers about every player by itself.
| Syntax | Meaning |
|---|---|
mute <who> | They cannot chat, or use the commands for talking, until unmute <who>. for 10 minutes gives it an end and because "<reason>" a reason they are told. Works for somebody who is offline, and lasts through restarts |
unmute <who> | They can talk again |
<who> is muted | Whether they are; mute time left of <who> and mute reason of <who> say the rest |
make <who> invulnerable | Nothing hurts them. for 5 seconds, until <condition> or while <condition> to say how long |
make <who> vulnerable | They can be hurt again; also written unmake <who> invulnerable |
<who> is invulnerable | Whether a script made them so |
kill streak of <who> | How many players they have killed in a row since they last died; reset kill streak of <who> sets it back |
last location of <who> | Where they were before they were last taken somewhere: a teleport of more than a few blocks, or to another world. Unset if there was none |
death location of <who> | Where they last died |
start stopwatch <name> | Start counting for the player, under a name; for <who> for somebody else |
stop stopwatch <name> | Stop it. It goes on saying how long it ran |
stopwatch <name> of <who> | How long it has run, or ran until it was stopped, as a duration; unset if it was never started |
stopwatch <name> of <who> is running | Whether it is counting now |
reset stopwatch <name> | As if it had never been started |
keep inventory | In on player death:: whoever died keeps what they carried, and nothing is dropped |
keep experience | In on player death:: they keep their levels |
random safe location within <n> blocks of <location> | A place around there to put a player: ground to stand on, room for the body, nothing that burns or drowns. Unset if none was found |
command /rtp:
cooldown: 1 minute
trigger:
set {_place} to random safe location within 2000 blocks of spawn of world "world"
if {_place} is not set:
send "&cNo safe place was found. Try again."
stop
teleport player to {_place} after 3 seconds unless they move
command /back:
trigger:
set {_place} to last location of player
if {_place} is not set:
send "&cThere is nowhere to go back to."
stop
teleport player to {_place}
on player respawn:
make player invulnerable for 5 seconds
on player death:
if player has permission "vip.keep":
keep inventory
keep experience
on kill streak:
if event.streak is 5:
broadcast "&6%player.name% is on a killing spree!"
messages.muted in config.yml. The commands that count as talking are mute-commands there: /msg, /tell, /w, /me, /r and a few more.on kill streak: runs at every kill, with %event.streak% and %event.opponent%; ask for the number you want with if.cooldown: on a command that uses it. In the Nether it looks under the roof.hs. among the player's saved variables ({%player%.hs.kill_streak}, {%player%.hs.last_location} and so on). Read them if you like; change them with the lines above.quest "<name>":since 1.7.63At the left margin: makes a quest. Under it comes goal:, and name: and reward: if you want them
quest "lumberjack":
goal: break 20 oak log
reward:
give 10 bread to playerTry itgoal: break <n> <block>since 1.7.63Counted when the player breaks that block. Also place <n> <block> and kill <n> <creature>. any in place of the block or creature counts whichever it is
quest "builder":
goal: place 100 stone
reward:
send "&aA hundred stones placed."Try itgoal: craft <n> <item>since 1.7.64Counted when the player crafts that item
quest "breadmaker":
goal: craft 8 bread
reward:
send "&aEight loaves baked."Try itgoal: fish <n>since 1.7.64Counted for each catch
quest "fisher":
goal: fish 5
reward:
give 1 diamond to playerTry itgoal: walk <n> blockssince 1.7.64Counted for each block they walk into
quest "walker":
goal: walk 500 blocks
reward:
send "&aHalf a kilometre on foot."Try itgoal: reach <n> {<variable>}since 1.7.64Done when a saved variable of the player's, such as {coins}, gets to that number; how far they are is what the variable is. Looked at every two seconds
quest "rich":
goal: reach 1000 {coins}
reward:
broadcast "&6%player.name% has a thousand coins!"Try itrepeat: dailysince 1.7.64The quest may be done again: daily on each new day, weekly in each new week, or a length of time after it was done (repeat: 12 hours). Until then it stays "done"; after that it is "none" again and can be started
quest "daily miner":
goal: break 20 stone
repeat: daily
reward:
add 50 to {%player%.coins}Try ittime limit: <duration>since 1.7.64How long the player has. When the time is up the quest is "none" again, as if it had been stopped
quest "sprint":
goal: walk 200 blocks
time limit: 1 minute
reward:
send "&aFast enough!"Try itgoal: do <n>since 1.7.63A quest a script counts itself, with advance quest: for talking to somebody, winning a game, anything the server cannot see by itself
quest "helper":
goal: do 3
reward:
send "&aYou helped three times."
command /helped <target:player>:
permission: "staff.helped"
trigger:
advance quest "helper" for arg.1Try itreward:since 1.7.63The lines under it run as the player when they reach the goal
quest "hunter":
goal: kill 5 zombie
reward:
give 1 iron sword to player
send "&aFive zombies down."Try itstart quest <name>since 1.7.63The player has the quest, from the beginning; for <who> for somebody else. Starting it again starts it over
quest "digger":
goal: break 10 stone
command /dig:
trigger:
start quest "digger"
send "&eBreak ten stone."Try itstop quest <name>since 1.7.63They no longer have it, and what was counted is gone
quest "runner":
goal: do 5
command /giveup:
trigger:
stop quest "runner"
send "&7Quest dropped."Try itadvance quest <name>since 1.7.63Counts one towards it; by <n> counts more. Nothing happens for a player who does not have the quest
quest "talker":
goal: do 2
command /talk:
trigger:
advance quest "talker"Try itquest progress <name>since 1.7.63How far the player is, as a number; of <who> for somebody else
quest "stonecutter":
goal: break 30 stone
command /progress:
trigger:
set {_done} to quest progress "stonecutter"
send "&7%{_done}% of 30"Try itquest goal <name>since 1.7.63How many the quest asks for
quest "baker":
goal: do 12
command /bakergoal:
trigger:
set {_loaves} to quest goal "baker"
send "&7Bake %{_loaves}% loaves."Try itquest state <name>since 1.7.63"none", "active" or "done"; of <who> for somebody else
quest "guard":
goal: kill 3 zombie
command /guardquest:
trigger:
if quest state "guard" is "none":
start quest "guard"Try itall questssince 1.7.63The names of every quest scripts have made
command /quests:
trigger:
send "&7Quests: &f%all quests%"Try itactive questssince 1.7.64The names of the quests the player has and has not finished; of <who> for somebody else
command /myquests:
trigger:
set {_mine} to active quests
send "&7Your quests: &f%{_mine}%"Try iton quest progress "<name>":since 1.7.64Runs each time a player gets further with a quest. {_quest} is its name, {_progress} how far they are and {_goal} how far they have to get. Without a name it runs for every quest
quest "collector":
goal: break 10 stone
on quest progress "collector":
send action bar "&7Stone: &f%{_progress}% &7of %{_goal}%" to playerTry iton quest complete "<name>":since 1.7.63Runs when a player reaches the goal, after the reward. player is who did it and {_quest} the quest's name. Without a name it runs for every quest
quest "finisher":
goal: do 1
on quest complete "finisher":
broadcast "&6%player.name% finished a quest!"Try itA quest is something to do a number of times, counted for each player. HyperScript does the counting, keeps it with the player's saved variables, and runs the reward when it is done.
quest "miner":
name: "&6Miner"
goal: break 50 stone
reward:
give 5 diamond to player
send "&aQuest done: 50 stone mined."
command /quest:
trigger:
if quest state "miner" is "none":
start quest "miner"
send "&eNew quest: mine 50 stone."
else if quest state "miner" is "active":
set {_mined} to quest progress "miner"
set {_goal} to quest goal "miner"
send "&7Stone mined: &f%{_mined}% &7of %{_goal}%"
else:
send "&aYou have done that quest."
on quest complete "miner":
broadcast "&6%player.name% finished the Miner quest!"
| Syntax | Effect |
|---|---|
quest "<name>": | At the left margin: makes a quest. Under it comes goal:, and name: and reward: if you want them |
goal: break <n> <block> | Counted when the player breaks that block. Also place <n> <block> and kill <n> <creature>. any in place of the block or creature counts whichever it is |
goal: craft <n> <item> | Counted when the player crafts that item |
goal: fish <n> | Counted for each catch |
goal: walk <n> blocks | Counted for each block they walk into |
goal: reach <n> {<variable>} | Done when a saved variable of the player's, such as {coins}, gets to that number; how far they are is what the variable is. Looked at every two seconds |
repeat: daily | The quest may be done again: daily on each new day, weekly in each new week, or a length of time after it was done (repeat: 12 hours). Until then it stays "done"; after that it is "none" again and can be started |
time limit: <duration> | How long the player has. When the time is up the quest is "none" again, as if it had been stopped |
goal: do <n> | A quest a script counts itself, with advance quest: for talking to somebody, winning a game, anything the server cannot see by itself |
reward: | The lines under it run as the player when they reach the goal |
start quest <name> | The player has the quest, from the beginning; for <who> for somebody else. Starting it again starts it over |
stop quest <name> | They no longer have it, and what was counted is gone |
advance quest <name> | Counts one towards it; by <n> counts more. Nothing happens for a player who does not have the quest |
quest progress <name> | How far the player is, as a number; of <who> for somebody else |
quest goal <name> | How many the quest asks for |
quest state <name> | "none", "active" or "done"; of <who> for somebody else |
all quests | The names of every quest scripts have made |
active quests | The names of the quests the player has and has not finished; of <who> for somebody else |
on quest progress "<name>": | Runs each time a player gets further with a quest. {_quest} is its name, {_progress} how far they are and {_goal} how far they have to get. Without a name it runs for every quest |
on quest complete "<name>": | Runs when a player reaches the goal, after the reward. player is who did it and {_quest} the quest's name. Without a name it runs for every quest |
"active" is counted. A quest that is done stays done until it is started again.break 20 oak log, kill 5 zombie./quests menu that lists every quest with how far the player is comes as the script Quests.hs on the website.items:since 1.7.54yes · A line for each item, written as give takes them
kit "miner":
cooldown: 6 hours
items:
1 iron pickaxe
16 bread
3 diamondTry itcooldown: <duration>no · How long until the same player may claim it again
kit "starter":
cooldown: 1 day
items:
1 stone sword
16 bread
1 diamond sword named "&bFrost"Try itonce: truesince 1.7.54no · It can be claimed one time only
kit "founder":
once: true
permission: "kit.founder"
items:
1 diamond sword named "&6Founder's blade"
command /founder:
trigger:
claim kit "founder"Try itpermission: "<node>"since 1.7.54no · Who may claim it
command /fly:
permission: "server.fly"
trigger:
execute console command "fly %player.name%"Try ittrigger:no · What else happens when the kit is handed over, after the items
command /kit:
trigger:
claim kit "starter"Try itclaim kit <name>since 1.7.54The player gets the kit if they may, and is told why if not: the cooldown with how long is left, that they had it already, or that they lack the permission. for <who> for somebody else
kit "tools":
cooldown: 1 hour
items:
1 iron pickaxe
command /tools:
trigger:
claim kit "tools"Try itgive kit <name> to <who>since 1.7.54Hands the items over without asking: no cooldown, no permission, nothing written down
kit "welcome":
items:
3 diamond
on first join:
give kit "welcome" to playerTry it<who> can claim kit <name>since 1.7.54A condition: whether claim kit would hand it over now. Also cannot claim kit
kit "daily":
cooldown: 1 day
items:
3 diamond
command /daily:
trigger:
if player can claim kit "daily":
claim kit "daily"
send "&aSee you tomorrow."
else:
set {_wait} to cooldown of kit "daily"
send "&7Come back in %{_wait}%."Try itcooldown of command <name>since 1.7.63How long until the player may use a command again that has a cooldown:, as a duration; unset if they may now. for <who> for somebody else. The name is the command's own, with or without its slash: cooldown of command "/kit"
command /kitstatus:
trigger:
set {_left} to cooldown of command "/kit"
if {_left} is set:
send "&7Your kit is ready in &f%{_left}%"
else:
send "&aYour kit is ready."Try itcooldown of kit <name>since 1.7.54How long until the player may claim it again, as a duration; unset if they may now. for <who> for somebody else
kit "daily":
cooldown: 1 day
items:
3 diamond
command /when:
trigger:
set {_wait} to cooldown of kit "daily"
if {_wait} is set:
send "&7In %{_wait}%."
else:
send "&aNow."Try itreset kit <name>since 1.7.54The player may claim it again now; for <who> for somebody else
kit "daily":
cooldown: 1 day
items:
3 diamond
command /resetdaily <target:player>:
permission: op
trigger:
reset kit "daily" for arg.1Try itkitssince 1.7.54The names of all kits, as a list
kit "starter":
items:
1 stone sword
command /kits:
trigger:
send "&7Kits: &f%kits%"Try itA kit is a handful of items under a name, with how often it may be taken. It is written at the left margin, like a command:
kit "starter":
cooldown: 1 day
items:
1 stone sword
16 bread
1 diamond sword named "&bFrost"
command /kit:
trigger:
claim kit "starter"
Under kit "<name>": | Needed | Meaning |
|---|---|---|
items: | yes | A line for each item, written as give takes them |
cooldown: <duration> | no | How long until the same player may claim it again |
once: true | no | It can be claimed one time only |
permission: "<node>" | no | Who may claim it |
trigger: | no | What else happens when the kit is handed over, after the items |
| Syntax | Meaning |
|---|---|
claim kit <name> | The player gets the kit if they may, and is told why if not: the cooldown with how long is left, that they had it already, or that they lack the permission. for <who> for somebody else |
give kit <name> to <who> | Hands the items over without asking: no cooldown, no permission, nothing written down |
<who> can claim kit <name> | A condition: whether claim kit would hand it over now. Also cannot claim kit |
cooldown of command <name> | How long until the player may use a command again that has a cooldown:, as a duration; unset if they may now. for <who> for somebody else. The name is the command's own, with or without its slash: cooldown of command "/kit" |
cooldown of kit <name> | How long until the player may claim it again, as a duration; unset if they may now. for <who> for somebody else |
reset kit <name> | The player may claim it again now; for <who> for somebody else |
kits | The names of all kits, as a list |
claim kit says when it does not hand the kit over is in config.yml under messages: (kit-cooldown, kit-once, kit-permission); leave one empty to say nothing.{%player%.hs.kit.<name>}, so it lasts through restarts."starter".dialogue <name>:since 1.7.55A conversation under a name. Anything a trigger can do can stand in it
dialogue "blacksmith":
send "&6Blacksmith: &fWhat do you need?"
choice "A sword":
give 1 iron sword to player
send "&6Blacksmith: &fHere you go."
choice "Nothing":
send "&6Blacksmith: &7Come back any time."
command /blacksmith:
trigger:
start dialogue "blacksmith"Try itchoice <text>:since 1.7.55One of the answers. The choice blocks that follow one another are offered together, and the block of the one that is picked runs. What comes after them runs next
command /pick:
trigger:
send "&7Which team?"
choice "&cRed":
set {%player%.team} to "red"
choice "&9Blue":
set {%player%.team} to "blue"
send "&aYou are on team %{%player%.team}%."Try itstart dialogue <name>since 1.7.55Begin it with the player of the trigger
dialogue "guide":
send "&bGuide: &fWelcome to the server."
on first join:
start dialogue "guide"Try itA dialogue "<name>": block, at the left margin like a function, holds a conversation: what is said, and choice "<answer>": blocks for the player to answer by. The answers are shown in chat to click, or to type.
dialogue "blacksmith":
send "&6Blacksmith: &fWhat do you need?"
choice "A sword":
give 1 iron sword to player
send "&6Blacksmith: &fHere you go."
choice "Nothing":
send "&6Blacksmith: &7Come back any time."
command /blacksmith:
trigger:
start dialogue "blacksmith"
| Syntax | Meaning |
|---|---|
dialogue <name>: | A conversation under a name. Anything a trigger can do can stand in it |
choice <text>: | One of the answers. The choice blocks that follow one another are offered together, and the block of the one that is picked runs. What comes after them runs next |
start dialogue <name> | Begin it with the player of the trigger |
choice works anywhere a script runs for a player, not only inside a dialogue: it is the quick way to ask "which one?".messages.choose in config.yml.statistic <name> of <who>since 1.7.55One of the game's own statistics for a player, online or not: "deaths", "jump", "play_one_minute", "mob_kills", "player_kills", "walk_one_cm" and the rest, as the game names them
set {_deaths} to statistic "deaths" of player
send "&7You have died &c%{_deaths}% &7times."Try itstatistic <name> of <who> for <thing>since 1.7.55For the statistics that are kept for each block, item or creature: statistic "mine_block" of player for "stone", statistic "kill_entity" of player for "zombie". Without for, all of them added up
set {_stone} to statistic "mine_block" of player for "stone"
send "&7Stone mined: &f%{_stone}%"Try itall commandssince 1.7.55Every command the server has, each with its slash, as a list
send "&7This server has %size of all commands% commands."Try itcommands of <who>since 1.7.55The ones that player may use
set {_mine} to commands of player
send "&7You can use %size of {_mine}% commands."Try itall permissions of <who>since 1.7.55Every permission a player has, as a list; permissions of <who> says the same
for each {_node} in all permissions of player:
send "&7- %{_node}%"Try itgive selection wand to <who>since 1.7.55A golden axe that marks: left-click a block for the first corner, right-click for the second
give selection wand to playerTry itselection start of <who>since 1.7.55The first corner they marked, as a location; unset if they did not
command /makearena <name>:
permission: op
trigger:
if selection size of player is not set:
send "&cMark two corners with the wand first."
stop
create region arg.1 from selection start of player to selection end of player
send "&aMade %arg.1%."Try itselection end of <who>since 1.7.55The second corner
set {_far} to selection end of playerTry itselection size of <who>since 1.7.55How many blocks lie between the two, both included; unset until both are marked
send "&7You marked %selection size of player% blocks."Try itclear selection of <who>since 1.7.55Forget both corners
clear selection of playerTry itsave structure <name> from <position> to <position>since 1.7.55Keep everything between two corners in a file, as the game's structure blocks do
save structure "house" from selection start of player to selection end of playerTry itplace structure <name> at <position>since 1.7.55Put it back somewhere, its lowest corner at that place. rotated 90, 180 or 270 turns it
place structure "house" at playerTry itstructure <name> existssince 1.7.55A condition
if structure "house" exists:
place structure "house" at playerTry itdelete structure <name>since 1.7.55Remove the file
delete structure "house"Try itblock word <text>since 1.7.55Chat with that word in it is starred, or kept back; a list blocks several
block word "badword"Try itunblock word <text>since 1.7.55It may be said again
unblock word "badword"Try itblocked wordssince 1.7.55The words that are blocked, as a list
send "&7Blocked: %blocked words%"Try it| Syntax | Meaning |
|---|---|
statistic <name> of <who> | One of the game's own statistics for a player, online or not: "deaths", "jump", "play_one_minute", "mob_kills", "player_kills", "walk_one_cm" and the rest, as the game names them |
statistic <name> of <who> for <thing> | For the statistics that are kept for each block, item or creature: statistic "mine_block" of player for "stone", statistic "kill_entity" of player for "zombie". Without for, all of them added up |
all commands | Every command the server has, each with its slash, as a list |
commands of <who> | The ones that player may use |
all permissions of <who> | Every permission a player has, as a list; permissions of <who> says the same |
give selection wand to <who> | A golden axe that marks: left-click a block for the first corner, right-click for the second |
selection start of <who> | The first corner they marked, as a location; unset if they did not |
selection end of <who> | The second corner |
selection size of <who> | How many blocks lie between the two, both included; unset until both are marked |
clear selection of <who> | Forget both corners |
save structure <name> from <position> to <position> | Keep everything between two corners in a file, as the game's structure blocks do |
place structure <name> at <position> | Put it back somewhere, its lowest corner at that place. rotated 90, 180 or 270 turns it |
structure <name> exists | A condition |
delete structure <name> | Remove the file |
block word <text> | Chat with that word in it is starred, or kept back; a list blocks several |
unblock word <text> | It may be said again |
blocked words | The words that are blocked, as a list |
command /makearena <name>:
permission: op
trigger:
if selection size of player is not set:
send "&cMark two corners with the wand first."
stop
create region arg.1 from selection start of player to selection end of player
save structure arg.1 from selection start of player to selection end of player
send "&aMade %arg.1%."
on blocked word:
add 1 to {%player%.warnings}
if {%player%.warnings} >= 3:
mute player for 10 minutes because "language"
limits.structure-blocks); saving a large one makes the server wait. The files are the game's own and lie in the main world's folder, under generated/hyperscript/structures.b4dw0rd, b.a.d.w.o.r.d, baaadword. A word has to stand by itself, so blocking ass leaves class alone. word-filter in config.yml says whether the message is sent with stars (censor, the default) or not sent (block). Players with the permission hyperscript.words.bypass are left alone, and the list is kept through restarts.An addon: a separate plugin whose words work once it is installed.
platform of <who>HyperBedrockbedrock or java; unset for someone who is not online
send "&7%arg.1% plays on &f%platform of arg.1%&7."device of <who>HyperBedrockWhat they play on, as Bedrock names it: Android, iOS, Windows, Xbox One, PlayStation, Switch and so on. Unset on Java
send "&7Device: &f%device of arg.1% &7Input: &f%input of arg.1%"input of <who>HyperBedrockHow they play: touch, controller or keyboard mouse. Unset on Java
send "&7Device: &f%device of arg.1% &7Input: &f%input of arg.1%"bedrock name of <who>HyperBedrockTheir gamertag, without the prefix Floodgate puts in front of the name on your server
send "&7Gamertag: &f%bedrock name of arg.1% &7Version: &f%bedrock version of arg.1%"xuid of <who>HyperBedrockTheir Xbox id, which never changes
send "&7Xbox id: &f%xuid of arg.1% &7Language: &f%bedrock language of arg.1%"bedrock version of <who>HyperBedrockThe version of their game
send "&7Gamertag: &f%bedrock name of arg.1% &7Version: &f%bedrock version of arg.1%"bedrock language of <who>HyperBedrockThe language of their game, such as en_US
send "&7Xbox id: &f%xuid of arg.1% &7Language: &f%bedrock language of arg.1%"bedrock playersHyperBedrockA list of the names of everybody online who is on Bedrock
send "&7On Bedrock now: &f" + join bedrock players with ", "on player join:
if platform of player is "bedrock":
send "&7Welcome from %device of player%! Menus open as forms for you."
command /platform <player>:
trigger:
if platform of arg.1 is not set:
send "&c%arg.1% is not online."
stop
send "&7%arg.1% plays on &f%platform of arg.1%&7."
if platform of arg.1 is "bedrock":
send "&7Device: &f%device of arg.1% &7Input: &f%input of arg.1%"
send "&7Gamertag: &f%bedrock name of arg.1% &7Version: &f%bedrock version of arg.1%"
send "&7Xbox id: &f%xuid of arg.1% &7Language: &f%bedrock language of arg.1%"
command /bedrock:
trigger:
send "&7On Bedrock now: &f" + join bedrock players with ", "
| Syntax | Result |
|---|---|
platform of <who> | bedrock or java; unset for someone who is not online |
device of <who> | What they play on, as Bedrock names it: Android, iOS, Windows, Xbox One, PlayStation, Switch and so on. Unset on Java |
input of <who> | How they play: touch, controller or keyboard mouse. Unset on Java |
bedrock name of <who> | Their gamertag, without the prefix Floodgate puts in front of the name on your server |
xuid of <who> | Their Xbox id, which never changes |
bedrock version of <who> | The version of their game |
bedrock language of <who> | The language of their game, such as en_US |
bedrock players | A list of the names of everybody online who is on Bedrock |
platform of and bedrock players is unset for a Java player, so is set works as a test as well.player, arg.1 and the like as with anyone else; nothing here needs the dot written out.show form <id> to <who> titled <text> with buttons <text>, <text>HyperBedrockA list of buttons under a title. Add with text <text> before with buttons for a line above them
show form "kits" to player titled "&lKits" with text "Pick a kit" with buttons "Warrior", "Archer", "Miner"show question form <id> to <who> titled <text> with text <text> with buttons <text>, <text>HyperBedrockA question with exactly two buttons
show question form "reset" to player titled "Reset" with text "Really delete your home?" with buttons "Yes, delete it", "No"show input form <id> to <who> titled <text> with <part>, <part>HyperBedrockA form to fill in; the parts are listed below
show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5on form "<id>":HyperBedrockRuns when a player answers the form of that id. player is who answered
on form "reset":
if {_index} is 1:
delete {%player%.home}
send "&aYour home was deleted."on form closed "<id>":HyperBedrockRuns when they close it without answering
on form closed "kits":
send "&7Maybe later."input <label>HyperBedrockA box to type in. Add hint <text> for the grey text shown while it is empty
send "&7Device: &f%device of arg.1% &7Input: &f%input of arg.1%"toggle <label>HyperBedrockA switch, off to begin with; toggle <label> on starts it on
show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5dropdown <label> of <list>HyperBedrockOne of several choices: dropdown "Kit" of ["Warrior", "Archer"] or a list in a variable
show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5slider <label> from <n> to <n>HyperBedrockA number between two ends, in whole steps; step <n> after it for other steps
show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5label <text>HyperBedrockA line of text, nothing to fill in
show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5command /kits:
players only: true
trigger:
show form "kits" to player titled "&lKits" with text "Pick a kit" with buttons "Warrior", "Archer", "Miner"
on form "kits":
if {_button} is "Warrior":
give 1 iron sword to player
else if {_button} is "Archer":
give 1 bow to player
else:
give 1 iron pickaxe to player
send "&aYou took the %{_button}% kit."
on form closed "kits":
send "&7Maybe later."
command /resetme:
players only: true
trigger:
show question form "reset" to player titled "Reset" with text "Really delete your home?" with buttons "Yes, delete it", "No"
on form "reset":
if {_index} is 1:
delete {%player%.home}
send "&aYour home was deleted."
command /report:
players only: true
trigger:
show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5
on form "report":
set {_who} to item 1 of {_answers}
set {_why} to item 2 of {_answers}
log "%player.name% reported %{_who}% for %{_why}% (urgent: %item 3 of {_answers}%, %item 4 of {_answers}% of 5)"
send "&aThank you. Staff have been told."
| Syntax | Effect |
|---|---|
show form <id> to <who> titled <text> with buttons <text>, <text> | A list of buttons under a title. Add with text <text> before with buttons for a line above them |
show question form <id> to <who> titled <text> with text <text> with buttons <text>, <text> | A question with exactly two buttons |
show input form <id> to <who> titled <text> with <part>, <part> | A form to fill in; the parts are listed below |
on form "<id>": | Runs when a player answers the form of that id. player is who answered |
on form closed "<id>": | Runs when they close it without answering |
What an input form is made of:
| Part | It is |
|---|---|
input <label> | A box to type in. Add hint <text> for the grey text shown while it is empty |
toggle <label> | A switch, off to begin with; toggle <label> on starts it on |
dropdown <label> of <list> | One of several choices: dropdown "Kit" of ["Warrior", "Archer"] or a list in a variable |
slider <label> from <n> to <n> | A number between two ends, in whole steps; step <n> after it for other steps |
label <text> | A line of text, nothing to fill in |
<id> ties a form to its blocks: show form "kits" is answered in on form "kits":. It is never shown to the player.on form, for a button or question form {_button} is what the pressed button says and {_index} its number, counting from 1. For an input form {_answers} is a list of what was filled in, in the order of the parts: text for an input and a dropdown, true or false for a toggle, a number for a slider. Labels are not counted.platform of player first, as in the example at the top.with buttons {kit.names}."<text>" with image "<address>"HyperBedrockIn with buttons: a picture beside what the button says. An address that begins with http is fetched by the player's game; anything else is a path in a resource pack, such as textures/items/diamond. A button without it has no picture. Not for the two buttons of a question form
show form "hub" to player titled "&lWhere to?" with buttons "Survival" with image "https://example.com/icons/survival.png", "Skyblock" with image "textures/items/diamond", "Stay here"transfer <who> to bedrock server <address>HyperBedrockSend a Bedrock player to another Bedrock server. The port is 19132 unless port <n> follows, or the address ends in :<n>. A Java player stays where they are
transfer player to bedrock server "survival.example.com"command /hub:
trigger:
if platform of player is not "bedrock":
send "&7This menu is for Bedrock players."
stop
show form "hub" to player titled "&lWhere to?" with buttons "Survival" with image "https://example.com/icons/survival.png", "Skyblock" with image "textures/items/diamond", "Stay here"
on form "hub":
if {_button} is "Survival":
transfer player to bedrock server "survival.example.com"
else if {_button} is "Skyblock":
transfer player to bedrock server "skyblock.example.com" port 19133
| Syntax | Effect |
|---|---|
"<text>" with image "<address>" | In with buttons: a picture beside what the button says. An address that begins with http is fetched by the player's game; anything else is a path in a resource pack, such as textures/items/diamond. A button without it has no picture. Not for the two buttons of a question form |
transfer <who> to bedrock server <address> | Send a Bedrock player to another Bedrock server. The port is 19132 unless port <n> follows, or the address ends in :<n>. A Java player stays where they are |
on form "<id>": {_button} is what the button says, without the picture.An addon: a separate plugin whose words work once it is installed.
on npc click "<name>":HyperCitizensRuns when a player right-clicks the NPC of that name
on npc click "Shopkeeper":
execute player command "shop"on npc left click "<name>":HyperCitizensRuns when a player hits it
on npc left click "Guard":
make npc "Guard" say "Hands off."on npc click:HyperCitizensWithout a name: runs for every NPC
on npc click:
log "%player.name% clicked %{_name}% (number %{_npc}%)"What this event gives a script
| In the block | What it is |
|---|---|
{_npc} | The NPC's number |
{_name} | Its name |
on npc click "Shopkeeper":
execute player command "shop"
on npc click "Healer":
cooldown: 30 seconds
heal player
make npc "Healer" say "There you go."
on npc left click "Guard":
make npc "Guard" say "Hands off."
on npc click:
log "%player.name% clicked %{_name}% (number %{_npc}%)"
| Syntax | Effect |
|---|---|
on npc click "<name>": | Runs when a player right-clicks the NPC of that name |
on npc left click "<name>": | Runs when a player hits it |
on npc click: | Without a name: runs for every NPC |
player is whoever clicked, as in HyperScript's own events. {_npc} is the NPC's number and {_name} its name."Guide" finds an NPC called &aGuide. If two NPCs share a name, the block runs for both.create npc <name> at <location>HyperCitizensMake an NPC that looks like a player
create npc "&aGuide" at player's locationcreate npc <name> as <kind> at <location>HyperCitizensMake one that is a creature: "villager", "cow", "zombie" and so on
create npc "Rex" as "wolf" at player's locationdelete npc <npc>HyperCitizensRemove an NPC for good
delete npc "Guide"rename npc <npc> to <name>HyperCitizensGive it another name; colour codes work
rename npc {guide} to arg.1set skin of npc <npc> to <player name>HyperCitizensFor an NPC that looks like a player: whose skin it wears
set skin of npc last created npc to "Notch"last created npcHyperCitizensThe number of the NPC create npc made most recently
set {guide} to last created npccommand /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"
| Syntax | Effect |
|---|---|
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 npc | The 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.create npc once, from a command; an on load: block would make another one at every reload.teleport npc <npc> to <location>HyperCitizensPut it somewhere at once
teleport npc "Guide" to {spawn}make npc <npc> walk to <location>HyperCitizensHave it find its way there on foot
make npc "Guide" walk to {market}make npc <npc> look at <location>HyperCitizensTurn it to face a place
make npc {_npc} look at player's locationmake npc <npc> say <text>HyperCitizensPlayers within 16 blocks see Name: text in chat
make npc "Guard" say "Hands off."command /tour:
players only: true
trigger:
make npc "Guide" say "Follow me to the market."
make npc "Guide" walk to {market}
wait 10 seconds
make npc "Guide" look at player's location
make npc "Guide" say "Here we are."
every 5 minutes:
teleport npc "Guide" to {spawn}
| Syntax | Effect |
|---|---|
teleport npc <npc> to <location> | Put it somewhere at once |
make npc <npc> walk to <location> | Have it find its way there on foot |
make npc <npc> look at <location> | Turn it to face a place |
make npc <npc> say <text> | Players within 16 blocks see Name: text in chat |
set tool of npc <npc> to <item>HyperCitizensWhat it holds. Also offhand, helmet, chestplate, leggings and boots; to nothing empties the slot
set tool of npc {guard} to nothingadd hologram line <text> to npc <npc>HyperCitizensA line of floating text above it
add hologram line "&7Right-click to talk" to npc {guard}clear hologram of npc <npc>HyperCitizensTake that text away
clear hologram of npc {guard}make npc <npc> watch playersHyperCitizensIt turns to look at whoever comes near
make npc {guard} watch playersmake npc <npc> stop watchingHyperCitizensIt looks ahead again
make npc {guard} stop watchingmake npc <npc> follow <who>HyperCitizensIt walks after a player
make npc last created npc follow playermake npc <npc> stop followingHyperCitizensIt stays where it is
make npc "Rex" stop followingmake npc <npc> patrol <location>, <location>HyperCitizensIt walks from place to place and round again; give two or more
make npc {guard} patrol {gate.north}, {gate.south}make npc <npc> stop patrollingHyperCitizensIt stops where it is
make npc {guard} stop patrollinghide npc <npc> from <who>HyperCitizensThat 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.1show npc <npc> to <who>HyperCitizensThey see it again
show npc "ghost" to arg.1make npc <npc> swing armHyperCitizensOne swing of its arm, as when it hits something
make npc {_npc} swing armcommand /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}
| Syntax | Effect |
|---|---|
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 players | It turns to look at whoever comes near |
make npc <npc> stop watching | It looks ahead again |
make npc <npc> follow <who> | It walks after a player |
make npc <npc> stop following | It 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 patrolling | It 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 arm | One swing of its arm, as when it hits something |
on server start: block.all npcsHyperCitizensA list of the numbers of every NPC
for each {_id} in all npcs:
send "&7%{_id}%: &f" + name of npc {_id}npc named <name>HyperCitizensThe number of the NPC of that name; unset if there is none
set {_id} to npc named "Guide"name of npc <npc>HyperCitizensIts name, without colours
hide name of npc arg.1location of npc <npc>HyperCitizensWhere it is, as a location
teleport player to location of npc {_id}command /npcs:
trigger:
for each {_id} in all npcs:
send "&7%{_id}%: &f" + name of npc {_id}
command /guide:
players only: true
trigger:
set {_id} to npc named "Guide"
if {_id} is not set:
send "&cThere is no guide yet."
stop
teleport player to location of npc {_id}
| Syntax | Result |
|---|---|
all npcs | A list of the numbers of every NPC |
npc named <name> | The number of the NPC of that name; unset if there is none |
name of npc <npc> | Its name, without colours |
location of npc <npc> | Where it is, as a location |
nearest npc to <location>HyperCitizensThe 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 locationnpcs within <n> blocks of <location>HyperCitizensThe NPCs that near a place, the nearest first
for each {_npc} in npcs within 8 blocks of player's location:
make npc {_npc} swing armdespawn npc <npc>HyperCitizensTake it out of the world without deleting it: it keeps its name, its skin and everything it was told
despawn npc arg.1spawn npc <npc> at <location>HyperCitizensPut 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 locationnpc spawned <npc>HyperCitizensTrue while it is in the world
if npc spawned arg.1:
despawn npc arg.1
send "&7The NPC is resting."hide name of npc <npc>HyperCitizensThe 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.1show name of npc <npc>HyperCitizensThe name is shown again
show name of npc arg.1command /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
| Syntax | Effect |
|---|---|
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 |
command /ghost <target:player>:
permission: "staff.ghost"
trigger:
hide npc "ghost" from arg.1
send "&7%arg.1% no longer sees the ghost."
command /unghost <target:player>:
permission: "staff.ghost"
trigger:
show npc "ghost" to arg.1
command /salute:
trigger:
make npc "guard" swing arm
An addon: a separate plugin whose words work once it is installed.
Describe the currency in any script, as you would without this addon:
currency "coins":
start: 100
max: 1000000
command /coins:
trigger:
set {_has} to currency "coins" of player
send "&7You have &6%economy format of {_has}%&7."
command /pay <player> <number>:
trigger:
set {_amount} to parse arg.2 as number
if {_amount} is not set or {_amount} <= 0:
send "&cHow much?"
stop
if currency "coins" of player < {_amount}:
send "&cYou do not have that much."
stop
pay {_amount} of currency "coins" from player to arg.1
send "&aPaid %economy format of {_amount}% to %arg.1%."
Everything HyperScript does with a currency works as before: currency "coins" of player, set, add, subtract, pay, top. What HyperEconomy adds is that a plugin which pays a player through Vault changes the same number.
start: says, for other plugins too.max: is refused, and nothing is paid in.on economy deposit:HyperEconomyRuns when another plugin pays a player through Vault. player is that player, if they are online
on economy deposit:
send "&a+%economy format of {_amount}%" to player
if {_balance} >= 1000000:
broadcast "&6%{_name}% &7is a millionaire."What this event gives a script
| In the block | What it is |
|---|---|
{_amount} | What was moved |
{_balance} | What the player has now |
{_currency} | The currency's name |
{_name} | The player's name, which is there for a player who is offline too |
on economy pay:HyperEconomyRuns when another plugin moves money from one player to another: taken from the one and, in the same moment, the same sum given to the other. player is who paid; {_payer}, {_receiver} and {_amount} say the rest
What this event gives a script
| In the block | What it is |
|---|---|
{_payer} | The payer |
{_receiver} | And |
{_amount} | Say the rest |
{_balance} | What the player has now |
{_currency} | The currency's name |
{_name} | The player's name, which is there for a player who is offline too |
on economy withdraw:HyperEconomyRuns when another plugin takes money from a player through Vault
on economy withdraw:
log "%{_name}% paid %{_amount}% %{_currency}% and has %{_balance}% left"What this event gives a script
| In the block | What it is |
|---|---|
{_amount} | What was moved |
{_balance} | What the player has now |
{_currency} | The currency's name |
{_name} | The player's name, which is there for a player who is offline too |
on economy deposit:
send "&a+%economy format of {_amount}%" to player
if {_balance} >= 1000000:
broadcast "&6%{_name}% &7is a millionaire."
on economy withdraw:
log "%{_name}% paid %{_amount}% %{_currency}% and has %{_balance}% left"
| Syntax | Effect |
|---|---|
on economy deposit: | Runs when another plugin pays a player through Vault. player is that player, if they are online |
on economy pay: | Runs when another plugin moves money from one player to another: taken from the one and, in the same moment, the same sum given to the other. player is who paid; {_payer}, {_receiver} and {_amount} say the rest |
on economy withdraw: | Runs when another plugin takes money from a player through Vault |
{_amount} is what was moved, {_balance} what the player has now, {_currency} the currency's name and {_name} the player's name, which is there for a player who is offline too.currency "coins" of player itself does not set them off.economy format of <number>HyperEconomyThe amount as other plugins show it: 1,250 coins, 1 coin, 2.50 coins
send "&7You have &6%economy format of {_has}%&7."economy currencyHyperEconomyThe name of the currency that is the server's money
set economy currency to "gems"set economy currency to "<name>"HyperEconomyMakes another currency the server's money, at once and after a restart. Balances are not moved: each currency keeps its own
set economy currency to "gems"command /worth <number>:
trigger:
send "&7That is &6%economy format of arg.1%&7 in &f%economy currency%&7."
command /usegems:
permission: economy.admin
trigger:
set economy currency to "gems"
send "&aThe server now pays in %economy currency%."
| Syntax | Effect |
|---|---|
economy format of <number> | The amount as other plugins show it: 1,250 coins, 1 coin, 2.50 coins |
economy currency | The name of the currency that is the server's money |
set economy currency to "<name>" | Makes another currency the server's money, at once and after a restart. Balances are not moved: each currency keeps its own |
top balancesHyperEconomyThe names of the players with the most of the server's money, richest first, up to 100. Everybody who has played here counts, online or not
for each {_name} in top balances:
add 1 to {_place}
if {_place} <= 10:
send "&e#%{_place}% &f%{_name}% &7- %economy format of balance of {_name}%"economy rank of <who>HyperEconomyWhere a player stands among everybody by how much they have: 1 for the richest. Unset for somebody who has nothing
set {_mine} to economy rank of playereconomy totalHyperEconomyAll the money there is: what everybody has, added up
send "&7In all there are %economy format of economy total%."transactions of <who>HyperEconomyWhat other plugins last paid that player or took from them, newest first, as text such as +50 coins and -20 coins; twenty at most. economy transactions of <who> says the same
set {_moves} to transactions of playercommand /rich:
trigger:
send "&6Richest players"
set {_place} to 0
for each {_name} in top balances:
add 1 to {_place}
if {_place} <= 10:
send "&e#%{_place}% &f%{_name}% &7- %economy format of balance of {_name}%"
send "&7In all there are %economy format of economy total%."
set {_mine} to economy rank of player
if {_mine} is set:
send "&7You are #%{_mine}%."
command /moves:
trigger:
set {_moves} to transactions of player
if size of {_moves} is 0:
send "&7No plugin has moved your money since the server started."
stop
send "&6Your last payments"
for each {_move} in {_moves}:
send "&7%{_move}%"
| Syntax | Effect |
|---|---|
top balances | The names of the players with the most of the server's money, richest first, up to 100. Everybody who has played here counts, online or not |
economy rank of <who> | Where a player stands among everybody by how much they have: 1 for the richest. Unset for somebody who has nothing |
economy total | All the money there is: what everybody has, added up |
transactions of <who> | What other plugins last paid that player or took from them, newest first, as text such as +50 coins and -20 coins; twenty at most. economy transactions of <who> says the same |
top balances and economy total ask about every player who has ever joined, so the answer is kept for ten seconds and can be that far behind.transactions of knows what went through Vault since the server started: a shop, /pay, a job. What a script itself adds to the variable is not a payment by another plugin and is not in the list, and the list is empty again after a restart.An addon: a separate plugin whose words work once it is installed.
save schematic <name> from <location> to <location>HyperEditWrite every block in the box between two corners to a schematic. One of that name is replaced
save schematic "arena" from {arena.corner} to {arena.far}paste schematic <name> at <location>HyperEditPut it into the world, so that what was at the first corner comes to that place
paste schematic "house" at player's location rotated 90 skipping airpaste schematic <name> at <location> rotated <degrees>HyperEditThe same, turned: 90, 180 or 270, clockwise seen from above
paste schematic "house" at player's location rotated 90 skipping airpaste schematic <name> at <location> skipping airHyperEditLeave what is there wherever the schematic has air
paste schematic "house" at player's location rotated 90 skipping airdelete schematic <name>HyperEditRemove the file
delete schematic arg.1all schematicsHyperEditA list of the names of every schematic
send "&7Schematics: &f" + join all schematics with ", "schematic exists <name>HyperEditWhether there is one of that name
if not schematic exists "house":
send "&cThere is no schematic called house."
stopsize of schematic <name>HyperEditA list of three numbers: how many blocks it is along x, y and z
set {_size} to size of schematic "arena"command /savearena:
permission: "arena.admin"
trigger:
save schematic "arena" from {arena.corner} to {arena.far}
set {_size} to size of schematic "arena"
send "&aSaved: %{_size}% blocks along x, y and z."
command /house:
permission: "build.house"
players only: true
trigger:
if not schematic exists "house":
send "&cThere is no schematic called house."
stop
paste schematic "house" at player's location rotated 90 skipping air
send "&aBuilt. %blocks changed by last edit% blocks were placed."
command /schematics:
permission: "arena.admin"
trigger:
send "&7Schematics: &f" + join all schematics with ", "
command /delschematic <name>:
permission: "arena.admin"
trigger:
delete schematic arg.1
| Syntax | Effect |
|---|---|
save schematic <name> from <location> to <location> | Write every block in the box between two corners to a schematic. One of that name is replaced |
paste schematic <name> at <location> | Put it into the world, so that what was at the first corner comes to that place |
paste schematic <name> at <location> rotated <degrees> | The same, turned: 90, 180 or 270, clockwise seen from above |
paste schematic <name> at <location> skipping air | Leave what is there wherever the schematic has air |
delete schematic <name> | Remove the file |
all schematics | A list of the names of every schematic |
schematic exists <name> | Whether there is one of that name |
size of schematic <name> | A list of three numbers: how many blocks it is along x, y and z |
- and _. Anything else is refused, so a script cannot write outside the schematics folder.rotated and skipping air can be combined, in that order.edit fill from <location> to <location> with <block>HyperEditSet every block in the box
edit fill from {hall.a} to {hall.b} with smooth stoneedit replace <block> from <location> to <location> with <block>HyperEditChange only the blocks of one kind in the box, to the block named last
edit replace ice from {lake.a} to {lake.b} with "water"edit walls from <location> to <location> with <block>HyperEditThe four sides of the box, without floor or roof
edit walls from player's location offset by -3, 0, -3 to player's location offset by 3, 4, 3 with glassedit outline from <location> to <location> with <block>HyperEditAll six faces of the box
edit outline from {vault.a} to {vault.b} with obsidianedit sphere at <location> radius <n> with <block>HyperEditA ball around that place; hollow at the end for a shell
edit sphere at player's location radius 6 with glass hollowedit biome from <location> to <location> to <biome>HyperEditMake the box between two corners that biome, by the game's name for it: "desert", "snowy_taiga". Players see it when the chunks are sent to them again
edit biome from {_a} to {_b} to "desert"edit cylinder at <location> radius <n> height <n> with <block>HyperEditA pillar standing on that place; hollow at the end for a tube
edit cylinder at player's location radius 4 height 20 with stone bricks hollowundo last editHyperEditTake the last edit or paste back. Again for the one before, up to fifteen
undo last editredo last editHyperEditDo again what was just taken back
redo last editedit count of <block> from <location> to <location>HyperEditHow many blocks of that kind are in the box between two corners
set {_left} to edit count of stone from {_a} to {_b}blocks changed by last editHyperEditHow many blocks the last edit or paste changed
send "&a%blocks changed by last edit% blocks set."command /floor:
permission: "build.floor"
trigger:
edit fill from {hall.a} to {hall.b} with smooth stone
send "&a%blocks changed by last edit% blocks set."
command /melt:
permission: "build.melt"
trigger:
edit replace ice from {lake.a} to {lake.b} with "water"
command /cage:
permission: "build.cage"
players only: true
trigger:
edit walls from player's location offset by -3, 0, -3 to player's location offset by 3, 4, 3 with glass
edit sphere at player's location radius 6 with glass hollow
command /tower:
permission: "build.tower"
players only: true
trigger:
edit cylinder at player's location radius 4 height 20 with stone bricks hollow
edit outline from {vault.a} to {vault.b} with obsidian
command /oops:
permission: "build.floor"
trigger:
undo last edit
send "&7Taken back."
command /again:
permission: "build.floor"
trigger:
redo last edit
send "&7Done again."
| Syntax | Effect |
|---|---|
edit fill from <location> to <location> with <block> | Set every block in the box |
edit replace <block> from <location> to <location> with <block> | Change only the blocks of one kind in the box, to the block named last |
edit walls from <location> to <location> with <block> | The four sides of the box, without floor or roof |
edit outline from <location> to <location> with <block> | All six faces of the box |
edit sphere at <location> radius <n> with <block> | A ball around that place; hollow at the end for a shell |
edit biome from <location> to <location> to <biome> | Make the box between two corners that biome, by the game's name for it: "desert", "snowy_taiga". Players see it when the chunks are sent to them again |
edit cylinder at <location> radius <n> height <n> with <block> | A pillar standing on that place; hollow at the end for a tube |
undo last edit | Take the last edit or paste back. Again for the one before, up to fifteen |
redo last edit | Do again what was just taken back |
edit count of <block> from <location> to <location> | How many blocks of that kind are in the box between two corners |
blocks changed by last edit | How many blocks the last edit or paste changed |
stone, oak planks. Blocks that are not also items go in quotes: "air", "water", "lava", "fire".fill from ... with stops at 32,768 blocks; edit fill goes up to max-blocks.undo last edit knows the edits scripts have made since the server started, not those players made with WorldEdit's own commands.edit pyramid at <location> height <n> with <block>HyperEditA pyramid that many blocks high, standing on that place. hollow at the end leaves it empty inside
edit pyramid at player's location height arg.1 with sandstoneedit stack from <location> to <location> <n> times <direction>HyperEditRepeat the box that many times, each copy straight after the last: north, south, east, west, up or down. Air is copied too. For a wall, a row of pillars, the floors of a tower
edit stack from {%player%.a} to {%player%.b} arg.1 times eastedit move from <location> to <location> <n> blocks <direction>HyperEditMove the box that far, leaving air where it was: a door that opens, a lift, a wall that slides
edit move from {gate.a} to {gate.b} 4 blocks upedit line from <location> to <location> with <block>HyperEditA line of blocks from one place to the other, in whichever direction
edit line from {%player%.a} to {%player%.b} with oak planksedit overlay from <location> to <location> with <block>HyperEditPut one layer of that block on top of whatever is highest in each column of the box: snow on a roof, carpet on a floor
edit overlay from {%player%.a} to {%player%.b} with snowedit drain at <location> radius <n>HyperEditTake away the water and lava within that many blocks that is connected to the place
edit drain at player's location radius arg.1command /pyramid <height:number>:
permission: "edit.use"
trigger:
edit pyramid at player's location height arg.1 with sandstone
send "&a%blocks changed by last edit% blocks placed."
command /tomb:
permission: "edit.use"
trigger:
edit pyramid at player's location height 12 with sandstone hollow
command /opengate:
permission: "edit.use"
trigger:
edit move from {gate.a} to {gate.b} 4 blocks up
wait 5 seconds
undo last edit
command /bridge:
permission: "edit.use"
trigger:
edit line from {%player%.a} to {%player%.b} with oak planks
command /snow:
permission: "edit.use"
trigger:
edit overlay from {%player%.a} to {%player%.b} with snow
command /dry <radius:number>:
permission: "edit.use"
trigger:
edit drain at player's location radius arg.1
command /fence <copies:number>:
permission: "edit.use"
trigger:
if {%player%.a} is not set or {%player%.b} is not set:
send "&cMark the two corners first."
stop
edit stack from {%player%.a} to {%player%.b} arg.1 times east
send "&aRepeated %arg.1% times to the east. /undo takes it back."
| Syntax | Effect |
|---|---|
edit pyramid at <location> height <n> with <block> | A pyramid that many blocks high, standing on that place. hollow at the end leaves it empty inside |
edit stack from <location> to <location> <n> times <direction> | Repeat the box that many times, each copy straight after the last: north, south, east, west, up or down. Air is copied too. For a wall, a row of pillars, the floors of a tower |
edit move from <location> to <location> <n> blocks <direction> | Move the box that far, leaving air where it was: a door that opens, a lift, a wall that slides |
edit line from <location> to <location> with <block> | A line of blocks from one place to the other, in whichever direction |
edit overlay from <location> to <location> with <block> | Put one layer of that block on top of whatever is highest in each column of the box: snow on a roof, carpet on a floor |
edit drain at <location> radius <n> | Take away the water and lava within that many blocks that is connected to the place |
max-blocks, and all are taken back by undo last edit.command /mineleft:
trigger:
set {_a} to player's location offset by -5, -5, -5
set {_b} to player's location offset by 5, 5, 5
set {_left} to edit count of stone from {_a} to {_b}
send "&7Stone around you: &f%{_left}%"
command /desert:
permission: "staff.biome"
trigger:
set {_a} to player's location offset by -8, -8, -8
set {_b} to player's location offset by 8, 8, 8
edit biome from {_a} to {_b} to "desert"
An addon: a separate plugin whose words work once it is installed.
on alert:HyperGrimRuns every time Grim flags a player: each time one of its checks fails. player is who was flagged
on alert:
add 1 to {%player%.warns}What this event gives a script
| In the block | What it is |
|---|---|
{_check} | The name of the check |
{_violations} | How many violations of it the player has by now |
{_verbose} | What Grim noted about this one (often empty) |
{_description} | What the check is for. In on grim punish: there is |
{_command} | As well |
on alert level <n>:HyperGrimRuns once when the violations of a check reach that number, whichever check it is: on alert level 10:. It needs a number
on alert level 25:
kick player because "&cToo many violations of %{_check}%"on alert level <n> "<check>":HyperGrimThe same for one check: on alert level 10 "Reach":
on alert level 10 "Reach":
loop all players:
if loop-player has permission "staff.alerts":
send "&c%player.name% has 10 Reach violations" to loop-playeron alert "<check>":HyperGrimThe same for one check only, by the name Grim gives it: "Reach", "Simulation", "BadPacketsA"
on alert "Reach":
log "%player.name% failed Reach (%{_violations}% so far): %{_verbose}%"on grim flag:HyperGrimAnother way of writing on alert:; both run
on grim flag:
loop all players:
if loop-player has permission "staff.alerts":
send "&c%player.name% &7was flagged for &f%{_check}%" to loop-playerWhat this event gives a script
| In the block | What it is |
|---|---|
{_check} | The name of the check |
{_violations} | How many violations of it the player has by now |
{_verbose} | What Grim noted about this one (often empty) |
{_description} | What the check is for. In on grim punish: there is |
{_command} | As well |
on grim punish:HyperGrimRuns when Grim carries out one of the commands its punishments are made of
on grim punish:
log "Grim ran for %player.name%: %{_command}%"What this event gives a script
| In the block | What it is |
|---|---|
{_check} | The name of the check |
{_violations} | How many violations of it the player has by now |
{_verbose} | What Grim noted about this one (often empty) |
{_description} | What the check is for. In on grim punish: there is |
{_command} | As well |
on alert:
add 1 to {%player%.warns}
if {%player%.warns} > 10:
ban player for 7 days because "&cCheating (automatic ban)"
on alert "Reach":
log "%player.name% failed Reach (%{_violations}% so far): %{_verbose}%"
on grim flag:
loop all players:
if loop-player has permission "staff.alerts":
send "&c%player.name% &7was flagged for &f%{_check}%" to loop-player
on grim punish:
log "Grim ran for %player.name%: %{_command}%"
| Syntax | Effect |
|---|---|
on alert: | Runs every time Grim flags a player: each time one of its checks fails. player is who was flagged |
on alert level <n>: | Runs once when the violations of a check reach that number, whichever check it is: on alert level 10:. It needs a number |
on alert level <n> "<check>": | The same for one check: on alert level 10 "Reach": |
on alert "<check>": | The same for one check only, by the name Grim gives it: "Reach", "Simulation", "BadPacketsA" |
on grim flag: | Another way of writing on alert:; both run |
on grim punish: | Runs when Grim carries out one of the commands its punishments are made of |
{_check} is the name of the check, {_violations} how many violations of it the player has by now, {_verbose} what Grim noted about this one (often empty), and {_description} what the check is for. In on grim punish: there is {_command} as well.on alert level 10: saves the counting: it runs the one time a player's violations of a check get to 10, and again only if they fall and climb back. The values inside are the same as in on alert:.on alert level 10 "Reach":
loop all players:
if loop-player has permission "staff.alerts":
send "&c%player.name% has 10 Reach violations" to loop-player
on alert level 25:
kick player because "&cToo many violations of %{_check}%"
on alert: off many times a second, and an honest one on a bad connection sets it off now and then. Count before you act, as the example does, and let the count fade:on alert:
add 1 to {%player%.warns}
every 5 minutes for all players:
if {%player%.warns} > 0:
subtract 1 from {%player%.warns}
punishments.yml is where that is set. If the player has left by then, the block does not run.grim violations of <who>HyperGrimHow many violations the player has, all checks together
reset grim violations of arg.1grim violations of <who> for <check>HyperGrimFor one check: grim violations of player for "Reach"
reset grim violations of arg.1 for "Reach"grim checks of <who>HyperGrimThe names of the checks the player has violations of, as a list
send "&7Failed: &f%grim checks of arg.1%"grim ping of <who>HyperGrimTheir ping as Grim measures it, in milliseconds
send "&7Ping: &f%grim ping of arg.1% ms"client brand of <who>HyperGrimWhat their game says it is: vanilla, fabric, lunarclient
send "&7Client: &f%client brand of arg.1% %client version of arg.1%"client version of <who>HyperGrimWhich version of Minecraft they play with
send "&7Client: &f%client brand of arg.1% %client version of arg.1%"grim versionHyperGrimWhich version of Grim the server runs
send "&8Grim %grim version%"command /check <target:player>:
permission: "staff.check"
trigger:
send "&7%arg.1%: &f%grim violations of arg.1% &7violations"
send "&7Failed: &f%grim checks of arg.1%"
set {_reach} to grim violations of arg.1 for "Reach"
send "&7Of those for Reach: &f%{_reach}%"
send "&7Client: &f%client brand of arg.1% %client version of arg.1%"
send "&7Ping: &f%grim ping of arg.1% ms"
send "&8Grim %grim version%"
| Syntax | Meaning |
|---|---|
grim violations of <who> | How many violations the player has, all checks together |
grim violations of <who> for <check> | For one check: grim violations of player for "Reach" |
grim checks of <who> | The names of the checks the player has violations of, as a list |
grim ping of <who> | Their ping as Grim measures it, in milliseconds |
client brand of <who> | What their game says it is: vanilla, fabric, lunarclient |
client version of <who> | Which version of Minecraft they play with |
grim version | Which version of Grim the server runs |
(grim violations of player) + 1.exempt <who> from grim for <duration>HyperGrimGrim leaves that player alone for the time: no flags and no pulling back. For what a script does to a player itself, such as a jump pad or a launch. Without for it is 5 seconds; 10 minutes is the most
exempt player from grim for 3 secondsreset grim violations of <who>HyperGrimTheir violations of every check are none again. for <check> after it resets one check only
reset grim violations of arg.1turn grim alerts of <who> onHyperGrimWhether that player sees Grim's alerts in chat; off for the other
turn grim alerts of player onon step on slime block:
exempt player from grim for 3 seconds
push player upward with force 2
command /pardon <target:player>:
permission: "staff.pardon"
trigger:
reset grim violations of arg.1
send "&aGrim has forgotten what it held against %arg.1%."
command /forgetreach <target:player>:
permission: "staff.pardon"
trigger:
reset grim violations of arg.1 for "Reach"
command /quietgrim:
permission: "staff.alerts"
trigger:
turn grim alerts of player off
send "&7You no longer see Grim's alerts. /loudgrim brings them back."
command /loudgrim:
permission: "staff.alerts"
trigger:
turn grim alerts of player on
| Syntax | Effect |
|---|---|
exempt <who> from grim for <duration> | Grim leaves that player alone for the time: no flags and no pulling back. For what a script does to a player itself, such as a jump pad or a launch. Without for it is 5 seconds; 10 minutes is the most |
reset grim violations of <who> | Their violations of every check are none again. for <check> after it resets one check only |
turn grim alerts of <who> on | Whether that player sees Grim's alerts in chat; off for the other |
exempt gives the player, for that long, the permissions Grim itself has for being left alone (grim.exempt, grim.nosetback), and takes them away again by itself. It needs a Grim that knows those permissions.An addon: a separate plugin whose words work once it is installed.
guard regions of <who>HyperGuardA list of the regions the player is standing in, the highest priority first
set {_regions} to guard regions of playerguard regions at <location>HyperGuardThe same for any place
if guard regions at event's location contains "museum":
cancel event
send "&cLook, do not touch."players in guard region <name>HyperGuardA list of the names of the online players inside
send "&7In the arena: &f" + join players in guard region "arena" with ", "all guard regionsHyperGuardThe names of every region in the player's world
send "&7Regions here: &f" + join all guard regions with ", "all guard regions in world <name>HyperGuardThe same for a world you name
send "&7Regions in %arg.1%: &f" + join all guard regions in world arg.1 with ", "command /where:
players only: true
trigger:
set {_regions} to guard regions of player
if size of {_regions} == 0:
send "&7You are in the wild."
else:
send "&7You are in: &f" + join {_regions} with ", "
command /arena:
trigger:
send "&7In the arena: &f" + join players in guard region "arena" with ", "
command /regions [world]:
permission: "regions.list"
trigger:
if arg.1 is set:
send "&7Regions in %arg.1%: &f" + join all guard regions in world arg.1 with ", "
else:
send "&7Regions here: &f" + join all guard regions with ", "
on block break:
if guard regions at event's location contains "museum":
cancel event
send "&cLook, do not touch."
| Syntax | Result |
|---|---|
guard regions of <who> | A list of the regions the player is standing in, the highest priority first |
guard regions at <location> | The same for any place |
players in guard region <name> | A list of the names of the online players inside |
all guard regions | The names of every region in the player's world |
all guard regions in world <name> | The same for a world you name |
contains, size of, for each, item 1 of all work.__global__ region is left out.on guard region enter "<name>":HyperGuardRuns when a player comes into that region, by walking, teleporting or joining inside it
on guard region enter "arena":
set gamemode of player to adventure
broadcast "&c%player.name% &7entered the arena."on guard region leave "<name>":HyperGuardRuns when a player leaves it
on guard region leave "arena":
set gamemode of player to survivalon guard region enter:HyperGuardWithout a name: runs for every region
on guard region enter:
log "%player.name% entered %{_region}%"What this event gives a script
| In the block | What it is |
|---|---|
{_region} | The region's name |
on guard region enter "arena":
set gamemode of player to adventure
broadcast "&c%player.name% &7entered the arena."
on guard region leave "arena":
set gamemode of player to survival
on guard region enter:
log "%player.name% entered %{_region}%"
| Syntax | Effect |
|---|---|
on guard region enter "<name>": | Runs when a player comes into that region, by walking, teleporting or joining inside it |
on guard region leave "<name>": | Runs when a player leaves it |
on guard region enter: | Without a name: runs for every region |
player is the player, as in HyperScript's own events, and {_region} is the region's name.entry flag, which a script can set (below).owners of guard region <name>HyperGuardA list of the owners' names
send "&7Owners: &f" + join owners of guard region {_plot} with ", "members of guard region <name>HyperGuardA list of the members' names
send "&7Members: &f" + join members of guard region {_plot} with ", "add <who> to guard region <name>HyperGuardMake a player a member
add arg.1 to guard region {_plot}add <who> to guard region <name> as ownerHyperGuardMake a player an owner
add arg.1 to guard region arg.2 as ownerremove <who> from guard region <name>HyperGuardTake a player out, as member and as owner
remove arg.1 from guard region {_plot}command /trust <target:player>:
players only: true
trigger:
set {_plot} to item 1 of guard regions of player
if {_plot} is not set or owners of guard region {_plot} does not contain player.name:
send "&cStand on a plot you own."
stop
add arg.1 to guard region {_plot}
send "&a%arg.1% can now build on %{_plot}%."
command /plotinfo:
players only: true
trigger:
set {_plot} to item 1 of guard regions of player
if {_plot} is not set:
send "&7There is no plot here."
stop
send "&7Owners: &f" + join owners of guard region {_plot} with ", "
send "&7Members: &f" + join members of guard region {_plot} with ", "
command /giveplot <target:player> <plot>:
permission: "plots.manage"
trigger:
add arg.1 to guard region arg.2 as owner
send "&a%arg.1% now owns %arg.2%."
command /untrust <target>:
players only: true
trigger:
set {_plot} to item 1 of guard regions of player
if {_plot} is set and owners of guard region {_plot} contains player.name:
remove arg.1 from guard region {_plot}
send "&e%arg.1% can no longer build on %{_plot}%."
| Syntax | Effect |
|---|---|
owners of guard region <name> | A list of the owners' names |
members of guard region <name> | A list of the members' names |
add <who> to guard region <name> | Make a player a member |
add <who> to guard region <name> as owner | Make a player an owner |
remove <who> from guard region <name> | Take a player out, as member and as owner |
<who> is player, all players, or a name. A named player may be offline./rg addmember.guard flag <flag> at <location>HyperGuardWhat the flag comes to at that place: allow or deny, or the flag's own value; unset if no region sets it
if guard flag "pvp" at event's location is "deny":
send action bar "&7No fighting here" to playerset guard flag <flag> of region <name> to <value>HyperGuardSet a flag on a region, as /rg flag does
set guard flag "pvp" of region "arena" to trueclear guard flag <flag> of region <name>HyperGuardTake the flag off the region again
clear guard flag "entry" of region "arena"command /arena <open|close>:
permission: "arena.manage"
trigger:
if arg.1 is "open":
set guard flag "pvp" of region "arena" to true
set guard flag "greeting" of region "arena" to "&cFight!"
clear guard flag "entry" of region "arena"
else:
set guard flag "pvp" of region "arena" to false
set guard flag "entry" of region "arena" to "deny"
send "&7Arena: %arg.1%"
on entity damage:
if guard flag "pvp" at event's location is "deny":
send action bar "&7No fighting here" to player
| Syntax | Effect |
|---|---|
guard flag <flag> at <location> | What the flag comes to at that place: allow or deny, or the flag's own value; unset if no region sets it |
set guard flag <flag> of region <name> to <value> | Set a flag on a region, as /rg flag does |
clear guard flag <flag> of region <name> | Take the flag off the region again |
"pvp", "entry", "greeting", "mob-spawning".true and false mean allow and deny. Any other value is given as text, written the way it would be typed after /rg flag <region> <flag>.create guard region <name> from <location> to <location>HyperGuardMake a box-shaped region between two corners. With a name that exists, the region is replaced
create guard region arg.1 from {%player%.a} to {%player%.b}create guard region <name> from <location> to <location> full heightHyperGuardThe same, from the bottom of the world to the top
create guard region {_name} from {_low} to {_high} full heightdelete guard region <name>HyperGuardRemove a region
delete guard region "plot_%player.name%"guard regions between <location> and <location>HyperGuardA list of the regions that touch the box between two corners; add full height as above
if size of guard regions between {_low} and {_high} full height > 0:
send "&cThat would overlap someone else's land."
stopguard allows building at <location>HyperGuardWhether WorldGuard lets the player build there, with owners, members, flags and bypass all considered
if guard allows building at player's location for arg.1:
send "&a%arg.1% may build where you stand."guard allows building at <location> for <who>HyperGuardThe same for another player who is online
if guard allows building at player's location for arg.1:
send "&a%arg.1% may build where you stand."priority of guard region <name>HyperGuardThe region's priority; settable with set priority of guard region <name> to <n>
set priority of guard region arg.1 to 10parent of guard region <name>HyperGuardThe region it inherits from; set parent of guard region <name> to <name>, or clear parent of guard region <name>
set parent of guard region arg.1 to "city"command /claim:
players only: true
trigger:
set {_name} to "plot_%player.name%"
set {_low} to player's location offset by -8, 0, -8
set {_high} to player's location offset by 8, 0, 8
if size of guard regions between {_low} and {_high} full height > 0:
send "&cThat would overlap someone else's land."
stop
create guard region {_name} from {_low} to {_high} full height
add player to guard region {_name} as owner
send "&aThis land is yours now."
command /unclaim:
players only: true
trigger:
delete guard region "plot_%player.name%"
send "&eYour land is free again."
on block break:
unless guard allows building at event's location:
send action bar "&cThis land belongs to someone else" to player
command /canbuild <target:player>:
permission: "plots.manage"
players only: true
trigger:
if guard allows building at player's location for arg.1:
send "&a%arg.1% may build where you stand."
else:
send "&c%arg.1% may not build where you stand."
command /plotsetup <plot>:
permission: "plots.manage"
trigger:
set priority of guard region arg.1 to 10
set parent of guard region arg.1 to "city"
send "&7Priority: &f" + priority of guard region arg.1
send "&7Parent: &f" + parent of guard region arg.1
| Syntax | Effect |
|---|---|
create guard region <name> from <location> to <location> | Make a box-shaped region between two corners. With a name that exists, the region is replaced |
create guard region <name> from <location> to <location> full height | The same, from the bottom of the world to the top |
delete guard region <name> | Remove a region |
guard regions between <location> and <location> | A list of the regions that touch the box between two corners; add full height as above |
guard allows building at <location> | Whether WorldGuard lets the player build there, with owners, members, flags and bypass all considered |
guard allows building at <location> for <who> | The same for another player who is online |
priority of guard region <name> | The region's priority; settable with set priority of guard region <name> to <n> |
parent of guard region <name> | The region it inherits from; set parent of guard region <name> to <name>, or clear parent of guard region <name> |
guard allows building at is the question to ask before a script places or breaks a block for a player; WorldGuard itself already stops the player's own building.guard region exists <name>HyperGuardTrue if WorldGuard has a region of that name, in any world. For asking before making one, or before using a name a player typed; nothing is said in the console when there is none
if guard region exists arg.1:
send "&cThere is a region called %arg.1% already."
stopcommand /makezone <name>:
permission: "zones.admin"
trigger:
if guard region exists arg.1:
send "&cThere is a region called %arg.1% already."
stop
create guard region arg.1 from {%player%.a} to {%player%.b}
send "&aMade %arg.1%."
| Syntax | Effect |
|---|---|
guard region exists <name> | True if WorldGuard has a region of that name, in any world. For asking before making one, or before using a name a player typed; nothing is said in the console when there is none |
claim guard region <name> from <location> to <location>HyperGuardMake a region and make the player its owner, if the name is free, the box touches no other region and the player is under their limit. full height as above; for <who> to claim for someone else who is online
claim guard region "land_%player.name%" from {_low} to {_high} full heightguard claim resultHyperGuardWhat the last claim came to: claimed, name taken, overlaps, limit reached, or failed when the corners or the player were no good
if guard claim result is "claimed":
send "&aThis land is yours now."guard regions owned by <who>HyperGuardA list of the regions a player owns, in every world
send "&7You own: &f" + join guard regions owned by player with ", "One line that does what a plot script otherwise checks by hand: is the name free, does the land touch anyone else's, and does the player already own as much as they may?
command /claimland:
players only: true
trigger:
set {_low} to player's location offset by -8, 0, -8
set {_high} to player's location offset by 8, 0, 8
claim guard region "land_%player.name%" from {_low} to {_high} full height
if guard claim result is "claimed":
send "&aThis land is yours now."
else if guard claim result is "overlaps":
send "&cThat would touch someone else's land."
else if guard claim result is "limit reached":
send "&cYou already own as much land as you may."
else:
send "&cYou have claimed land here before."
command /myland:
players only: true
trigger:
send "&7You own: &f" + join guard regions owned by player with ", "
| Syntax | Effect |
|---|---|
claim guard region <name> from <location> to <location> | Make a region and make the player its owner, if the name is free, the box touches no other region and the player is under their limit. full height as above; for <who> to claim for someone else who is online |
guard claim result | What the last claim came to: claimed, name taken, overlaps, limit reached, or failed when the corners or the player were no good |
guard regions owned by <who> | A list of the regions a player owns, in every world |
claim-limit in plugins/HyperGuard/config.yml, 3 unless changed; -1 is no limit. Players with the permission hyperguard.claim.unlimited are never held back.center of guard region <name>HyperGuardThe middle of the region, as a location
send "&7Middle: &f" + center of guard region arg.1random location in guard region <name>HyperGuardA place inside it: on the ground where the ground is within the region, otherwise on the region's floor. For arenas and for spawning creatures
teleport player to random location in guard region "arena"size of guard region <name>HyperGuardHow many blocks it holds
send "&7Blocks: &f" + size of guard region arg.1corners of guard region <name>HyperGuardA list of two locations: its lowest and its highest corner
set {_corners} to corners of guard region arg.1expand guard region <name> by <n> blocksHyperGuardMake it larger on every side; a negative number makes it smaller. Add sideways to leave its height alone
expand guard region arg.1 by arg.2 parsed as number blocks sidewaysmove guard region <name> to <location>HyperGuardMove it so that its middle is there. Its size, owners, members and flags stay
move guard region arg.1 to player's locationcommand /arena:
players only: true
trigger:
teleport player to random location in guard region "arena"
command /regioninfo <region>:
trigger:
send "&7Middle: &f" + center of guard region arg.1
send "&7Blocks: &f" + size of guard region arg.1
set {_corners} to corners of guard region arg.1
send "&7From &f" + item 1 of {_corners} + " &7to &f" + item 2 of {_corners}
command /grow <region> <blocks:number>:
permission: "regions.manage"
trigger:
expand guard region arg.1 by arg.2 parsed as number blocks sideways
send "&aDone."
command /bringregion <region>:
permission: "regions.manage"
players only: true
trigger:
move guard region arg.1 to player's location
| Syntax | Effect |
|---|---|
center of guard region <name> | The middle of the region, as a location |
random location in guard region <name> | A place inside it: on the ground where the ground is within the region, otherwise on the region's floor. For arenas and for spawning creatures |
size of guard region <name> | How many blocks it holds |
corners of guard region <name> | A list of two locations: its lowest and its highest corner |
expand guard region <name> by <n> blocks | Make it larger on every side; a negative number makes it smaller. Add sideways to leave its height alone |
move guard region <name> to <location> | Move it so that its middle is there. Its size, owners, members and flags stay |
copy guard region <name> as <name>HyperGuardRemember every block in the region's box, to put back with HyperScript's paste <name>. Needs HyperScript 1.7.15 or newer
copy guard region "arena" as "arena-clean"set fake blocks in guard region <name> to <block>HyperGuardShow the player the whole box as that block, without changing the world; for <who> for someone else. Needs HyperScript 1.7.14 or newer
set fake blocks in guard region "land_%player.name%" to "glass"clear fake blocks in guard region <name>HyperGuardShow what is really there again
clear fake blocks in guard region "land_%player.name%"HyperScript can copy a piece of the world and put it back, and show blocks that only one player sees. These do the same for the box of a WorldGuard region:
command /savearena:
permission: "arena.manage"
trigger:
copy guard region "arena" as "arena-clean"
command /resetarena:
permission: "arena.manage"
trigger:
paste "arena-clean"
command /showplot:
players only: true
trigger:
set fake blocks in guard region "land_%player.name%" to "glass"
wait 5 seconds
clear fake blocks in guard region "land_%player.name%"
| Syntax | Effect |
|---|---|
copy guard region <name> as <name> | Remember every block in the region's box, to put back with HyperScript's paste <name>. Needs HyperScript 1.7.15 or newer |
set fake blocks in guard region <name> to <block> | Show the player the whole box as that block, without changing the world; for <who> for someone else. Needs HyperScript 1.7.14 or newer |
clear fake blocks in guard region <name> | Show what is really there again |
on guard build denied:HyperGuardWorldGuard has stopped a player breaking or placing a block · {_region} (the region there, empty in the wilderness), {_action} (break or place), {_location}
on guard build denied:
send action bar "&cYou cannot build in %{_region}%" to playerWhat this event gives a script
| In the block | What it is |
|---|---|
{_region} | The region there, empty in the wilderness |
{_action} | break or place |
{_location} | The location |
on guard pvp denied:HyperGuardWorldGuard has stopped one player hurting another; the player is the attacker · {_region}, {_victim}
on guard pvp denied:
send "&cNo fighting here. %{_victim}% is safe."What this event gives a script
| In the block | What it is |
|---|---|
{_region} | The region there, empty in the wilderness |
{_victim} | The victim |
on guard build denied:
send action bar "&cYou cannot build in %{_region}%" to player
on guard pvp denied:
send "&cNo fighting here. %{_victim}% is safe."
| Event | When | In the block |
|---|---|---|
on guard build denied: | WorldGuard has stopped a player breaking or placing a block | {_region} (the region there, empty in the wilderness), {_action} (break or place), {_location} |
on guard pvp denied: | WorldGuard has stopped one player hurting another; the player is the attacker | {_region}, {_victim} |
on guard build denied "spawn":.deny-message flag: set guard flag "deny-message" of region "spawn" to "".An addon: a separate plugin whose words work once it is installed.
create holo <name> at <location> showing top <n> by {<variable>}HyperHologramsA list of the players who have the most of a variable of their own, such as {coins}, best first, up to 25. It is worked out again every half minute. titled <text> puts a line over it. Make it in on load:, since it is the script that keeps it up to date
create holo "richest" at player's location showing top 10 by {coins} titled "&6&lRichest players"create holo <name> at <location> with lines <text>, <text>HyperHologramsMake a hologram. With a name that is taken, it is moved there and given the new lines
create holo "crown" at player's location with lines "&6&lKING"delete holo <name>HyperHologramsRemove it for good
delete holo "hub"move holo <name> to <location>HyperHologramsPut it somewhere else
move holo "hub" to player's locationset line <n> of holo <name> to <text>HyperHologramsRewrite one line; the line after the last one is added
set line 2 of holo "hub" to "&7Players online: %server.online_players%"add line <text> to holo <name>HyperHologramsAdd a line at the bottom
add line "&e%arg.1%" to holo "hub"remove line <n> of holo <name>HyperHologramsTake one line out
remove line 3 of holo "hub"make holo <name> follow <who>HyperHologramsThe hologram stays over that player's head as they move, until told otherwise. Add <n> blocks above to say how high over their feet: make holo "tag" follow player 3 blocks above
make holo "crown" follow arg.1 3 blocks abovestop holo <name> followingHyperHologramsIt stays where it is
stop holo "crown" followingcommand /sethub:
permission: "holo.manage"
players only: true
trigger:
create holo "hub" at player's location with lines "&b&lWelcome", "&7Players online: %server.online_players%"
send "&aThe hub hologram is here now."
every 30 seconds:
if holo exists "hub":
set line 2 of holo "hub" to "&7Players online: %server.online_players%"
command /hubnews <text>:
permission: "holo.manage"
trigger:
add line "&e%arg.1%" to holo "hub"
set {_lines} to lines of holo "hub"
send "&aAdded. It has %size of {_lines}% lines now."
command /hubclear:
permission: "holo.manage"
trigger:
remove line 3 of holo "hub"
command /movehub:
permission: "holo.manage"
players only: true
trigger:
move holo "hub" to player's location
command /delhub:
permission: "holo.manage"
trigger:
delete holo "hub"
| Syntax | Effect |
|---|---|
create holo <name> at <location> showing top <n> by {<variable>} | A list of the players who have the most of a variable of their own, such as {coins}, best first, up to 25. It is worked out again every half minute. titled <text> puts a line over it. Make it in on load:, since it is the script that keeps it up to date |
create holo <name> at <location> with lines <text>, <text> | Make a hologram. With a name that is taken, it is moved there and given the new lines |
delete holo <name> | Remove it for good |
move holo <name> to <location> | Put it somewhere else |
set line <n> of holo <name> to <text> | Rewrite one line; the line after the last one is added |
add line <text> to holo <name> | Add a line at the bottom |
remove line <n> of holo <name> | Take one line out |
make holo <name> follow <who> | The hologram stays over that player's head as they move, until told otherwise. Add <n> blocks above to say how high over their feet: make holo "tag" follow player 3 blocks above |
stop holo <name> following | It stays where it is |
command /crown <player>:
permission: "crown.give"
trigger:
create holo "crown" at player's location with lines "&6&lKING"
make holo "crown" follow arg.1 3 blocks above
send "&6%arg.1% wears the crown."
command /uncrown:
permission: "crown.give"
trigger:
stop holo "crown" following
delete holo "crown"
- and _.create holo "tag-%player.name%" .... While the player is offline it waits where it was; following is not remembered over a restart, so start it again in on player join:.#ICON: diamond for a floating item.on load: is safe: making it again only moves it.add page to holo <name> with lines <text>, <text>HyperHologramsGive it another page
add page to holo "help" with lines "&6&lCommands", "&f/spawn &7- go to spawn", "&f/shop &7- open the shop"show page <n> of holo <name> to <who>HyperHologramsTurn it to that page for one player; others see what they saw
show page 2 of holo "help" to playershow holo <name> to <who>HyperHologramsLet a player see it
show holo "staffnotes" to playerhide holo <name> from <who>HyperHologramsHide it from a player
hide holo "staffnotes" from all playersshow holo <name> to all players / hide holo <name> from all playersHyperHologramsFor everybody, and for whoever joins later
show holo "staffnotes" to all playerson load:
create holo "help" at {help.spot} with lines "&6&lHelp", "&7Click for the next page"
if pages of holo "help" < 2:
add page to holo "help" with lines "&6&lCommands", "&f/spawn &7- go to spawn", "&f/shop &7- open the shop"
on holo click "help":
if {_page} is 1:
show page 2 of holo "help" to player
else:
show page 1 of holo "help" to player
on player join:
if player has permission "staff.see":
show holo "staffnotes" to player
command /hidenotes:
permission: "staff.see"
trigger:
hide holo "staffnotes" from all players
command /shownotes:
permission: "staff.see"
trigger:
show holo "staffnotes" to all players
| Syntax | Effect |
|---|---|
add page to holo <name> with lines <text>, <text> | Give it another page |
show page <n> of holo <name> to <who> | Turn it to that page for one player; others see what they saw |
show holo <name> to <who> | Let a player see it |
hide holo <name> from <who> | Hide it from a player |
show holo <name> to all players / hide holo <name> from all players | For everybody, and for whoever joins later |
hide holo ... from all players once, then show holo ... to player for those who should see it.all holosHyperHologramsA list of the names of every hologram
for each {_name} in all holos:
send "&e%{_name}% &7at %location of holo {_name}%"holo exists <name>HyperHologramsWhether there is one of that name
if holo exists "hub":
set line 2 of holo "hub" to "&7Players online: %server.online_players%"location of holo <name>HyperHologramsWhere it is, as a location
send "&e%{_name}% &7at %location of holo {_name}%"lines of holo <name>HyperHologramsA list of the lines of its first page
set {_lines} to lines of holo "hub"pages of holo <name>HyperHologramsHow many pages it has
if pages of holo "help" < 2:
add page to holo "help" with lines "&6&lCommands", "&f/spawn &7- go to spawn", "&f/shop &7- open the shop"on holo click "<name>":HyperHologramsRuns when a player clicks that hologram. Without a name: any hologram
on holo click "daily":
if {_click} is "right":
execute player command "daily"command /holos:
permission: "holo.manage"
trigger:
for each {_name} in all holos:
send "&e%{_name}% &7at %location of holo {_name}%"
on holo click "daily":
if {_click} is "right":
execute player command "daily"
on holo click:
log "%player.name% clicked the hologram %{_holo}% (%{_click}%)"
| Syntax | Result |
|---|---|
all holos | A list of the names of every hologram |
holo exists <name> | Whether there is one of that name |
location of holo <name> | Where it is, as a location |
lines of holo <name> | A list of the lines of its first page |
pages of holo <name> | How many pages it has |
on holo click "<name>": | Runs when a player clicks that hologram. Without a name: any hologram |
player is who clicked, {_holo} the hologram's name, {_click} one of left, right, shift left and shift right, and {_page} the page they were looking at.create holo <name> at <location> with lines <text>, <text> for <duration>HyperHologramsA hologram that deletes itself when the time is up, and when the server stops. Made again under the same name, the time starts over
create holo "crown" at player's location with lines "&6&lKING"nearest holo to <location>HyperHologramsThe name of the hologram closest to that place, in the same world; unset if there is none
set {_holo} to nearest holo to player's locationholos within <n> blocks of <location>HyperHologramsThe names of the holograms that near a place, the nearest first
for each {_holo} in holos within 10 blocks of player's location:
delete holo {_holo}set view distance of holo <name> to <n>HyperHologramsFrom how many blocks away it is shown, 1 to 256
set view distance of holo arg.1 to arg.2on player death:
create holo "grave-%player.name%" at player's location with lines "&7Here fell", "&f%player.name%" for 30 seconds
command /nearholo:
trigger:
set {_holo} to nearest holo to player's location
if {_holo} is set:
send "&7The nearest hologram is &f%{_holo}%&7."
else:
send "&7There is no hologram in this world."
command /clearholos:
permission: "holo.admin"
trigger:
for each {_holo} in holos within 10 blocks of player's location:
delete holo {_holo}
command /holorange <name> <blocks:number>:
permission: "holo.admin"
trigger:
set view distance of holo arg.1 to arg.2
| Syntax | Effect |
|---|---|
create holo <name> at <location> with lines <text>, <text> for <duration> | A hologram that deletes itself when the time is up, and when the server stops. Made again under the same name, the time starts over |
nearest holo to <location> | The name of the hologram closest to that place, in the same world; unset if there is none |
holos within <n> blocks of <location> | The names of the holograms that near a place, the nearest first |
set view distance of holo <name> to <n> | From how many blocks away it is shown, 1 to 256 |
command /richest:
permission: "staff.holo"
trigger:
create holo "richest" at player's location showing top 10 by {coins} titled "&6&lRichest players"
An addon: a separate plugin whose words work once it is installed.
who last changed block at <location>HyperLogThe name of whoever last placed or broke the block there; unset if nobody is on record
set {_name} to who last changed block at player's locationblock changes at <location>HyperLogWhat happened to that block, newest first, as a list of lines such as Steve placed stone, 5 minutes ago. Looks back 30 days
set {_lines} to block changes at player's location in the last 7 daysblock changes at <location> in the last <duration>HyperLogThe same, as far back as you say
set {_lines} to block changes at player's location in the last 7 daysblock changes by <who> in the last <duration>HyperLogWhat that player placed and broke in that time, newest first, each line with its place
set {_did} to block changes by arg.1 in the last 1 hour within 50 blocks of player... within <n> blocks of <location>HyperLogBehind block changes by: only around a place
rollback everything for 10 minutes within 20 blocks of playercommand /history:
permission: "staff.history"
trigger:
async:
set {_lines} to block changes at player's location in the last 7 days
loop {_lines}:
send "&7%loop-value%"
else:
send "&7Nothing happened to this block."
command /griefcheck <target>:
permission: "staff.griefcheck"
trigger:
async:
set {_did} to block changes by arg.1 in the last 1 hour within 50 blocks of player
send "&7%arg.1% changed &f%size of {_did}% &7blocks near you in the last hour."
| Syntax | Meaning |
|---|---|
who last changed block at <location> | The name of whoever last placed or broke the block there; unset if nobody is on record |
block changes at <location> | What happened to that block, newest first, as a list of lines such as Steve placed stone, 5 minutes ago. Looks back 30 days |
block changes at <location> in the last <duration> | The same, as far back as you say |
block changes by <who> in the last <duration> | What that player placed and broke in that time, newest first, each line with its place |
... within <n> blocks of <location> | Behind block changes by: only around a place |
async: block, as the examples do. CoreProtect reads its database to answer, and that should not hold up the server.<who> is a name, and it need not be somebody who is online. Where a location is asked for, player stands for where the player is.size of a list of changes is how many there were.rollback <who> for <duration>HyperLogTake back what that player placed and broke in that time, everywhere
rollback everything for 10 minutes within 20 blocks of playerrollback <who> for <duration> within <n> blocks of <location>HyperLogOnly around a place
rollback everything for 10 minutes within 20 blocks of playerrollback everything for <duration> within <n> blocks of <location>HyperLogWhoever did it. Everything can only be taken back around a place
rollback everything for 10 minutes within 20 blocks of playerrestore <who> for <duration>HyperLogPut back what a rollback took away. within and everything work as for rollback
restore arg.1 for arg.2command /undohere:
permission: "staff.undo"
trigger:
rollback everything for 10 minutes within 20 blocks of player
command /redo <target> <time:duration>:
permission: "staff.undo"
trigger:
restore arg.1 for arg.2
| Syntax | Effect |
|---|---|
rollback <who> for <duration> | Take back what that player placed and broke in that time, everywhere |
rollback <who> for <duration> within <n> blocks of <location> | Only around a place |
rollback everything for <duration> within <n> blocks of <location> | Whoever did it. Everything can only be taken back around a place |
restore <who> for <duration> | Put back what a rollback took away. within and everything work as for rollback |
/co rollback.who placed block at <location>HyperLogThe name of whoever last placed a block there; unset if nobody is on record. Not the same as who last changed block at, which may be whoever broke it
set {_placed} to who placed block at event's locationwho broke block at <location>HyperLogThe name of whoever last broke a block there
set {_broke} to who broke block at event's locationon right click with stick:
if event.block is not set:
stop
set {_placed} to who placed block at event's location
set {_broke} to who broke block at event's location
if {_placed} is set:
send "&7Placed by &f%{_placed}%"
if {_broke} is set:
send "&7Last broken by &f%{_broke}%"
if {_placed} is not set and {_broke} is not set:
send "&7Nobody is on record for this block."
| Syntax | Effect |
|---|---|
who placed block at <location> | The name of whoever last placed a block there; unset if nobody is on record. Not the same as who last changed block at, which may be whoever broke it |
who broke block at <location> | The name of whoever last broke a block there |
command /lastchange:
permission: "staff.who"
trigger:
set {_name} to who last changed block at player's location
send "&7Last changed by &f%{_name}%"
An addon: a separate plugin whose words work once it is installed.
spawn mythic mob <name> at <location>HyperMobsSpawn one of that mob
spawn mythic mob "SkeletonMinion" at {arena.middle}spawn mythic mob <name> at <location> level <n>HyperMobsThe same, at a level
spawn mythic mob "SkeletonKing" at player's location level 5remove mythic mobs <name>HyperMobsTake away every living mob of that kind. Without a name: every mythic mob
remove mythic mobs "SkeletonKing"last mythic mobHyperMobsThe creature spawn mythic mob made most recently, to keep in a variable
set {boss} to last mythic mobmythic mob exists <name>HyperMobsWhether MythicMobs has a mob of that name
if not mythic mob exists "SkeletonKing":
send "&cMythicMobs has no SkeletonKing."
stopall mythic mobsHyperMobsA list of the names of every mob MythicMobs has
send "&7MythicMobs has: &f" + join all mythic mobs with ", "mythic mobs aliveHyperMobsHow many mythic mobs are alive now
send "&7%mythic mobs alive% mythic mobs are left."mythic mobs alive of <name>HyperMobsThe same for one kind
if mythic mobs alive of "SkeletonMinion" < 5:
spawn mythic mob "SkeletonMinion" at {arena.middle}command /summonking:
permission: "bosses.spawn"
players only: true
trigger:
if not mythic mob exists "SkeletonKing":
send "&cMythicMobs has no SkeletonKing."
stop
spawn mythic mob "SkeletonKing" at player's location level 5
set {boss} to last mythic mob
send "&aThe Skeleton King is here, at level %mythic level of {boss}%."
every 10 minutes:
if mythic mobs alive of "SkeletonMinion" < 5:
spawn mythic mob "SkeletonMinion" at {arena.middle}
command /clearbosses:
permission: "bosses.spawn"
trigger:
remove mythic mobs "SkeletonKing"
send "&7%mythic mobs alive% mythic mobs are left."
| Syntax | Effect |
|---|---|
spawn mythic mob <name> at <location> | Spawn one of that mob |
spawn mythic mob <name> at <location> level <n> | The same, at a level |
remove mythic mobs <name> | Take away every living mob of that kind. Without a name: every mythic mob |
last mythic mob | The creature spawn mythic mob made most recently, to keep in a variable |
mythic mob exists <name> | Whether MythicMobs has a mob of that name |
all mythic mobs | A list of the names of every mob MythicMobs has |
mythic mobs alive | How many mythic mobs are alive now |
mythic mobs alive of <name> | The same for one kind |
health of {boss}, teleport, make {boss} target player and the rest of HyperScript work on it.cast mythic skill <name> from <who>HyperMobsHave a creature or a player cast one of MythicMobs' skills
cast mythic skill "Roar" from {boss}mythic mob type of <entity>HyperMobsWhich mythic mob a creature is, as its internal name; unset for an ordinary creature
send "&7The " + mythic mob type of {boss} + " is now level 10."mythic level of <entity>HyperMobsIts level; unset for an ordinary creature
set mythic level of {boss} to 10set mythic level of <entity> to <n>HyperMobsChange its level
set mythic level of {boss} to 10command /roar:
permission: "bosses.spawn"
trigger:
cast mythic skill "Roar" from {boss}
set mythic level of {boss} to 10
send "&7The " + mythic mob type of {boss} + " is now level 10."
command /mythiclist:
permission: "bosses.spawn"
trigger:
send "&7MythicMobs has: &f" + join all mythic mobs with ", "
on right click:
if player is holding blaze rod:
cast mythic skill "FireBlast" from player
| Syntax | Effect |
|---|---|
cast mythic skill <name> from <who> | Have a creature or a player cast one of MythicMobs' skills |
mythic mob type of <entity> | Which mythic mob a creature is, as its internal name; unset for an ordinary creature |
mythic level of <entity> | Its level; unset for an ordinary creature |
set mythic level of <entity> to <n> | Change its level |
<who> is an entity in a variable, or a player: from player, from arg.1.plugins/MythicMobs/Skills. One that does not exist, or that cannot be cast by that creature, is reported in the console.on mythic mob death "<name>":HyperMobsRuns when a mob of that kind dies. player is who killed it, if a player did
on mythic mob death "SkeletonKing":
drop mythic item "KingsCrown" at {_location}What this event gives a script
| In the block | What it is |
|---|---|
{_mob} | The creature |
{_type} | Its internal name |
{_level} | Its level |
{_location} | Where it is |
on mythic mob spawn "<name>":HyperMobsRuns when one spawns, however it was spawned. There is no player
on mythic mob spawn "SkeletonKing":
broadcast "&cThe Skeleton King has risen!"
set {boss} to {_mob}What this event gives a script
| In the block | What it is |
|---|---|
{_mob} | The creature |
{_type} | Its internal name |
{_level} | Its level |
{_location} | Where it is |
on mythic mob death "SkeletonKing":
broadcast "&6%player.name% &ehas slain the Skeleton King!"
add 500 to {%player%.coins}
on mythic mob death:
log "A level %{_level}% %{_type}% died at %{_location}%"
on mythic mob spawn "SkeletonKing":
broadcast "&cThe Skeleton King has risen!"
set {boss} to {_mob}
| Syntax | Effect |
|---|---|
on mythic mob death "<name>": | Runs when a mob of that kind dies. player is who killed it, if a player did |
on mythic mob spawn "<name>": | Runs when one spawns, however it was spawned. There is no player |
{_mob} is the creature, {_type} its internal name, {_level} its level and {_location} where it is.player; test if player is set: before giving a reward.give mythic item <name> to <who>HyperMobsGive one of the items MythicMobs has under that name. What does not fit is dropped at their feet. The console says so if there is no such item
give mythic item "KingsCrown" to arg.1give <n> of mythic item <name> to <who>HyperMobsThe same, that many
give 3 of mythic item "HealingDraught" to arg.1drop mythic item <name> at <location>HyperMobsPut one on the ground there
drop mythic item "KingsCrown" at {_location}all mythic itemsHyperMobsThe names of every item MythicMobs has
send "&7MythicMobs has %size of all mythic items% items."mythic mobs within <n> blocks of <location>HyperMobsThe mythic mobs that near a place, as creatures, the nearest first: for signal mythic mob, mythic mob type of, or anything HyperScript does with a creature
for each {_mob} in mythic mobs within 30 blocks of player's location:
signal mythic mob {_mob} with "rally"mythic item exists <name>HyperMobsTrue if MythicMobs has an item of that name
if mythic item exists "KingsCrown":
give mythic item "KingsCrown" to arg.1
give 3 of mythic item "HealingDraught" to arg.1signal mythic mob <entity> with <text>HyperMobsSend a mythic mob a signal, which its own skills can wait for with ~onSignal:<text>
signal mythic mob {_mob} with "rally"on mythic mob damage "<name>":HyperMobsRuns when a mythic mob of that type is hurt. {_damage} is how much, {_cause} what did it, and {_mob}, {_type}, {_level} and {_location} are as in the other events. player is who hurt it, if a player did, also with an arrow. Without a name it runs for every mythic mob
on mythic mob damage "SkeletonKing":
send action bar "&c-%{_damage}% &7to the king" to player
if {_damage} > 10:
signal mythic mob {_mob} with "enrage"command /crown <target:player>:
permission: "mythic.give"
trigger:
if mythic item exists "KingsCrown":
give mythic item "KingsCrown" to arg.1
give 3 of mythic item "HealingDraught" to arg.1
else:
send "&cMythicMobs has no item called KingsCrown."
on mythic mob damage "SkeletonKing":
send action bar "&c-%{_damage}% &7to the king" to player
if {_damage} > 10:
signal mythic mob {_mob} with "enrage"
on mythic mob damage:
add {_damage} to {%player%.mythic_damage}
on mythic mob death "SkeletonKing":
drop mythic item "KingsCrown" at {_location}
command /rally:
permission: "mythic.give"
trigger:
for each {_mob} in mythic mobs within 30 blocks of player's location:
signal mythic mob {_mob} with "rally"
send "&7MythicMobs has %size of all mythic items% items."
| Syntax | Effect |
|---|---|
give mythic item <name> to <who> | Give one of the items MythicMobs has under that name. What does not fit is dropped at their feet. The console says so if there is no such item |
give <n> of mythic item <name> to <who> | The same, that many |
drop mythic item <name> at <location> | Put one on the ground there |
all mythic items | The names of every item MythicMobs has |
mythic mobs within <n> blocks of <location> | The mythic mobs that near a place, as creatures, the nearest first: for signal mythic mob, mythic mob type of, or anything HyperScript does with a creature |
mythic item exists <name> | True if MythicMobs has an item of that name |
signal mythic mob <entity> with <text> | Send a mythic mob a signal, which its own skills can wait for with ~onSignal:<text> |
on mythic mob damage "<name>": | Runs when a mythic mob of that type is hurt. {_damage} is how much, {_cause} what did it, and {_mob}, {_type}, {_level} and {_location} are as in the other events. player is who hurt it, if a player did, also with an arrow. Without a name it runs for every mythic mob |
on mythic mob damage: runs for every hit on every mythic mob, so keep what is in it short.An addon: a separate plugin whose words work once it is installed.
give model <id> to <who>HyperModelsGive one of a custom item. What does not fit is dropped at their feet
give model "ruby" to playergive <n> of model <id> to <who>HyperModelsGive several
give {_amount} of model "ruby" to arg.1take model <id> from <who>HyperModelsTake one out of their inventory, if they have it
take model "ruby" from playertake <n> of model <id> from <who>HyperModelsTake up to that many
take {_have} of model "ruby" from playerdrop model <id> at <location>HyperModelsDrop one on the ground
drop model "ruby" at player's locationheld model of <who>HyperModelsThe id of the custom item in their main hand; unset for an ordinary item or an empty hand
if held model of player is "magic_wand":
cancel event
strike lightning at target block of playeramount of model <id> of <who>HyperModelsHow many of it they carry
set {_have} to amount of model "ruby" of playermodel exists <id>HyperModelsWhether any of the plugins has an item of that id
if not model exists "ruby":
send "&cThere is no item called ruby."
stopall modelsHyperModelsA list of every id, in alphabetical order
send "&7%size of all models% custom items: &f" + join all models with ", "command /ruby <player> <amount>:
permission: "models.give"
trigger:
if not model exists "ruby":
send "&cThere is no item called ruby."
stop
set {_amount} to parse arg.2 as integer
give {_amount} of model "ruby" to arg.1
send "&aGiven."
command /sellrubies:
players only: true
trigger:
set {_have} to amount of model "ruby" of player
if {_have} < 1:
send "&cYou have no rubies."
stop
take {_have} of model "ruby" from player
add {_have} * 25 to {%player%.coins}
send "&aSold %{_have}% rubies."
on right click:
if held model of player is "magic_wand":
cancel event
strike lightning at target block of player
command /payruby:
players only: true
trigger:
if amount of model "ruby" of player < 1:
send "&cThat costs one ruby."
stop
take model "ruby" from player
send "&aPaid."
on player death:
drop model "ruby" at player's location
command /models:
permission: "models.give"
trigger:
send "&7%size of all models% custom items: &f" + join all models with ", "
| Syntax | Effect |
|---|---|
give model <id> to <who> | Give one of a custom item. What does not fit is dropped at their feet |
give <n> of model <id> to <who> | Give several |
take model <id> from <who> | Take one out of their inventory, if they have it |
take <n> of model <id> from <who> | Take up to that many |
drop model <id> at <location> | Drop one on the ground |
held model of <who> | The id of the custom item in their main hand; unset for an ordinary item or an empty hand |
amount of model <id> of <who> | How many of it they carry |
model exists <id> | Whether any of the plugins has an item of that id |
all models | A list of every id, in alphabetical order |
place model block <id> at <location>HyperModelsPut a custom block there
place model block "ruby_ore" at target block of playerremove model block at <location>HyperModelsTake the custom block there away; an ordinary block is left alone
remove model block at target block of playermodel block at <location>HyperModelsThe id of the custom block there; unset for an ordinary block
remove model block at target block of playerplace model furniture <id> at <location>HyperModelsStand a piece of furniture there
place model furniture "chair" at player's locationcommand /rubyore:
permission: "models.build"
players only: true
trigger:
place model block "ruby_ore" at target block of player
send "&aPlaced."
command /clearore:
permission: "models.build"
players only: true
trigger:
if model block at target block of player is set:
remove model block at target block of player
command /chair:
permission: "models.build"
players only: true
trigger:
place model furniture "chair" at player's location
| Syntax | Effect |
|---|---|
place model block <id> at <location> | Put a custom block there |
remove model block at <location> | Take the custom block there away; an ordinary block is left alone |
model block at <location> | The id of the custom block there; unset for an ordinary block |
place model furniture <id> at <location> | Stand a piece of furniture there |
on model block break "<id>":HyperModelsRuns when a player breaks that custom block
on model block break "ruby_ore":
give model "ruby" to player
add 1 to {%player%.rubies_mined}What this event gives a script
| In the block | What it is |
|---|---|
{_model} | The id |
{_location} | Where it is |
on model block place "<id>":HyperModelsRuns when a player places it
on model block place "ruby_ore":
send "&7Ruby ore is for mines, not for walls."What this event gives a script
| In the block | What it is |
|---|---|
{_model} | The id |
{_location} | Where it is |
on model block click "<id>":HyperModelsRuns when a player right-clicks it
on model block click "crate":
execute player command "crate open"What this event gives a script
| In the block | What it is |
|---|---|
{_model} | The id |
{_location} | Where it is |
on model item click "<id>":HyperModelsRuns when a player right-clicks while holding that custom item in their main hand, in the air or at a block. {_location} is the block that was clicked, or where they stand
What this event gives a script
| In the block | What it is |
|---|---|
{_location} | The block that was clicked, or where they stand |
{_model} | The id |
on model furniture click "<id>":HyperModelsRuns when a player clicks a piece of furniture
on model furniture click "chair":
send "&7A comfortable chair."What this event gives a script
| In the block | What it is |
|---|---|
{_model} | The id |
{_location} | Where it is |
on model block break "ruby_ore":
give model "ruby" to player
add 1 to {%player%.rubies_mined}
on model block place "ruby_ore":
send "&7Ruby ore is for mines, not for walls."
on model block place:
log "%player.name% placed %{_model}% at %{_location}%"
on model block click "crate":
execute player command "crate open"
on model furniture click "chair":
send "&7A comfortable chair."
| Syntax | Effect |
|---|---|
on model block break "<id>": | Runs when a player breaks that custom block |
on model block place "<id>": | Runs when a player places it |
on model block click "<id>": | Runs when a player right-clicks it |
on model item click "<id>": | Runs when a player right-clicks while holding that custom item in their main hand, in the air or at a block. {_location} is the block that was clicked, or where they stand |
on model furniture click "<id>": | Runs when a player clicks a piece of furniture |
player is the player, {_model} the id and {_location} where it is.cancel event does not undo one.on model furniture place "<id>":HyperModelsRuns when a player puts that piece of furniture down. {_model} is its id and {_location} where it stands. Without an id it runs for every piece
on model furniture place "furniture:throne":
broadcast "&6%player.name% has set up a throne."
set {throne.place} to {_location}on model furniture break "<id>":HyperModelsRuns when a player breaks one, with the same values
on model furniture break "furniture:throne":
broadcast "&7The throne is gone."
delete {throne.place}remove model furniture at <location>HyperModelsTake away the piece of furniture that stands there, without dropping it. Nothing happens where there is none
remove model furniture at {throne.place}on model furniture place "furniture:throne":
broadcast "&6%player.name% has set up a throne."
set {throne.place} to {_location}
on model furniture break "furniture:throne":
broadcast "&7The throne is gone."
delete {throne.place}
on model furniture place:
add 1 to {%player%.furniture_placed}
command /clearthrone:
permission: "models.admin"
trigger:
if {throne.place} is set:
remove model furniture at {throne.place}
delete {throne.place}
| Syntax | Effect |
|---|---|
on model furniture place "<id>": | Runs when a player puts that piece of furniture down. {_model} is its id and {_location} where it stands. Without an id it runs for every piece |
on model furniture break "<id>": | Runs when a player breaks one, with the same values |
remove model furniture at <location> | Take away the piece of furniture that stands there, without dropping it. Nothing happens where there is none |
An addon: a separate plugin whose words work once it is installed.
add fake tab player <name>HyperPacketsPuts one on everybody's list. The name is what scripts call it by afterwards. Adding one that is there already changes it
add fake tab player arg.1 with ping 40... named <text>HyperPacketsWhat the list shows, with colours: named "&c&lConsole". Without it, the name itself
... with skin of <name>HyperPacketsThe head of that player. Somebody who is online is taken from the server; anybody else is asked of Mojang, which takes a moment, and the head changes when the answer is there
... with ping <n>HyperPacketsThe bars: 0 is full, 1000 is one bar
add fake tab player arg.1 with ping 40... with order <n>HyperPacketsWhere on the list: the higher the number, the further up. Real players are at 0. Needs Minecraft 1.21.2 or newer
... for <who>HyperPacketsOnly on that player's list
set tab name of fake player <name> to <text>HyperPacketsChanges what is shown
set tab ping of fake player <name> to <n>HyperPacketsChanges the bars
set tab order of fake player <name> to <n>HyperPacketsMoves it up or down the list
set tab skin of fake player <name> to <name>HyperPacketsAnother head. to "" gives the plain one
remove fake tab player <name>HyperPacketsTakes it off everybody's list. With for <who>, off that player's only
remove all fake tab playersHyperPacketsAll of them
remove all fake tab playersfake tab playersHyperPacketsThe names of those there are, as a list
remove all fake tab playersA fake tab player is a line on the list players see when they hold Tab. Nobody is on the server for it: it has a name, a skin for the little head, a ping for the bars, and a place.
| Syntax | What it does |
|---|---|
add fake tab player <name> | Puts one on everybody's list. The name is what scripts call it by afterwards. Adding one that is there already changes it |
... named <text> | What the list shows, with colours: named "&c&lConsole". Without it, the name itself |
... with skin of <name> | The head of that player. Somebody who is online is taken from the server; anybody else is asked of Mojang, which takes a moment, and the head changes when the answer is there |
... with ping <n> | The bars: 0 is full, 1000 is one bar |
... with order <n> | Where on the list: the higher the number, the further up. Real players are at 0. Needs Minecraft 1.21.2 or newer |
... for <who> | Only on that player's list |
set tab name of fake player <name> to <text> | Changes what is shown |
set tab ping of fake player <name> to <n> | Changes the bars |
set tab order of fake player <name> to <n> | Moves it up or down the list |
set tab skin of fake player <name> to <name> | Another head. to "" gives the plain one |
remove fake tab player <name> | Takes it off everybody's list. With for <who>, off that player's only |
remove all fake tab players | All of them |
fake tab players | The names of those there are, as a list |
What follows the name of add fake tab player can come in any order.
command /fakes <text>:
permission: "fakes.use"
trigger:
if arg.1 is "clear":
remove all fake tab players
send "&7Gone."
stop
add fake tab player arg.1 with ping 40
send "&a%arg.1% is on the list. There are now %size of fake tab players%."
on load: to keep them.with order does nothing there.To change the name a real player has on the list, HyperScript itself has set tab name of <who> to <text>; this addon is for entries that are nobody.
send packet <name> to <who>HyperPacketsSends that packet to a player, or to all players
send packet "change game state" with "win game", 1 to playersend packet <name> with <value>, <value> to <who>HyperPacketsWith the values the packet takes, in its order
send packet "change game state" with "win game", 1 to playerpacket namesHyperPacketsEvery packet there is, as a list
| Syntax | What it does |
|---|---|
send packet <name> to <who> | Sends that packet to a player, or to all players |
send packet <name> with <value>, <value> to <who> | With the values the packet takes, in its order |
packet names | Every packet there is, as a list |
The packets are PacketEvents' own, about 160 of them, and are named as it names them: "ChangeGameState", "EntityAnimation", "SetTitleText". Spaces and capitals do not matter, so "change game state" is the same.
/hyperpackets lists them all, and /hyperpackets <name> says what one takes:
/hyperpackets entity animation
EntityAnimation takes, in this order:
whole number, one of swing_main_arm/hurt/wake_up/swing_off_hand/critical_hit/magic_critical_hit
What a script gives is turned into what the packet asks for:
| The packet asks for | Give it |
|---|---|
| a whole number, a number | A number. Where it is the number of an entity, a player or an entity can be given instead: player |
| true/false | true or false |
| text | A text; colours with & work where the packet shows it |
| one of ... | One of the words listed, as text: "swing main arm" |
| a place | A location, or three numbers as a list: [0, 1, 0] |
| UUID | A player or an entity |
| ItemStack | The name of an item: "diamond sword" |
| a list of something | Several values of that kind, as a list or one after another |
command /swing:
trigger:
send packet "entity animation" with player, "swing main arm" to all players
command /credits:
trigger:
send packet "change game state" with "win game", 1 to player
An addon: a separate plugin whose words work once it is installed.
group of <who>HyperPermsThe player's primary group, e.g. default or vip
set group of arg.1 to "default"groups of <who>HyperPermsA list of every group the player is in
set {_groups} to groups of track "staff"prefix of <who>HyperPermsThe chat prefix LuckPerms gives the player; unset if none
clear prefix of playersuffix of <who>HyperPermsThe chat suffix; unset if none
clear suffix of playeron player join:
if group of player is "default":
send "&7Type &f/rankup &7when you have 1000 coins."
if groups of player contains "vip":
send "&6Welcome back, VIP!"
on player chat:
set {_before} to prefix of player
set {_after} to suffix of player
set chat format to "%{_before}%&f%player.name%%{_after}%&7: &f%event.message%"
| Syntax | Result |
|---|---|
group of <who> | The player's primary group, e.g. default or vip |
groups of <who> | A list of every group the player is in |
prefix of <who> | The chat prefix LuckPerms gives the player; unset if none |
suffix of <who> | The chat suffix; unset if none |
if group of player is "vip":, if groups of arg.1 contains "staff":, send "Rank: " + group of player.prefix of team "red" is still HyperScript's own, about scoreboard teams.add <who> to group <name>HyperPermsPut a player in a group, keeping the ones they have
add arg.1 to group "vip" for arg.2 * 1 dayadd <who> to group <name> for <duration>HyperPermsThe same, for a limited time; LuckPerms takes it away again
add arg.1 to group "vip" for arg.2 * 1 daytime left in group <name> of <who>HyperPermsHow long a time-limited membership still lasts, as a duration; unset if they are not in the group, or are in it for good
set {_left} to time left in group "vip" of playerremove <who> from group <name>HyperPermsTake a player out of a group
remove arg.1 from group "vip"set group of <who> to <name>HyperPermsOut of every other group and into this one
set group of arg.1 to "default"promote <who> on track <name>HyperPermsOne group up a track made in LuckPerms (/lp createtrack staff). Somebody who is on none of its groups gets the first
promote arg.1 on track "staff"demote <who> on track <name>HyperPermsOne group down; from the first group, out of the track
demote arg.1 on track "staff"command /givevip <target:player> <days:integer>:
permission: "ranks.give"
trigger:
add arg.1 to group "vip" for arg.2 * 1 day
send "&a%arg.1% is VIP for %arg.2% day(s)."
command /vipleft:
trigger:
set {_left} to time left in group "vip" of player
if {_left} is not set:
send "&7You are not VIP for a limited time."
stop
send "&6Your VIP lasts another %{_left}%."
command /demote <target:player>:
permission: "ranks.give"
trigger:
set group of arg.1 to "default"
command /takevip <target:player>:
permission: "ranks.give"
trigger:
remove arg.1 from group "vip"
send "&e%arg.1% is no longer VIP."
| Syntax | Effect |
|---|---|
add <who> to group <name> | Put a player in a group, keeping the ones they have |
add <who> to group <name> for <duration> | The same, for a limited time; LuckPerms takes it away again |
time left in group <name> of <who> | How long a time-limited membership still lasts, as a duration; unset if they are not in the group, or are in it for good |
remove <who> from group <name> | Take a player out of a group |
set group of <who> to <name> | Out of every other group and into this one |
promote <who> on track <name> | One group up a track made in LuckPerms (/lp createtrack staff). Somebody who is on none of its groups gets the first |
demote <who> on track <name> | One group down; from the first group, out of the track |
<who> is player, all players, or a name. A named player may be offline: LuckPerms looks them up, makes the change and saves it.grant <who> permission <node>HyperPermsGive a player one permission, for good
grant group arg.1 permission "essentials.fly"grant <who> permission <node> for <duration>HyperPermsThe same for a limited time; LuckPerms takes it away again
grant arg.1 permission "essentials.fly" for 1 hourrevoke permission <node> from <who>HyperPermsTake a permission back
revoke permission "essentials.fly" from arg.1command /fly1h <target:player>:
permission: "ranks.give"
trigger:
grant arg.1 permission "essentials.fly" for 1 hour
send "&a%arg.1% can fly for an hour."
command /nofly <target:player>:
permission: "ranks.give"
trigger:
revoke permission "essentials.fly" from arg.1
| Syntax | Effect |
|---|---|
grant <who> permission <node> | Give a player one permission, for good |
grant <who> permission <node> for <duration> | The same for a limited time; LuckPerms takes it away again |
revoke permission <node> from <who> | Take a permission back |
<who> may be a player who is offline, and a new time limit replaces an old one.permission <who> add <node> is a different thing: it lasts until the player leaves and is not saved.all groupsHyperPermsA list of every group LuckPerms has, in alphabetical order
for each {_group} in all groups:
send "&7%{_group}% &8- &fweight " + weight of group {_group}rank of <who> on track <name>HyperPermsThe group of that track the player is in, the highest if several; unset if none. For players who are online
set {_now} to rank of arg.1 on track "staff"groups of track <name>HyperPermsThe groups of a track, from the lowest to the highest
set {_groups} to groups of track "staff"players in group <name>HyperPermsThe names of the online players in that group, directly or through another group
send "&7Staff online: &f" + join players in group "staff" with ", "weight of group <name>HyperPermsThe group's weight; unset if it has none
set weight of group arg.1 to 50command /staff:
trigger:
send "&7Staff online: &f" + join players in group "staff" with ", "
command /ranks:
trigger:
for each {_group} in all groups:
send "&7%{_group}% &8- &fweight " + weight of group {_group}
| Syntax | Result |
|---|---|
all groups | A list of every group LuckPerms has, in alphabetical order |
rank of <who> on track <name> | The group of that track the player is in, the highest if several; unset if none. For players who are online |
groups of track <name> | The groups of a track, from the lowest to the highest |
players in group <name> | The names of the online players in that group, directly or through another group |
weight of group <name> | The group's weight; unset if it has none |
meta <key> of <who>HyperPermsA meta value of the player, their own or from one of their groups; unset if there is none
clear meta "home-limit" of arg.1set meta <key> of <who> to <value>HyperPermsGive the player a value of their own under that key
set meta "home-limit" of arg.1 to arg.2clear meta <key> of <who>HyperPermsTake the player's own value away again
clear meta "home-limit" of arg.1command /sethomelimit <target:player> <amount:integer>:
permission: "ranks.give"
trigger:
set meta "home-limit" of arg.1 to arg.2
send "&a%arg.1% may now have %arg.2% homes."
command /homelimit:
players only: true
trigger:
set {_limit} to meta "home-limit" of player
if {_limit} is not set:
set {_limit} to 1
send "&7You may have &f%{_limit}% &7home(s)."
command /resethomelimit <target:player>:
permission: "ranks.give"
trigger:
clear meta "home-limit" of arg.1
| Syntax | Effect |
|---|---|
meta <key> of <who> | A meta value of the player, their own or from one of their groups; unset if there is none |
set meta <key> of <who> to <value> | Give the player a value of their own under that key |
clear meta <key> of <who> | Take the player's own value away again |
/lp group vip meta set home-limit 5 gives every VIP a limit of 5, and a script reads it with meta "home-limit" of player.parsed as number to count with it.on group change:HyperPermsRuns when the groups of any player change, however it happened
on group change:
log "%{_player}% is now in %{_group}% (%{_groups}%)"
if {_group} is "vip":
send "&6Thank you for supporting the server!" to {_player}What this event gives a script
| In the block | What it is |
|---|---|
{_player} | The player's name |
{_group} | Their primary group after the change |
{_groups} | The list of all their groups |
on group change:
log "%{_player}% is now in %{_group}% (%{_groups}%)"
if {_group} is "vip":
send "&6Thank you for supporting the server!" to {_player}
| Syntax | Effect |
|---|---|
on group change: | Runs when the groups of any player change, however it happened |
{_player} is the player's name, {_group} their primary group after the change, and {_groups} the list of all their groups./lp commands and by a time limit running out alike.{_player} to say who it is about.create group <name>HyperPermsMake a LuckPerms group. Small letters, digits, _, - and . only; a group that is there already is left as it is
create group arg.1delete group <name>HyperPermsDelete one, for good. default is never deleted
delete group arg.1set prefix of <who> to <text>HyperPermsGive a player a prefix of their own, in front of whatever their groups give. set suffix of <who> to <text> likewise
set prefix of player to "&d[%arg.1%&d] "set prefix of group <name> to <text>HyperPermsThe same for a group, and set suffix of group <name> to <text>
set prefix of group arg.1 to "&7[%arg.2%&7] "clear prefix of <who>HyperPermsTake away the prefix a player has of their own; the one of their group shows again. clear suffix of, and of group <name>, likewise
clear prefix of playergroup exists <name>HyperPermsTrue if LuckPerms has a group of that name
if group exists arg.1:
delete group arg.1grant group <name> permission <node>HyperPermsGive a group a permission, for everybody in it. revoke permission <node> from group <name> takes it back
grant group arg.1 permission "essentials.fly"set weight of group <name> to <n>HyperPermsWhich group counts for more when a player is in several: the higher number wins
set weight of group arg.1 to 50permissions of group <name>HyperPermsA list of every permission a group has, its own and those of the groups it inherits from
send "&7%arg.1% has %size of permissions of group arg.1% permissions."permissions of <who>HyperPermsA list of every permission a player who is online has, their own and those of their groups
set {_nodes} to permissions of playercommand /makerank <name> <prefix>:
permission: "ranks.admin"
trigger:
create group arg.1
wait 1 second
set prefix of group arg.1 to "&7[%arg.2%&7] "
send "&aThere is now a group called %arg.1%."
command /dropgroup <name>:
permission: "ranks.admin"
trigger:
if group exists arg.1:
delete group arg.1
else:
send "&cThere is no group called %arg.1%."
command /groupfly <name>:
permission: "ranks.admin"
trigger:
grant group arg.1 permission "essentials.fly"
set weight of group arg.1 to 50
send "&7%arg.1% has %size of permissions of group arg.1% permissions."
command /groupnofly <name>:
permission: "ranks.admin"
trigger:
revoke permission "essentials.fly" from group arg.1
command /title <text>:
permission: "title.use"
trigger:
set prefix of player to "&d[%arg.1%&d] "
set suffix of player to " &8*"
command /notitle:
trigger:
clear prefix of player
clear suffix of player
command /myperms:
trigger:
set {_nodes} to permissions of player
send "&7You have %size of {_nodes}% permissions."
if {_nodes} contains "essentials.fly":
send "&aFlying is one of them."
| Syntax | Effect |
|---|---|
create group <name> | Make a LuckPerms group. Small letters, digits, _, - and . only; a group that is there already is left as it is |
delete group <name> | Delete one, for good. default is never deleted |
set prefix of <who> to <text> | Give a player a prefix of their own, in front of whatever their groups give. set suffix of <who> to <text> likewise |
set prefix of group <name> to <text> | The same for a group, and set suffix of group <name> to <text> |
clear prefix of <who> | Take away the prefix a player has of their own; the one of their group shows again. clear suffix of, and of group <name>, likewise |
group exists <name> | True if LuckPerms has a group of that name |
grant group <name> permission <node> | Give a group a permission, for everybody in it. revoke permission <node> from group <name> takes it back |
set weight of group <name> to <n> | Which group counts for more when a player is in several: the higher number wins |
permissions of group <name> | A list of every permission a group has, its own and those of the groups it inherits from |
permissions of <who> | A list of every permission a player who is online has, their own and those of their groups |
wait.clear prefix of team ... and set prefix of team ... are HyperScript's own, for scoreboard teams, and are left to it.command /promote <target:player>:
permission: "staff.promote"
trigger:
promote arg.1 on track "staff"
set {_now} to rank of arg.1 on track "staff"
send "&a%arg.1% is now %{_now}%"
command /demote <target:player>:
permission: "staff.promote"
trigger:
demote arg.1 on track "staff"
command /ladder:
trigger:
set {_groups} to groups of track "staff"
send "&7Staff ranks: &f%{_groups}%"
An addon: a separate plugin whose words work once it is installed.
on plot enter:HyperPlotsRuns when a player walks, or is taken, into a plot. player is who came
on plot enter:
if {_owner} is player.name:
send "&aWelcome home."on plot leave:HyperPlotsRuns when they go out of one: onto the road, into another plot, or to another world
on plot leave:
send action bar "&7You left plot %{_plot}%" to playeron plot enter:
if {_owner} is player.name:
send "&aWelcome home."
on plot leave:
send action bar "&7You left plot %{_plot}%" to player
| Syntax | Effect |
|---|---|
on plot enter: | Runs when a player walks, or is taken, into a plot. player is who came |
on plot leave: | Runs when they go out of one: onto the road, into another plot, or to another world |
on plot enter: {_plot} is the plot's number as PlotSquared writes it (3;-2), {_owner} the name of its owner, unset for a plot nobody has claimed, and {_owners} all of them as a list. on plot leave: has {_plot}, the one that was left.on plot leave: for the first and then on plot enter: for the second.deny are what keep players out.plot at <location>HyperPlotsThe number of the plot a place is in, as text such as 3;-2; unset on a road or outside a plot world
add arg.1 to plot at player's locationplot of <who>HyperPlotsThe plot that player stands in; unset if they stand in none
set {_plot} to plot of playerowner of plot at <location>HyperPlotsThe name of its owner; unset for a plot nobody has claimed
set {_owner} to owner of plot at player's locationowners of plot at <location>HyperPlotsAll of them, as a list; a plot can have several
set {_owners} to owners of plot at player's locationmembers of plot at <location>HyperPlotsThe players added as members
set {_members} to members of plot at player's locationtrusted of plot at <location>HyperPlotsThe players who are trusted there
set {_helpers} to trusted of plot at player's locationdenied of plot at <location>HyperPlotsThe players who are kept out
set {_denied} to denied of plot at player's locationplots of <who>HyperPlotsThe numbers of the plots a player owns, as a list
set {_mine} to plots of playerplot count of <who>HyperPlotsHow many plots they own
set {_count} to plot count of playercommand /whose:
trigger:
set {_plot} to plot of player
if {_plot} is not set:
send "&7You are not on a plot."
stop
set {_owner} to owner of plot at player's location
send "&7Plot &f%{_plot}% &7belongs to &f%{_owner}%"
set {_helpers} to trusted of plot at player's location
send "&7Trusted: &f%{_helpers}%"
| Syntax | Meaning |
|---|---|
plot at <location> | The number of the plot a place is in, as text such as 3;-2; unset on a road or outside a plot world |
plot of <who> | The plot that player stands in; unset if they stand in none |
owner of plot at <location> | The name of its owner; unset for a plot nobody has claimed |
owners of plot at <location> | All of them, as a list; a plot can have several |
members of plot at <location> | The players added as members |
trusted of plot at <location> | The players who are trusted there |
denied of plot at <location> | The players who are kept out |
plots of <who> | The numbers of the plots a player owns, as a list |
plot count of <who> | How many plots they own |
plots of and plot count of are about players who are online; for somebody who is not, the list is empty and the count 0.(plot count of player) + 1.add <who> to plot at <location>HyperPlotsPut a player on the plot's list of members, who may build while an owner is online
add arg.1 to plot at player's locationadd <who> to plot at <location> as trustedHyperPlotsPut them on the list of trusted players, who may build at any time
add arg.1 to plot at player's location as trusteddeny <who> from plot at <location>HyperPlotsPut them on the list of players who may not come in
deny arg.1 from plot at player's locationremove <who> from plot at <location>HyperPlotsTake them off all three lists
remove arg.1 from plot at player's locationplot claimed at <location>HyperPlotsTrue where there is a plot that somebody owns
if plot claimed at player's location:
send "&7Somebody owns this plot."command /letin <target:offline player>:
trigger:
if owner of plot at player's location is not player.name:
send "&cThis is not your plot."
stop
add arg.1 to plot at player's location
send "&a%arg.1% may now build here while you are online."
command /trustin <target:offline player>:
trigger:
if owner of plot at player's location is player.name:
add arg.1 to plot at player's location as trusted
command /keepout <target:offline player>:
trigger:
if owner of plot at player's location is player.name:
deny arg.1 from plot at player's location
command /unlist <target:offline player>:
trigger:
if owner of plot at player's location is player.name:
remove arg.1 from plot at player's location
command /free:
trigger:
if plot claimed at player's location:
send "&7Somebody owns this plot."
else:
send "&aNobody owns this."
| Syntax | Effect |
|---|---|
add <who> to plot at <location> | Put a player on the plot's list of members, who may build while an owner is online |
add <who> to plot at <location> as trusted | Put them on the list of trusted players, who may build at any time |
deny <who> from plot at <location> | Put them on the list of players who may not come in |
remove <who> from plot at <location> | Take them off all three lists |
plot claimed at <location> | True where there is a plot that somebody owns |
/plot add, /plot trust, /plot deny and /plot remove do, without asking who runs the command: check the owner in the script, as the examples do.command /plotinfo:
trigger:
set {_owners} to owners of plot at player's location
set {_members} to members of plot at player's location
set {_denied} to denied of plot at player's location
send "&7Owners: &f%{_owners}% &7Members: &f%{_members}% &7Kept out: &f%{_denied}%"
command /plotlist:
trigger:
set {_mine} to plots of player
set {_count} to plot count of player
send "&7Your %{_count}% plots: &f%{_mine}%"
An addon: a separate plugin whose words work once it is installed.
set skin of <who> to <text>HyperSkinGive a player the skin of that name: the skin of the player called so, or one SkinsRestorer has under that name. The address of a skin image works too
set skin of player to arg.1reset skin of <who>HyperSkinGive them their own skin back
reset skin of playerskin of <who>HyperSkinWhat the skin they were given is called; unset while they wear their own
reset skin of playeron player join:
if {%player%.team} is "red":
set skin of player to "https://example.com/skins/red.png"
command /lookalike <target:player>:
permission: "skin.others"
trigger:
set skin of player to arg.1
send "&7You are wearing: &f%skin of player%"
command /unskin:
trigger:
reset skin of player
| Syntax | Effect |
|---|---|
set skin of <who> to <text> | Give a player the skin of that name: the skin of the player called so, or one SkinsRestorer has under that name. The address of a skin image works too |
reset skin of <who> | Give them their own skin back |
skin of <who> | What the skin they were given is called; unset while they wear their own |
set skin of run before the player looks different. A skin that cannot be found is said in the console, with the script and line, and the player keeps the one they have.set skin of npc ... belongs to HyperCitizens and is left to it.copy skin of <who> to <who>HyperSkinGive the second player the skin the first one wears: the one they were given, or their own
copy skin of arg.1 to playerskin texture of <who>HyperSkinThe skin a player who is online has on right now, as the text a head takes: 1 player head textured <value>. It is the skin they were given, or their own if they were given none. Unset if the server cannot tell
set {_texture} to skin texture of playercommand /twin <target:player>:
permission: "skin.others"
trigger:
copy skin of arg.1 to player
send "&7You now look like %arg.1%."
command /myhead:
trigger:
set {_texture} to skin texture of player
if {_texture} is not set:
send "&cYour skin could not be read."
stop
give 1 player head textured {_texture} named "&f%player.name%" to player
| Syntax | Effect |
|---|---|
copy skin of <who> to <who> | Give the second player the skin the first one wears: the one they were given, or their own |
skin texture of <who> | The skin a player who is online has on right now, as the text a head takes: 1 player head textured <value>. It is the skin they were given, or their own if they were given none. Unset if the server cannot tell |
owned by shows the skin of that account, whatever the player is wearing; this is the one for the skin SkinsRestorer has put on them.An addon: a separate plugin whose words work once it is installed.
all proxy playersHyperVelocityA list of the names of everyone on the proxy
set {_players} to all proxy playersthis server playersHyperVelocityA list of the names of everyone on this server
set {_here} to join this server players with ", "players on server <name>HyperVelocityA list of the names on one server
set {_online} to size of players on server arg.1proxy serversHyperVelocityA list of the names of the servers behind the proxy
for each {_server} in proxy servers:
set {_names} to join players on server {_server} with ", "
send "&e%{_server}%&7: &f%{_names}%"proxy player countHyperVelocityHow many players are on the proxy
set {_count} to proxy player countthis server nameHyperVelocityThe name the proxy knows this server by
set {_name} to this server nameValues about the whole network. They are what the proxy last reported, so they can be a few seconds behind.
command /glist:
trigger:
set {_players} to all proxy players
set {_count} to proxy player count
send "&6%{_count}% player(s) on the network:"
for each {_server} in proxy servers:
set {_names} to join players on server {_server} with ", "
send "&e%{_server}%&7: &f%{_names}%"
command /here:
trigger:
set {_here} to join this server players with ", "
set {_name} to this server name
send "&7On &f%{_name}%&7: &f%{_here}%"
| Syntax | Result |
|---|---|
all proxy players | A list of the names of everyone on the proxy |
this server players | A list of the names of everyone on this server |
players on server <name> | A list of the names on one server |
proxy servers | A list of the names of the servers behind the proxy |
proxy player count | How many players are on the proxy |
this server name | The name the proxy knows this server by |
size of all proxy players, if all proxy players contains arg.1:, for each {_name} in players on server "pvp":.this server name is unset. The first time a script asks for players on server "x", that server is added to the ones asked about, so the very first answer may be empty.this server players never needs the proxy and is always current.send <who> to server <name>HyperVelocityMove a player to another server
send player to server "pvp"command /pvp:
trigger:
send "&7Sending you to the PvP server..."
send player to server "pvp"
command /sendall <server>:
permission: op
trigger:
send all players to server arg.1
| Syntax | Effect |
|---|---|
send <who> to server <name> | Move a player to another server |
<who> is player, all players (everyone on this server), or a name. A named player may be on any server of the network: send "Alex" to server "lobby".send with a new ending. send "hello" to player still sends a message.send variable {<name>} to server <name>HyperVelocityCopy a variable's value to the same variable on another server
send variable {%player%.coins} to server "pvp"send variable {<name>} to all serversHyperVelocityThe same, to every other server
send variable {shared.motd} to all serverscommand /setmotd <text>:
permission: op
trigger:
set {shared.motd} to args
send variable {shared.motd} to all servers
send "&aThe message of the day was changed on every server."
command /sharecoins:
trigger:
send variable {%player%.coins} to server "pvp"
send "&7Your coins were copied to the PvP server."
| Syntax | Effect |
|---|---|
send variable {<name>} to server <name> | Copy a variable's value to the same variable on another server |
send variable {<name>} to all servers | The same, to every other server |
send variable {%player%.coins} to server "pvp" sets that player's {%player%.coins} there.to all servers does not include the server that is sending.accept-variables under Installation.send event <name> to server <name>HyperVelocityRun the on receive event blocks for that name on another server
send event "alert" with variable "Text", arg.2 to server arg.1send event <name> to all serversHyperVelocityThe same, on every other server
send event "ban" with variable "Target", arg.1 with variable "Reason", arg.2 to all serverswith variable <name>, <value>HyperVelocityAttach a value; write it once per value, before to
send event "alert" with variable "Text", arg.2 to server arg.1on receive event <name>:HyperVelocityThe block that runs when the event arrives
on receive event "ban":
set {_p} to {_Target} parsed as offlineplayer
ban {_p} because {_Reason}
log "%{_p}% was banned from %{_sender_server}%"One server can make something happen on another. The sender names an event and may attach values; the receiver has a block for it.
On the sending server:
command /netban <player> <reason>:
permission: "staff.ban"
trigger:
send event "ban" with variable "Target", arg.1 with variable "Reason", arg.2 to all servers
ban arg.1 because arg.2
command /alert <server> <text>:
permission: op
trigger:
send event "alert" with variable "Text", arg.2 to server arg.1
On every receiving server:
on receive event "ban":
set {_p} to {_Target} parsed as offlineplayer
ban {_p} because {_Reason}
log "%{_p}% was banned from %{_sender_server}%"
| Syntax | Effect |
|---|---|
send event <name> to server <name> | Run the on receive event blocks for that name on another server |
send event <name> to all servers | The same, on every other server |
with variable <name>, <value> | Attach a value; write it once per value, before to |
on receive event <name>: | The block that runs when the event arrives |
with variable "Target", arg.1 is read as {_Target}. Names ignore case.{_sender_server} is always there too: the name of the server the event came from.on receive event: without a name runs for every event that arrives.send with no target goes to the console. Use the attached values to say who it is about.on recieve event is accepted as well, for those of us who spell it that way.send party of <who> to server <name>HyperVelocityMove everyone in that player's party. Someone without a party goes alone
send party of player to server arg.1send group <list> to server <name>HyperVelocityMove the players in a list together, such as those a queue hands over
send group {_players} to server "arena"HyperScript's parties live on one server. These move a party, or any group of players, to another server together, and there they are one party again.
command /partywarp <server>:
players only: true
trigger:
if party leader of player is not player:
send "&cOnly the leader can move the party."
stop
send party of player to server arg.1
on queue "duels" of 2:
send group {_players} to server "arena"
| Syntax | Effect |
|---|---|
send party of <who> to server <name> | Move everyone in that player's party. Someone without a party goes alone |
send group <list> to server <name> | Move the players in a list together, such as those a queue hands over |
request variable {<name>} from server <name>HyperVelocityAsk another server what it has in that variable. When the answer comes, the variable here is set to it
request variable {%player%.coins} from server "survival"on receive variable <name>:HyperVelocityRuns when such an answer has arrived. {_value} is what came, {_owner} the player it belongs to (empty for a variable that is nobody's), {_sender_server} who answered
on receive variable "coins":
send "&7Your coins on survival: &f%{_value}%" to {_owner}What this event gives a script
| In the block | What it is |
|---|---|
{_value} | What came |
{_owner} | The player it belongs to (empty for a variable that is nobody's) |
{_sender_server} | Who answered |
send variable pushes a value to another server. This asks for one instead:
command /coins:
players only: true
trigger:
request variable {%player%.coins} from server "survival"
send "&7Asking the survival server..."
on receive variable "coins":
send "&7Your coins on survival: &f%{_value}%" to {_owner}
| Syntax | Effect |
|---|---|
request variable {<name>} from server <name> | Ask another server what it has in that variable. When the answer comes, the variable here is set to it |
on receive variable <name>: | Runs when such an answer has arrived. {_value} is what came, {_owner} the player it belongs to (empty for a variable that is nobody's), {_sender_server} who answered |
request variable run at once, and the answer comes a moment later, in on receive variable. Without that block the variable is still set.on receive variable "coins": is the variable's name without the player: {%player%.coins} arrives as coins.accept-variables here applies to it. What a server gives out is decided by its own share-variables.send <text> to network channel <name>HyperVelocityHand a line to every server, this one included
send "%player%: %args%" to network channel "staff"on network message <name>:HyperVelocityRuns on each server when a line arrives on that channel. {_message} is the text, {_sender} the player whose trigger sent it (empty for the console), {_sender_server} where it came from
on network message "staff":
for each {_name} in this server players:
if {_name} has permission "staff.chat":
send "&c[Staff] &f%{_message}% &8(%{_sender_server}%)" to {_name}A line of text for whoever is listening, on every server: staff chat, announcements, a shared death feed.
command /sc <message>:
permission: "staff.chat"
trigger:
send "%player%: %args%" to network channel "staff"
on network message "staff":
for each {_name} in this server players:
if {_name} has permission "staff.chat":
send "&c[Staff] &f%{_message}% &8(%{_sender_server}%)" to {_name}
| Syntax | Effect |
|---|---|
send <text> to network channel <name> | Hand a line to every server, this one included |
on network message <name>: | Runs on each server when a line arrives on that channel. {_message} is the text, {_sender} the player whose trigger sent it (empty for the console), {_sender_server} where it came from |
on network message: without a name hears every channel.max players of server <name>HyperVelocityHow many players that server has room for, as it says in the server list; unset while it has not answered
set {_room} to max players of server arg.1on server online <name>: / on server offline <name>:HyperVelocityRuns when a server that was down can be reached again, or one that was up no longer can. {_server} is its name. Without a name, for any server
on server online "survival":
broadcast "&aSurvival is back."on server offline "survival":
broadcast "&cSurvival has gone down."
on server online "survival":
broadcast "&aSurvival is back."
command /room <server>:
trigger:
set {_online} to size of players on server arg.1
set {_room} to max players of server arg.1
send "&7%arg.1%: &f%{_online}%&7/&f%{_room}%"
| Syntax | Effect |
|---|---|
max players of server <name> | How many players that server has room for, as it says in the server list; unset while it has not answered |
on server online <name>: / on server offline <name>: | Runs when a server that was down can be reached again, or one that was up no longer can. {_server} is its name. Without a name, for any server |
on network join:HyperVelocityRuns on this server when somebody joins the network, whichever server they arrive on. {_player} is their name and {_server} where they arrived. With a name, on network join "lobby":, only for that server
on network join:
broadcast "&a+ &f%{_player}% &7joined the network on &f%{_server}%"What this event gives a script
| In the block | What it is |
|---|---|
{_player} | Their name |
{_server} | Where they arrived |
on network leave:HyperVelocityRuns when somebody leaves the network. {_player} is their name and {_server} the server they were last seen on
on network leave:
broadcast "&c- &f%{_player}% &7left the network"What this event gives a script
| In the block | What it is |
|---|---|
{_player} | Their name |
{_server} | The server they were last seen on |
on server switch:HyperVelocityRuns when somebody goes from one server to another. {_player}, {_from} and {_server}, which is where they are now. With a name, only for arrivals on that server
on server switch:
log "%{_player}% went from %{_from}% to %{_server}%"What this event gives a script
| In the block | What it is |
|---|---|
{_player} | Their name |
{_from} | And |
{_server} | Which is where they are now |
network server of <who>HyperVelocityWhich server of the network a player is on, by its name on the proxy; unset if they are on none. As of the last refresh for a player on another server
set {_server} to network server of arg.1ping of server <name>HyperVelocityHow long that server took to answer the last time it was tried, in milliseconds, measured from this server; unset if it did not answer
set {_ms} to ping of server arg.1on network join:
broadcast "&a+ &f%{_player}% &7joined the network on &f%{_server}%"
on network leave:
broadcast "&c- &f%{_player}% &7left the network"
on server switch:
log "%{_player}% went from %{_from}% to %{_server}%"
on server switch "survival":
broadcast "&f%{_player}% &7has arrived from &f%{_from}%"
command /find <name>:
trigger:
set {_server} to network server of arg.1
if {_server} is set:
send "&f%arg.1% &7is on &f%{_server}%&7."
else:
send "&7%arg.1% is not on the network."
command /lag <server>:
trigger:
set {_ms} to ping of server arg.1
if {_ms} is set:
send "&7%arg.1% answers in &f%{_ms}% ms"
else:
send "&c%arg.1% is not answering."
| Syntax | Effect |
|---|---|
on network join: | Runs on this server when somebody joins the network, whichever server they arrive on. {_player} is their name and {_server} where they arrived. With a name, on network join "lobby":, only for that server |
on network leave: | Runs when somebody leaves the network. {_player} is their name and {_server} the server they were last seen on |
on server switch: | Runs when somebody goes from one server to another. {_player}, {_from} and {_server}, which is where they are now. With a name, only for arrivals on that server |
network server of <who> | Which server of the network a player is on, by its name on the proxy; unset if they are on none. As of the last refresh for a player on another server |
ping of server <name> | How long that server took to answer the last time it was tried, in milliseconds, measured from this server; unset if it did not answer |
refresh-seconds after it happened, and somebody who joins and leaves between two refreshes is never seen.player in these blocks: the name is in {_player}. Every server that has HyperVelocity runs its own blocks, so a message to the whole network belongs on one of them only.An addon: a separate plugin whose words work once it is installed.
create voice group <name>HyperVoiceMake a group. With a name that is taken, nothing happens
create voice group "Red"create voice group <name> with password <text>HyperVoiceThe same, with a password players have to type to join it themselves
create voice group "Staff" with password "letmein" hiddencreate voice group <name> hiddenHyperVoiceIt is not shown in the list of groups players can join
create voice group "Staff" with password "letmein" hiddencreate voice group <name> openHyperVoiceThose in the group also hear players near them who are not in it
create voice group "Lobby" opencreate voice group <name> isolatedHyperVoiceThose in the group hear only each other, and nobody outside hears them
create voice group "Arena" isolateddelete voice group <name>HyperVoiceRemove a group; whoever is in it is taken out first
delete voice group "Red"add <who> to voice group <name>HyperVoicePut a player in a group, making an ordinary one if there is none of that name
add player to voice group arg.1remove <who> from voice groupHyperVoiceTake a player out of the group they are in
remove player from voice groupon load:
create voice group "Red"
create voice group "Blue"
create voice group "Staff" with password "letmein" hidden
create voice group "Arena" isolated
create voice group "Lobby" open
command /team <red|blue>:
players only: true
trigger:
add player to voice group arg.1
send "&aYou talk with team %arg.1% now."
command /leavevoice:
players only: true
trigger:
remove player from voice group
send "&7You talk to those near you again."
command /endgame:
permission: "game.admin"
trigger:
for each {_name} in players in voice group "Red":
remove {_name} from voice group
delete voice group "Red"
delete voice group "Blue"
| Syntax | Effect |
|---|---|
create voice group <name> | Make a group. With a name that is taken, nothing happens |
create voice group <name> with password <text> | The same, with a password players have to type to join it themselves |
create voice group <name> hidden | It is not shown in the list of groups players can join |
create voice group <name> open | Those in the group also hear players near them who are not in it |
create voice group <name> isolated | Those in the group hear only each other, and nobody outside hears them |
delete voice group <name> | Remove a group; whoever is in it is taken out first |
add <who> to voice group <name> | Put a player in a group, making an ordinary one if there is none of that name |
remove <who> from voice group | Take a player out of the group they are in |
with password, hidden and open or isolated can be combined on one line.open or isolated, a group is an ordinary one: its members hear each other everywhere, and players near them hear them as well.on load:.voice connected <who>HyperVoiceWhether they have the mod and are connected to the voice chat
if voice connected arg.1:
if voice group of arg.1 is set:
send "&7%arg.1% is in the group &f%voice group of arg.1%&7."
else:
send "&7%arg.1% has voice chat and is in no group."voice group of <who>HyperVoiceThe name of the group they are in; unset if none
send "&7%arg.1% is in the group &f%voice group of arg.1%&7."voice groupsHyperVoiceA list of the names of every group
for each {_group} in voice groups:
send "&e%{_group}%&7: " + join players in voice group {_group} with ", "players in voice group <name>HyperVoiceA list of the names of the online players in that group
send "&e%{_group}%&7: " + join players in voice group {_group} with ", "voice muted <who>HyperVoiceWhether a script has muted them
if voice muted arg.1:
send "&c%arg.1% is muted."command /voice <player>:
trigger:
if voice connected arg.1:
if voice group of arg.1 is set:
send "&7%arg.1% is in the group &f%voice group of arg.1%&7."
else:
send "&7%arg.1% has voice chat and is in no group."
else:
send "&7%arg.1% does not have voice chat."
if voice muted arg.1:
send "&c%arg.1% is muted."
command /voicegroups:
trigger:
for each {_group} in voice groups:
send "&e%{_group}%&7: " + join players in voice group {_group} with ", "
| Syntax | Result |
|---|---|
voice connected <who> | Whether they have the mod and are connected to the voice chat |
voice group of <who> | The name of the group they are in; unset if none |
voice groups | A list of the names of every group |
players in voice group <name> | A list of the names of the online players in that group |
voice muted <who> | Whether a script has muted them |
mute voice of <who>HyperVoiceNobody hears them any more, near them or in their group
mute voice of arg.1unmute voice of <who>HyperVoiceThey are heard again
unmute voice of arg.1command /voicemute <player>:
permission: "staff.mute"
trigger:
mute voice of arg.1
send "&c%arg.1% can no longer be heard."
command /voiceunmute <player>:
permission: "staff.mute"
trigger:
unmute voice of arg.1
on region enter:
if "%event.region%" is "library":
mute voice of player
send "&7Quiet, please: you are muted in the library."
on region leave:
if "%event.region%" is "library":
unmute voice of player
| Syntax | Effect |
|---|---|
mute voice of <who> | Nobody hears them any more, near them or in their group |
unmute voice of <who> | They are heard again |
unmute voice, or until the server restarts. To keep one across restarts, save it in a variable and mute again in on voice connect:.deafen <who>HyperVoiceThat player is sent nobody's voice, until undeafen <who>. They can still speak
deafen arg.1undeafen <who>HyperVoiceThey hear the others again
undeafen arg.1voice disabled <who>HyperVoiceTrue if a player has the voice chat installed but switched off in their own game: they hear nothing and cannot speak, by their own choice
if voice disabled arg.1:
send "&7%arg.1% has switched the voice chat off."voice deafened <who>HyperVoiceTrue while a player is deafened this way
if voice deafened arg.1:
undeafen arg.1
send "&a%arg.1% hears the others again."set voice distance of <who> to <n>HyperVoiceHow many blocks that player's voice carries: less than the server's own distance, or more, up to 512
set voice distance of player to 6reset voice distance of <who>HyperVoiceTheir voice carries as far as everybody's again
reset voice distance of playervoice distance of <who>HyperVoiceHow far their voice carries, in blocks: what was set, or the server's own distance
reset voice distance of playercommand /deafen <target:player>:
permission: "voice.staff"
trigger:
if voice deafened arg.1:
undeafen arg.1
send "&a%arg.1% hears the others again."
else:
deafen arg.1
send "&e%arg.1% no longer hears anybody."
command /shout:
permission: "voice.shout"
trigger:
set voice distance of player to 96
send "&6Your voice now carries 96 blocks, for a minute."
wait 1 minute
reset voice distance of player
command /canhear <target:player>:
trigger:
if voice disabled arg.1:
send "&7%arg.1% has switched the voice chat off."
else if voice connected arg.1:
send "&a%arg.1% can hear you."
else:
send "&7%arg.1% does not have the voice chat."
command /whisper:
trigger:
set voice distance of player to 6
send "&7Your voice carries &f%voice distance of player% &7blocks."
| Syntax | Effect |
|---|---|
deafen <who> | That player is sent nobody's voice, until undeafen <who>. They can still speak |
undeafen <who> | They hear the others again |
voice disabled <who> | True if a player has the voice chat installed but switched off in their own game: they hear nothing and cannot speak, by their own choice |
voice deafened <who> | True while a player is deafened this way |
set voice distance of <who> to <n> | How many blocks that player's voice carries: less than the server's own distance, or more, up to 512 |
reset voice distance of <who> | Their voice carries as far as everybody's again |
voice distance of <who> | How far their voice carries, in blocks: what was set, or the server's own distance |
on voice connect:HyperVoiceRuns when a player's voice chat connects, a moment after they join
on voice connect:
if {%player%.voicebanned} is true:
mute voice of playerWhat this event gives a script
| In the block | What it is |
|---|---|
{_group} | The group's name |
on voice disconnect:HyperVoiceRuns when it disconnects
on voice disconnect:
log "%player.name% left the voice chat"What this event gives a script
| In the block | What it is |
|---|---|
{_group} | The group's name |
on voice group join "<name>":HyperVoiceRuns when a player joins that group, by a script or by themselves. Without a name: any group
on voice group join "Staff":
send "&cStaff channel: keep it professional."What this event gives a script
| In the block | What it is |
|---|---|
{_group} | The group's name |
on voice group leave "<name>":HyperVoiceRuns when they leave it
on voice group leave "Staff":
send "&7You left the staff channel."What this event gives a script
| In the block | What it is |
|---|---|
{_group} | The group's name |
on voice connect:
if {%player%.voicebanned} is true:
mute voice of player
on voice disconnect:
log "%player.name% left the voice chat"
on voice group join "Staff":
send "&cStaff channel: keep it professional."
on voice group leave "Staff":
send "&7You left the staff channel."
on voice group leave:
log "%player.name% left the voice group %{_group}%"
| Syntax | Effect |
|---|---|
on voice connect: | Runs when a player's voice chat connects, a moment after they join |
on voice disconnect: | Runs when it disconnects |
on voice group join "<name>": | Runs when a player joins that group, by a script or by themselves. Without a name: any group |
on voice group leave "<name>": | Runs when they leave it |
player is the player, and in the two group events {_group} is the group's name.An addon: a separate plugin whose words work once it is installed.
on vote:HyperVotesRuns when a player who is online votes, and for a kept vote when its player joins. player is the voter
on vote:
give 3 diamond to player
add 50 to {%player%.coins}
if {_late} is true:
send "&7Thanks for voting while you were away!"
else:
broadcast "&a%player.name% &7voted on &f%{_service}%&7."What this event gives a script
| In the block | What it is |
|---|---|
{_voter} | The voter's name |
{_service} | The voting site |
{_votes} | How often they have voted |
{_streak} | Their streak in days |
{_late} | True for a vote that waited for its player |
on vote "<site>":HyperVotesThe same for votes from one voting site only, by the name the site gives itself
on vote "PlanetMinecraft":
give 1 emerald to playeron offline vote:HyperVotesRuns at once when a vote comes for someone who is not online. There is no player; {_voter} is the name
on offline vote:
broadcast "&a%{_voter}% &7voted while offline. Vote too with &f/vote&7!"What this event gives a script
| In the block | What it is |
|---|---|
{_voter} | The name |
{_service} | The voting site |
{_votes} | How often they have voted |
{_streak} | Their streak in days |
{_late} | True for a vote that waited for its player |
on vote reminder:HyperVotesRuns every remind-every minutes for each player who is on the server and has not voted yet today. player is who is reminded; {_votes} and {_streak} are theirs
What this event gives a script
| In the block | What it is |
|---|---|
{_votes} | And |
{_streak} | Theirs |
{_voter} | The voter's name |
{_service} | The voting site |
{_late} | True for a vote that waited for its player |
on vote party:HyperVotesRuns every party-every votes. There is no player
on vote party:
broadcast "&d&lVote party! &7%{_votes}% votes reached."
loop all players:
give 5 diamond to loop-playerWhat this event gives a script
| In the block | What it is |
|---|---|
{_voter} | The voter's name |
{_service} | The voting site |
{_votes} | How often they have voted |
{_streak} | Their streak in days |
{_late} | True for a vote that waited for its player |
on vote:
give 3 diamond to player
add 50 to {%player%.coins}
if {_late} is true:
send "&7Thanks for voting while you were away!"
else:
broadcast "&a%player.name% &7voted on &f%{_service}%&7."
on vote "PlanetMinecraft":
give 1 emerald to player
on offline vote:
broadcast "&a%{_voter}% &7voted while offline. Vote too with &f/vote&7!"
on vote party:
broadcast "&d&lVote party! &7%{_votes}% votes reached."
loop all players:
give 5 diamond to loop-player
| Syntax | Effect |
|---|---|
on vote: | Runs when a player who is online votes, and for a kept vote when its player joins. player is the voter |
on vote "<site>": | The same for votes from one voting site only, by the name the site gives itself |
on offline vote: | Runs at once when a vote comes for someone who is not online. There is no player; {_voter} is the name |
on vote reminder: | Runs every remind-every minutes for each player who is on the server and has not voted yet today. player is who is reminded; {_votes} and {_streak} are theirs |
on vote party: | Runs every party-every votes. There is no player |
{_voter} is the voter's name, {_service} the voting site, {_votes} how often they have voted, {_streak} their streak in days, and {_late} is true for a vote that waited for its player.on vote:. With keep-offline-votes on, every vote reaches it exactly once: at once, or when the player next joins.votes of <who>HyperVotesHow often they have voted; works for someone offline
reset votes of arg.1votes today of <who>HyperVotesHow many times they have voted today, by the server's calendar; 0 for somebody who has not yet
set {_today} to votes today of playervote streak of <who>HyperVotesHow many days in a row they have voted. A day without a vote brings it back to 0
send "&7You have voted &f%votes of player% &7times, &f%vote streak of player% &7days in a row."last vote of <who>HyperVotesWhen they last voted, as a date; unset if never
send "&7Your last vote was " + last vote of player formatted as "d MMMM, HH:mm"total votesHyperVotesEvery vote the server has counted
send "&6Top voters &7(%total votes% votes in all)"top votersHyperVotesA list of names, the most votes first, at most 100
for each {_name} in top voters:
add 1 to {_place}
if {_place} > 10:
stop
send "&e%{_place}%. &f%{_name}% &7- %votes of {_name}%"votes until partyHyperVotesHow many votes are missing until the next party; 0 when parties are off
send "&d%votes until party% &7more votes until the next party."command /votes:
players only: true
trigger:
send "&7You have voted &f%votes of player% &7times, &f%vote streak of player% &7days in a row."
if last vote of player is set:
send "&7Your last vote was " + last vote of player formatted as "d MMMM, HH:mm"
if votes until party > 0:
send "&d%votes until party% &7more votes until the next party."
command /votetop:
trigger:
send "&6Top voters &7(%total votes% votes in all)"
set {_place} to 0
for each {_name} in top voters:
add 1 to {_place}
if {_place} > 10:
stop
send "&e%{_place}%. &f%{_name}% &7- %votes of {_name}%"
| Syntax | Result |
|---|---|
votes of <who> | How often they have voted; works for someone offline |
votes today of <who> | How many times they have voted today, by the server's calendar; 0 for somebody who has not yet |
vote streak of <who> | How many days in a row they have voted. A day without a vote brings it back to 0 |
last vote of <who> | When they last voted, as a date; unset if never |
total votes | Every vote the server has counted |
top voters | A list of names, the most votes first, at most 100 |
votes until party | How many votes are missing until the next party; 0 when parties are off |
add test vote for <who>HyperVotesA vote that did not come from a site, counted and rewarded like a real one. For trying a script out
add test vote for player from "TestSite"add test vote for <who> from <site>HyperVotesThe same, as if from that site
add test vote for player from "TestSite"reset votes of <who>HyperVotesForget one player's votes and streak
reset votes of arg.1reset all votesHyperVotesForget everybody's, for a new season
reset all votescommand /testvote:
permission: "votes.admin"
players only: true
trigger:
add test vote for player from "TestSite"
command /resetvotes <player>:
permission: "votes.admin"
trigger:
reset votes of arg.1
send "&aThe votes of %arg.1% were reset."
command /newvoteseason:
permission: "votes.admin"
trigger:
reset all votes
broadcast "&eA new voting season has begun."
| Syntax | Effect |
|---|---|
add test vote for <who> | A vote that did not come from a site, counted and rewarded like a real one. For trying a script out |
add test vote for <who> from <site> | The same, as if from that site |
reset votes of <who> | Forget one player's votes and streak |
reset all votes | Forget everybody's, for a new season |
on vote milestone <n>:HyperVotesRuns the one time a player's own votes get to that number: on vote milestone 50:. It needs a number. player is the voter if they are on the server; {_voter}, {_service}, {_votes} and {_streak} are as in on vote:
on vote milestone 100:
execute console command "lp user %{_voter}% parent add supporter"on vote streak <n>:HyperVotesRuns the one time a player's streak gets to that many days in a row: on vote streak 7:. The values are those of on vote:
on vote streak 7:
broadcast "&d%{_voter}% &7has voted seven days in a row!"set votes of <who> to <n>HyperVotesMake a player's votes that number, for carrying votes over from another plugin or putting a mistake right. Their streak stays as it is, and no event runs
set votes of arg.1 to arg.2votes this month of <who>HyperVotesHow many times somebody has voted in this calendar month; 0 if not at all
set {_mine} to votes this month of playertop voters this monthHyperVotesThe names of those with the most votes this month, best first, up to 100
for each {_name} in top voters this month:
add 1 to {_place}
if {_place} <= 5:
send "&e#%{_place}% &f%{_name}% &7- %votes this month of {_name}%"on vote milestone 50:
broadcast "&d%{_voter}% &7has voted &f50 &7times. Thank you!"
give 1 diamond block to player
on vote milestone 100:
execute console command "lp user %{_voter}% parent add supporter"
on vote streak 7:
broadcast "&d%{_voter}% &7has voted seven days in a row!"
command /setvotes <target> <votes:number>:
permission: "votes.admin"
trigger:
set votes of arg.1 to arg.2
send "&a%arg.1% now has %arg.2% votes."
command /votemonth:
trigger:
set {_mine} to votes this month of player
send "&7You have voted &f%{_mine}% &7times this month."
set {_place} to 0
for each {_name} in top voters this month:
add 1 to {_place}
if {_place} <= 5:
send "&e#%{_place}% &f%{_name}% &7- %votes this month of {_name}%"
| Syntax | Effect |
|---|---|
on vote milestone <n>: | Runs the one time a player's own votes get to that number: on vote milestone 50:. It needs a number. player is the voter if they are on the server; {_voter}, {_service}, {_votes} and {_streak} are as in on vote: |
on vote streak <n>: | Runs the one time a player's streak gets to that many days in a row: on vote streak 7:. The values are those of on vote: |
set votes of <who> to <n> | Make a player's votes that number, for carrying votes over from another plugin or putting a mistake right. Their streak stays as it is, and no event runs |
votes this month of <who> | How many times somebody has voted in this calendar month; 0 if not at all |
top voters this month | The names of those with the most votes this month, best first, up to 100 |
player in the block in that case, so reward them by name, or in on vote: when they are back.command /votedtoday:
trigger:
set {_today} to votes today of player
if {_today} is 0:
send "&eYou have not voted today."
else:
send "&aVotes today: &f%{_today}%"