==Equal · player.world == "world_nether"
if size of {_names} == 0:
send "&7There are no notes."
stopTry it← All of the Docs The basics
==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.