set <variable> to <value>Assign
set tool of player to 1 stone swordTry it← All of the Docs Commands and events
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".