Condition

Plugin provides a powerful condition system. You can use both simple conditions and advanced conditions at the same time. Here are some examples for you to learn conditions.

simple biome condition only contains the necessary arguments

biome:
  - minecraft:ocean
  - minecraft:deep_ocean
  - minecraft:cold_ocean
  - minecraft:deep_cold_ocean
  - minecraft:frozen_ocean
  - minecraft:deep_frozen_ocean
  - minecraft:lukewarm_ocean
  - minecraft:deep_lukewarm_ocean
  - minecraft:warm_ocean

advanced condition allows you to use conditions of the same type and add not-met-actions The section name ("requirement_permission_1" in this case) is completely customizable as long as it does not conflict with the condition type name.

# This example uses two permission conditions
requirement_permission_1:
  type: permission
  value:
    - xxx.1.xxx
requirement_permission_2:
  type: permission
  value:
    - xxx.2.xxx
  not-met-actions:
    action_1:
      type: xxx
      value: ...

# wrong usage (YAML format doesn't allow this)
permission:
  - xxx.1.xxx
permission:
  - xxx.2.xxx

Condition Library

time (Minecraft game time 0~23999)

time:
  - 0~1000
  - 2000~6000

advanced_requirement:
  type: time
  value:
  - 0~1000
  - 2000~6000

ypos (Player's Y coordinate)

ypos:
  - 0~43
  - -45~12
  
advanced_requirement:
  type: ypos
  value:
  - 0~43
  - -45~12

biome (Supports custom biomes)

biome:
  - minecraft:plains  <- whitelist

'!biome':
  - minecraft:plains  <- blacklist

advanced_requirement:
  type: biome
  value:
  - minecraft:plains

advanced_requirement:
  type: '!biome'
  value:
  - minecraft:plains

world

world:
  - world

'!world':
  - blacklist_world

advanced_requirement:
  type: world
  value:
  - world

advanced_requirement:
  type: '!world'
  value:
  - blacklist_world

weather

weather:
  - thunder
  - clear
  - rain

advanced_requirement:
  type: 'weather'
  value:
  - thunder
  - clear
  - rain

date (Real world date)

date:
  - 12/25
  - 6/1

advanced_requirement:
  type: 'date'
  value:
  - 12/25
  - 6/1

permission

permission: customfishing.admin

'!permission': blacklist.perm

advanced_requirement:
  type: 'permission'
  value: customfishing.admin
  
advanced_requirement:
  type: '!permission'
  value: blacklist.perm

“>” “>=” “<” “<=” “==” “!=”

'==':
  value1: '20'
  value2: '%player_health%'

advanced_requirement:
  type: '=='
  value:
    value1: '20'
    value2: '%player_health%'

“startsWith” “endsWith” “equals” “contains” “in-list”

'!startWith':
  value1: '%player_name%'
  value2: 'X'  <- player names that are not starting with "X"

advanced_requirement:
  type: 'contains'
  value:
    value1: '%player_name%'
    value2: '_'  <- player names that contain "_"

advanced_requirement:
  type: '!equals'
  value:
    value1: '%player_name%'
    value2: 'XiaoMoMi'  <- player names that not equal "XiaoMoMi"

advanced_requirement:
  type: 'in-list'
  value:
    papi: '%player_name%'
    values: 
      - 'XiaoMoMi'
      - 'XIAOMOMI'
      - 'XlA0M0Ml'

logic (Create complex conditions)

advanced_requirement:
  type: '&&'
  value:
    in-lava: true
    requirement_time:
      type: time
      value:
        - 0~12000
    '||':
      world:
        - world_nether
      '&&':
        ypos:
          - -64~-32
        world:
          - world

level (Player exp level)

level: 10

advanced_requirement:
  type: 'level'
  value: 10

random (0~1)

random: 0.3   <- 30% chance

advanced_requirement:
  type: 'random'
  value: 0.7   <- 70% chance

cooldown

cooldown:
  key: unique
  time: 1000 #ms

advanced_requirement:
  type: 'cooldown'
  value:
    key: A
    time: 100 #ms

regex

regex:
  papi: %xxx%
  regex: "[A-Z]"

advanced_requirement:
  type: 'regex'
  value:
    papi: %xxx%
    regex: "[A-Z]"

environment

environment:
  - normal
  - nether
  - the_end
  
advanced_requirement:
  type: '!environment'
  value:
    - nether
    - the_end
    - custom

potion-effect

potion-effect: "LUCK>=0"

advanced_requirement:
  type: 'potion-effect'
  value: "LUCK!=-1"

"-1": Player doesn't have such a potion effect
"value no lower than 0": The potion effect's amplifier

Examples:
  LUCK==1
  LUCK<5
  LUCK>=0

temperature

temperature:
  - 0.15~0.85

advanced_requirement:
  type: "temperature"
  value:
  - 0.15~0.85

sneak

sneak: true

advanced_requirement:
  type: "sneak"
  value: true

plugin-level

plugin-level:
  plugin: AureliumSkills
  level: 10
  target: FARMING

advanced_requirement:
  type: plugin-level
  value:
    plugin: AureliumSkills
    level: 10
    target: FARMING

season

season:
  - Spring

advanced_requirement:
  type: season
  value:
    - Spring

condition_season:
  type: suitable-season
  value:
  - Spring

condition_season:
  type: unsuitable-season
  value:
  - Winter

fertilizer

fertilizer:
  has: true
  
fertilizer:
  has: false

advanced_requirement:
  type: fertilizer
  value:
    has: true

advanced_requirement:
  type: fertilizer
  value:
    has: true
    key:
      - speed_grow_1
      - speed_grow_2

item-in-hand

item-in-hand:
  item: "AIR"

item-in-hand:
  item: "*" # any item

advanced_requirement:
  type: item-in-hand
  value:
    hand: other # the other hand
    item: "PAPER"
    amount: 32

light / natural-light

light:
   - 0~7

natural-light:
   - 7~14

advanced_requirement:
  type: light
  value:
    - 0~1
    - 3~5

condition_light:
  type: natural-light-more-than
  value: 8

condition_light:
  type: natural-light-less-than
  value: 8

condition_light:
  type: light-less-than
  value: 8

condition_light:
  type: light-more-than
  value: 7

gamemode

gamemode:
   - creative

advanced_requirement:
  type: gamemode
  value:
    - creative
    - adventure

crow attack

condition_xxx:
  type: crow-attack
  value:
    chance: 0.005
    fly-model: crow_fly
    stand-model: crow_stand

water more than (For custom pots)

condition_xxx:
  type: water-more-than
  value: 0

ondition_xxx:
  type: water-more-than
  value:
    y: -1  # y defaults to -1 if not set
    value: 0

water less than (For custom pots)

condition_xxx:
  type: water-less-than
  value: 1

condition_xxx:
  type: water-less-than
  value:
    y: -1 # y defaults to -1 if not set
    value: 1

point more than

condition_xxx:
  type: point-more-than
  value: 1

point less than

condition_xxx:
  type: point-less-than
  value: 1

moisture more than (For vanilla farmland)

condition_xxx:
  type: moisture-more-than
  value: 0

condition_xxx:
  type: moisture-more-than
  value:
    y: -1 # y defaults to -1 if not set
    value: 0

moisture less than (For vanilla farmland)

condition_xxx:
  type: moisture-less-than
  value: 1

condition_xxx:
  type: moisture-less-than
  value:
    y: -1 # y defaults to -1 if not set
    value: 1

pot

condition_xxx:
  type: pot
  value:
    y: -1
    id:
      - default

fertilizer

condition_xxx:
  type: fertilizer
  value:
  - speed_grow_1

# has no fertilizer
condition_xxx:
  type: fertilizer
  value:
    y: -1 # Y defaults to 0
    has: false 

# blacklist ids
condition_xxx:
  type: fertilizer
  value:
    y: -1
    has: false 
    type:
     - speed_grow_1
     - soil_retain_2

# whitelist ids
condition_xxx:
  type: fertilizer
  value:
    y: 0
    has: true
    type:
     - speed_grow_1
     - speed_grow_2
     - speed_grow_3

fertilizer type

condition_xxx:
  type: fertilizer-type
  value:
  - SPEED_GROW

# has no fertilizer
condition_xxx:
  type: fertilizer
  value:
    y: -1 # Y defaults to 0
    has: false 

# blacklist types
condition_xxx:
  type: fertilizer
  value:
    y: -1
    has: false 
    type:
     - speed_grow
     - soil_retain

# whitelist types
condition_xxx:
  type: fertilizer
  value:
    y: 0
    has: true
    type:
     - speed_grow

region (requires WorldGuard)

advanced_requirement:
  type: region
  value:
    mode: 1 # 1,2
    values:
      - a
      - b
region:
  mode: 2
  values:
    - a
    - b

Last updated