Condition list

List of all natively available conditions

Contents

Currently, the plugin natively supports the following conditions:

  • compare [ Compare two values ]

  • permission [ Whether a player has specified permissions ]

  • op [ Whether a player is opped ]

  • gamemode [ Whether the players gamemode is among specified ones ]

  • location [ Whether the players location matches the given location ]

  • incuboid [ Whether a player is in a cuboid ]

  • standingon [ Which type of block the player is standing on ]

  • sneaking [ Whether the player is sneaking ]

  • world [ Which world the player is in ]

  • day [ Whether its day in the players world ]

  • night [ Whether its night in the players world ]

  • time [ What time is it in the players world ]

  • lookingatblock [ What type of block the player is looking at ]

  • lookingatfurniture [ If player is looking at plugin furniture ] *1

  • lookingatentity [ If player is looking at an entity ]

  • entitynbtequals [ Check nbt values of the entity that is being looked at ] *2

  • tileentitynbtequals [ Check nbt values of the tile entity that is being looked at ] *2

  • blocknbtequals [ Check nbt values of the block that is being looked at ] *2

  • blockstateequals [ Check blockstate values of the block that is being looked at ]

  • lookingatcitizen [ Whether player is looking at a Citizens NPC ] *4

  • lookingatmythicmob [Whether player is looking at a MythicMob mob] *5

  • equipped [ If a player has the item equipped in hands or on body ]

  • itemnbtequals [ If players equipped item has given nbt data ] *2

  • region [ If players region is among specified ones ] *3

Notes:

  1. Requires a supported furniture plugin

  2. Requires NBT API plugin

  3. Requires a region plugin

  4. Requires Citizens

  5. Requires MythicMobs

Conditions

compare

Description

If only first is set and it's a boolean, will check if it's true

If both first and second are set and they are strings, they will be compared if they are equal. If they are booleans (true / false) they will be also compared if they are equal.

If operation is set and both first & second arguments are numbers, will use the operation to compare the variables.

Examples

conditions:
# Check if players health is more than or equal to 20.0
- compare { first = %player_health%; operation = >=; second= 20.0 }
# Check if both are equal (they aren't)
- compare { 1=true; 2=false }
# Check if players name is Septicuss
- compare { 1=%player_name%; 2=Septicuss }

permission

Description

Checks if player has any of the permissions in the string array

Examples

conditions:
# Check if player has the permission to a command
- permission { p = tooltips.command.reload }
# Check if player has either of the two permissions
- permission { perm = first, second }

op

Description

Checks if player is opped

Examples

conditions:
- op

gamemode

Description

Checks if player has any of the given gamemodes

Examples

conditions:
# Check if players game mode is adventure
- gamemode { gm = adventure }
# Check if players game mode is either creative or survival
- gamemode { gamemode = creative, survival }

location

Description

Checks if player is at the given coordinates in their current world

Examples

conditions:
# Check if the current location is x,y,z = 22, 602, -234
- location { l = [ 22, 602, -234 ]

incuboid

Description

This check is more resource-intensive than the "region" condition, due to being unable to cache which cuboid the player is currently in.

Checks if player is within the two given locations.

Examples

conditions:
# Check if player is within location at 22, 602, -234 and 49, 620, -251
- incuboid { first = [ 22, 602, -234 ]; second = [49, 620, -251] }

standingon

Description

Checks if player is currently standing on any of the given materials. Can also be air to check if the block under the player is air.

Examples

conditions:
# Check if player is standing on grass or dirt blocks
- standingon { type = grass_block, dirt }
# Check if player is standing on a block of obsidian
- standingon { m = obsidian }

sneaking

Description

Checks if player is currently sneaking

Examples

conditions:
# Check if player is sneaking
- sneaking

world

Description

Checks if players world is any of the ones defined in the name string array.

Examples

conditions:
# Check if player is in the world called "world"
- world { name = world }
# Check if player is either in the nether or the end worlds
- world { name = world_nether, world_the_end }

day

Description

Checks if its day (time between 0 and 13000) in the players current world.

Examples

conditions:
# Check if its day in the players current world
- day

night

Description

Checks if its night (time between 13000 and 24000) in the players current world.

Examples

conditions:
# Check if its night in the players current world
- night

time

Description

Checks if the current time in the players world is equal to the given time argument.

If operation is included, a comparison operation is conducted, with given time argument being the first comparable.

Examples

conditions:
# Checks if the time in the players current world is greater than or equal to 1000
- time { time = 1000; oper = >= }
# Checks if the time in the players current world is between 0 and 5000 inclusive
- time {t=0; oper=>=} AND time {t=5000; oper=<=}

lookingatblock

Description

If no type or location is given, will return true if any type of block is being looked at.

If type is defined, will check if the block that is being looked at is of specific material

If location is defined, will check if the block that is being looked at is at specific coordinates in the players current world

If distance is defined (3 by default), will increase or decrease the distance at which the block that is being looked at is detected

Examples

conditions:
# Check if player is looking at bedrock
- lookingatblock{type=bedrock}
# Check if player is looking at an acacia sign at given coordinates
- lookingatblock{l=[440,65,803]; m=acacia_sign}
# Check if player is looking at an acacia sign at given coordinates with increased distance
- lookingatblock{l=[440,65,803]; m=acacia_sign; d=6}

lookingatfurniture

Description

Requires any supported furniture plugin to work.

If no ids are given, checks if player is looking at any furniture within the distance (3 by default).

If ids are given, checks if the furniture the player is looking at has any of the ids.

Distance argument increases the distance at which furniture is checked.

Examples

conditions:
# Checks if player is looking at any type of furniture
- lookingatfurniture
# Checks if player is looking at a furniture with id of couch or chair
- lookingatfurniture {id=couch, chair}
# Previous but with a distance of 6
- lookingatfurniture {id=lamp; distance=6}

lookingatentity

Description

If no types are given, checks if player is looking at any type of entity (armor stands etc. too)

If types are given, checks if player is looking at any of the given entity types

If distance is given, will increase the distance that entities are checked at (3 by default)

Examples

conditions:
# Player is looking at a villager
- lookingatentity {t=villager}
# Player is looking at a cow or a pig
- lookingatentity {entity=cow,pig}

entitynbtequals

Description

Requires NBT API plugin to work.

Checks if the targeted entity within distance (3 by default) has a key with given value

Supports basic NBT paths as key. Example: Item.tag.CustomModelData

Examples

conditions:
# Checks if integer at "mynbtkey" equals 10
- entitynbtequals {key=mynbtkey; value=10}
# Checks if boolean at "mynbtkey" equals false
- entitynbtequals {key=mynbtkey; value=false}
# .. same for string as the value

tileentitynbtequals

Description

Requires NBT API plugin to work.

Checks if the targeted tile entity within distance (3 by default) has a key with given value

Supports basic NBT paths as key. Example: Item.tag.CustomModelData

Examples

conditions:
# Checks if a (block) player skull owner is Septicuss
- lookingatblock{type=player_head}
- tileentitynbtequals{key=SkullOwner.Name; value=Septicuss}

blocknbtequals

Description

Requires NBT API plugin to work.

Checks if the targeted block within distance (3 by default) has a key with given value

Supports basic NBT paths as key. Example: Item.tag.CustomModelData

Examples

conditions:
# Checks if the target block has a key 'hello' with value true
- blocknbtequals{key=hello; value=true}

blockstateequals

Description

Checks if the targeted blocks block state within distance (3 by default) has a key with given value

Examples

conditions:
- lookingatblock{type=note_block} # Optional
# Check if the note blocks "powered" state is equal to "false"
- blockstateequals{key=powered; val=false}
# Check if the note blocks "note" is equal to 15
- blockstateequals{key=note; value=15}

lookingatcitizen

Description

Requires Citizens plugin to work.

Checks if the targeted entity within distance (3 by default) is a Citizens NPC.

If ids are present, checks if the targeted NPC has any of the given ids.

Examples

conditions:
# If player is looking at a Citizen with the id 0
- lookingatcitizen{id=0}
# If player is looking at a Citizen with either id 2 or 23
- lookingatcitizen{id=2,23}
# IF player is looking at a Citizen from 10 blocks away
- lookingatcitizen{dist=10}

lookingatmythicmob

Description

Requires MythicMobs plugin to work.

Checks if the targeted entity within distance (3 by default) is a MythicMobs mob

If ids are present, checks if the targeted mythic mob has any of the given ids.

Examples

conditions:
# If player is looking at a MythicMob with the id 'my-boss'
- lookingatmythicmob{id=my-boss}
# If player is looking at a MythicMob with either id 'my-boss' or 'john'
- lookingatmythicmob{id=my-boss,john}
# If player is looking at any MythicMob from 10 blocks away
- lookingatmythicmob{dist=10}

equipped

Description

Checks if item at the given slot (main hand by default) has the given type

Examples

conditions:
# If player has a diamond sword in their main hand
- equipped { type=diamond_sword }
# If player has a compass in their off hand
- equipped { s = off_hand; type = compass }
# If player has a diamond or gold helmet equipped
- equipped {slot=helmet; type=diamond_helmet,gold_helmet}

itemnbtequals

Description

Requires NBT API plugin to work.

Checks if item at the given slot (main hand by default) has an item with the given nbt key with given nbt value in it. Supports basic NBT paths as keys. Example: Item.tag.CustomModelData

Examples

conditions:
# Checks if the custom model data nbt tag of the held item is equal to 1
- itemnbtequals { key = CustomModelData; value=1}

region

Description

Requires any region plugin to work.

Checks if player is in any of the given region ids

If no regions are provided, returns true if player is inside of any region

Examples

conditions:
# Check if player is in the shop region
- region { r = shop }
# Check if player is either inside the spawn region or the crates region
- region { r = spawn, crates }

Last updated