Skip to main content

Conditions

Structure

tasks.yml
get_diamonds:
type: block_break

conditions:
- type: block
materials:
- DIAMOND_ORE
- GOLD_ORE

rewards:
- guild_xp:100

We are going to focus on the conditions part of the task structure.

Condtions is a list of conditions written in this format:

- type: <condition_type>
<condition_parameters>

where <condition_type> is the type of condition and <condition_parameters> are the parameters for that condition.

Parameters

Before looking at the available condition types, let's look at the parameters formats that can be used in conditions.

  • String to value: <parameter_name>:<value>
    Example: min-food:10

  • String to list of values as YAML array.
    Example:

materials:
- DIAMOND_ORE
- GOLD_ORE

How do parameters work effectively?

You will be able to find both formats depending on the condition type.

In the complete documentation you will be able to find:

  • The accepted conditions for each task
  • The parameter name of each condition
  • The accepted values and formats for each parameter (
note

Keep in mind that you can't use a different format from the one specified in the documentation for that condition type.
You can get into trouble if you try to use a different format, so please follow the documentation carefully.

Types

Condition types are string values which define the type of condition.

warning

The plugin actually supports ONLY the 1.8 achievements and tasks, so as of now, you can not use later achievements or tasks.
We will implement features of newer versions in the future.

General Conditions

These conditions will be structured using a list.
In the table below, you can find the type id, the path and allowed values for each condition.

TypePathAllowed ValuesExample Values
achievementachievementsAchievement IDsBREW_POTION, KILL_ENEMY
biomebiomesBiome IDsDESERT, FOREST, TAIGA
blockmaterialsMaterial IDsDIAMOND_ORE, GOLD_ORE
entityentitiesEntity IDsCREEPER, ZOMBIE
itemmaterialsMaterial IDsDIAMOND_ORE, GOLD_ORE
potionpotion_typesPotion TypesSPEED, SLOWNESS

Player Conditions

For player conditions, we usually have different parameters for each condition type.

Player Experience

Condition based on the player's experience level and points.
If check-level is true, the player's level must be within the specified range.
If check-exp is true, the player's experience points must be within the specified range.

type: player_experience
min-level: 10
max-level: 20
check-level: true

min-exp: 1000
max-exp: 5000
check-exp: true
Player Flight

Condition based on the player's ability to fly or flying state.
If is-flying is true, the player must be flying.
If check-allow-flight is true, the player must be allowed to fly.

type: player_flight
is-flying: true
check-allow-flight: true
Player Food

Condition based on the player's food level.
min-food and max-food define the accepted food level range.

type: player_food
min-food: 10
max-food: 20
Player Game Mode

Condition based on the player's game mode.
gamemodes is a list of accepted game modes: SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR.

type: player_gamemode
gamemodes:
- SURVIVAL
- CREATIVE
Player Health

Condition based on the player's health.
min-health and max-health define the accepted health range.

type: player_health
min-health: 10
max-health: 20
Player Location

Condition based on the player's location.
worlds is a list of accepted worlds.
If check-coordinates is true, the player's coordinates must be within the specified min and max for x, y, z.

type: player_location
worlds:
- world1
- world2

check-coordinates: true
min-x: 100
max-x: 200
min-y: 50
max-y: 100
min-z: 100
max-z: 200
Player Permission

Condition based on the player's permissions.
permissions is a list of required permissions.
If require-all is true, the player must have all listed permissions.

type: player_permission
permissions:
- guilds.tasks.test
- guilds.tasks.another-test
require-all: true
Player Potion Effect

Condition based on the player's active potion effects.
potion-effects is a list of required effects.
If require-all is true, the player must have all listed effects.

type: player_potion
potion-effects:
- SPEED
- SLOWNESS
require-all: true
Player Sneak

Condition based on the player's sneak state.
If is-sneaking is true, the player must be sneaking.
If check-sneak is true, the sneak state will be checked.

type: player_sneak
is-sneaking: true
check-sneak: true