Conditions Listπ
Advancement: advancement
π
This condition checks if the player has specified advancement. The only argument is the full name of the advancement. This includes the namespace, the tab and the name of the advancement as configured on your server. List of all vanilla advancements.
Example
advancement minecraft:adventure/kill_a_mob
Conjunction: and
π
Conjunction of specified conditions. This means that every condition has to be met in order for conjunction to be true. Used only in complex alternatives, because conditions generally work as conjunction. Instruction string is exactly the same as in alternative
.
Example
and has_helmet,has_chestplate,has_leggings,has_boots
Armor: armor
π
The armor condition requires the player to wear an armor that has been specified in the items section.
Example
armor helmet_of_concrete
Biome: biome
π
This condition will check if the player is in specified biome. The only argument is the biome type.
Example
biome savanna_rock
Burning: burning
π
This condition will check if the player is on fire.
conditions:
isOnFire: "burning"
Check conditions: check
π
persistent, static
This condition allow for specifying multiple instruction strings in one, longer string. Each instruction must be started with ^
character and no other dividers should be used. The condition will be met if all inner conditions are met. It's not the same as and
condition, because you can specify an instruction string, not a condition name.
Example
check ^tag beton ^item emerald:5 ^location 100;200;300;survival_nether;5 ^experience 20
Chest Item: chestitem
π
persistent, static
This condition works in the same way as item
condition, but it checks the specified chest instead of a player. The first argument is a location of the chest and the second one is the list of items defined in the same way as in item
condition. If there is no chest at specified location the condition won't be met.
Example
chestitem 100;200;300;world emerald:5,sword
Conversation: conversation
π
This condition will check if a conversation has an available starting option. If no starting option has a condition that returns true then this will return false.
Example
conversation innkeeper
Day of week: dayofweek
π
It must be a specific day of the week that this condition returns true. You can specify either the english name of the day or the number of the day (1 being monday, 7 sunday,..).
Example
dayofweek sunday
Potion Effect: effect
π
To meet this condition the player must have an active potion effect. There is only one argument and it takes values from this page: potion types.
Example
effect SPEED
Empty inventory slots: empty
π
To meet this condition the players inventory must have the specified amount of empty slots or more.
If you want to check for a specific amount (for example for a full inventory with 0 empty slots) you can append the equal
argument.
Example
empty 5
Entities in area: entities
π
persistent, static
This condition will return true only if there is a specified amount (or more) of specified entities in the specified area.
There are three required arguments - entity type, location and range. Entities are defined as a list separated by commas.
Each entity type (taken from here)
can have an additional amount suffix, for example ZOMBIE:5,SKELETON:2
means 5 or more zombies and 2 or more skeletons.
The location is defined as usual. The number after the location is the range around the location in which will be checked for these entities. You can also specify additional name:
argument,
with the name of the required entity. Replace all spaces with _
here. You can use marked:
argument to check only for entities marked in spawn
event.
Example
entities ZOMBIE:2 100;200;300;world 10 name:Deamon
Experience: experience
π
This condition is met when the player has the specified amount of experience levels.
You can also define decimal numbers, for example experience 1.5
will be met when the player has 1.5 or more experience levels.
If you want to check for an absolute amount of experience points you can convert it to decimal levels.
Example
experience 30
experience 5.5
Facing direction: facing
π
Checks if the player is looking in the given direction. Valid directions are UP
, DOWN
, NORTH
, EAST
, WEST
and SOUTH
. Up and down start at a pitch of 60Β°.
Example
facing EAST
Fly: fly
π
This will check if the player is currently flying (Elytra type of flight).
Example
fly
Game mode: gamemode
π
This condition checks if the player is in a specified game mode. The first argument is the game mode, i.e. survival, creative, adventure.
Example
gamemode survival
Global point: globalpoint
π
persistent, static
The same as point condition but it checks the amount for a global point category which has the same value for all players.
Example
globalpoint global_knownusers 100
Global tag: globaltag
π
persistent, static
This requires a specific global tag to be set and works the same as normal tag condition.
Example
globaltag global_areNPCsAgressive
Item in Hand: hand
π
This condition is met only when the player holds the specified quest item in their hand.
The offhand will be checked instead of the main hand if the offhand
keyword is added.
Amount cannot be set here, though it may be checked with the item
condition.
Example
hand SpecialSword
hand QuestShield offhand
Health: health
π
Requires the player to have equal or more health than specified amount. The only argument is a number (double). Players can have 0 to 20 health by default (there are some plugins and commands which change the maximum) (0 means dead, don't use that since it will only be met when the player sees the red respawn screen).
Example
health 5.6
Height: height
π
This condition requires the player to be below specific Y height. The required argument is a number or a location (for example 100;200;300;world). In case of location it will take the height from it and use it as regular height.
Example
height 16
Hunger: hunger
π
Requires the player to have equal or more hunger points, the condition is the same as health
just for hunger. If the hunger level is below 7, the player cannot sprint.
Example
hunger 15
In Conversation: inconversation
π
This condition checks, if the player is in a conversation.
Parameter | Syntax | Default Value | Explanation |
---|---|---|---|
conversation | conversation:name |
Optional name of the conversation. If specified, it will only check for the conversation with this name. |
conditions:
isInConversation: "inconversation"
talksToInnkeeper: "inconversation conversation:innkeeper"
Item in Inventory: item
π
This condition requires the player to have all specified items in his inventory or backpack. You specify items in a list separated by commas (without spaces between!) Each item consists of its name and amount, separated by a colon. Amount is optional, so if you specify just item's name the plugin will assume there should be only one item.
Example
item emerald:5,gold:10
Durability of item: itemdurability
π
This condition requires the player to have a certain amount of durability on an item.
The first argument is the slot, the second the amount.
Optional relative
argument sets 0 to broken and 1 to the maximum durability the item can have.
This condition returns false when no item is in the given slot or does not have durability, like stone or sticks.
Available slot types: HAND
, OFF_HAND
, HEAD
, CHEST
, LEGS
, FEET
.
Example
itemdurability HAND 50
itemdurability CHEST 0.5 relative
Journal entry: journal
π
This condition will return true if the player has specified entry in his journal (internal name of the entry, like in journal section). The only argument is name of the entry.
Example
journal wood_started
Language: language
π
This condition is fulfilled as long as the player has one of the specified languages selected as their quest language.
Example
language en,de,fr
Location: location
π
It returns true only when the player is closer to specified location than the specified distance. Just two mandatory attributes - location and radius around it (can be a variable).
Example
location 100;200;300;survival_nether 5
Looking at a block: looking
π
Checks if the player is looking at a block with the given location or material. You must specify either loc:
optional (the location of the block) or type:
optional as a block selector
. You can also specify both.
Example
looking loc:12.0;14.0;-15.0;world type:STONE
Moon Cycle: mooncycle
π
This condition checks the players moon cycle (1 is full moon, 8 is Waxing Gibbous) and returns if the player is under that moon. A list of phases can be found here.
Example
mooncycle 1
Number compare: numbercompare
π
This condition compares two numbers.
The valid operations are: <
, <=
, =
, !=
, >=
, >
.
Example
numbercompare %ph.other_plugin:points% >= 100
Objective: objective
π
This condition is very simple: it's true only when the player has an active objective. The only argument is the name of the objective, as defined in the objectives section.
Example
objective wood
Alternative: or
π
persistent, static
Alternative of specified conditions. This means that only one of conditions has to be met in order for alternative to be true. You just define one mandatory argument, condition names separated by commas. !
prefix works as always.
Example
or night,rain,!has_armor
Partial date: partialdate
π
The current date must match the given pattern. You can specify the day of the month, the month or the year it must be that this condition returns true or combine them. You can also specify multiple days/months/years by just separating them by ,
or a interval by using -
. If you have trouble understanding how this works have a look at the example.
The example is true between the 1st and the 5th or on the 20th of each month, but only in the year 2017.
Example
partialdate day:1-5,20 year:2017
Party: party
π
This is part of the party system.
This condition takes three optional arguments: every:
, any:
and count:
.
"Every" is a list of conditions that must be met by every player in the party.
Any is a list of conditions that must be met by at least one player in a party (it doesn't have to be the same player,
one can meet first condition, another one can meet the rest, and it will work).
Count is just a number, minimal amount of players in the party.
You don't have to specify all those arguments, you can use only one if you want.
Example
party 10 has_tag1,!has_tag2 every:some_item any:some_location,some_other_item count:5
Permission: permission
π
The player must have a specified permission for this condition to be met. The instruction string must contain permission node as the required argument.
Example
permission essentials.tpa
Point: point
π
Requires the player to have amount of points equal to the specified category or more. There are two required arguments, first is the category (string), second is the amount (integer). You can also add optional argument equal
to accept only players with exactly equal amount of points.
Example
point beton 20
Ride an entity: ride
π
This condition checks if the player rides the specified
entity.
any
is also a valid input and matches any entity.
Example
ride horse
ride any
Random: random
π
persistent, static
This condition is met randomly. There is one argument: two positive numbers like 5-12
. They mean something like that: "It will be true 5 times out of 12".
Example
random 12-100
Armor Rating: rating
π
This one requires the player to wear armor which gives him specified amount of protection (armor icons). The first and only argument should be an integer. One armor point is equal to half armor icon in-game (10 means half of the bar filled).
Example
rating 10
Real time: realtime
π
There must a specific (real) time for this condition to return true. You need to specify two times (formatted like hh:mm
) separated by dash. If the first is before the second the time must be between these two, if its after the second the time must be later than the first and earlier than the second to return true.
Example
realtime 8:00-12:30
Scoreboard: score
π
With this condition you can check if the score in a specified objective on a scoreboard is greater or equal to specified amount. The first argument is the name of the objective, second one is amount (an integer).
Example
score kills 20
Sneaking: sneak
π
Sneak condition is only true when the player is sneaking. This would probably be useful for creating traps, I'm not sure. There are no arguments for this one.
Example
sneak
Check Stage: stage
π
This condition compares the players current stage with the given stage by its index numbers.
For more take a look at the stage objective.
The valid operations are: <
, <=
, =
, !=
, >=
, >
.
Parameter | Syntax | Default Value | Explanation |
---|---|---|---|
stage objective | Objective | The name of the stage objective | |
comparator | Comparator | The comparator to use for the comparison | |
stage | Stage | The name of the stage to compare |
conditions:
isDeliverCookies: "stage bakeCookies = deliverCookies"
isDeliverCookiesOrAbove: "stage bakeCookies > cookCookies"
Tag: tag
π
This one requires the player to have a specified tag. Together with !
negation it is one of the most powerful tools when creating conversations. The instruction string must contain tag name.
Example
tag quest_completed
Test for block: testforblock
π
persistent, static
This condition is met if the block at specified location matches the given material. First argument is a location, and the second one is a block selector
.
Example
testforblock 100;200;300;world STONE
Time: time
π
There must be specific (Minecraft) time on the player's world for this condition to return true. You need to specify two hour numbers separated by dash. These number are normal 24-hour format hours. The first must be smaller than the second. If you want to achieve time period between 23 and 2 you need to negate the condition.
Example
time 2-23
Variable: variable
π
This condition checks if a variable value matches given regular expression
Parameter | Syntax | Default Value | Explanation |
---|---|---|---|
Variable | Any variable | The variable (surrounded by % characters). |
|
Regex | A regex pattern | The regex that the variables value must match. The regex can also be stored in a variable. | |
forceSync | Keyword | False | Forces the variables to be resolved on the main thread. This may be required by some third party variables. |
conditions:
anyNumber: "variable %objective.var.price% -?\d+" #(1)!
isPlayer: "variable %ph.parties_members_1% %player%" #(2)!
denizenVariable: "variable %ph.denizen_<server.match_player[SomeName].has_flag[flag_name]>% true forceSync" #(3)!
denizenVariableThis: "variable %ph.denizen_<player.has_flag[flag_name]>% true forceSync" #(4)!
- Returns true if the variable
%objective.var.price%
contains any number. - Returns true if the
parties_members_1
variable contains the player's name. - Returns true if the
denizen_<server.match_player[SomeName].has_flag[flag_name]>
Denizen variable containstrue
. This variable is resolved on the main thread.The
someName
part can't be a variable! - Works the same as the
denizenVariable
with the only difference it checks for the player the condition is executed with.
Weather: weather
π
There must be a specific weather for this condition to return true. There are three possible options: sun, rain and storm. Note that /toggledownfall
does not change the weather, it just does what the name suggests: toggles downfall. The rain toggled off will still be considered as rain! Use /weather clear
instead.
Example
weather sun
World: world
π
This conditions checks if the player is in a specified world. The first argument is the name of a world.
Example
world world