条件系统

插件提供了强大的条件系统。您可以同时使用简单条件和复杂条件。以下是一些示例,供您学习条件使用。

复杂条件允许您在一个部分中使用更多相同类型的条件。

简单的生物群系条件

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

复杂条件(允许您使用相同类型的条件) 部分名称(在本例中为“requirement_biome_1”)是完全可自定义的,只要它不与条件类型名称冲突即可。

requirement_biome_1:
  type: biome
  value:
    - 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
requirement_biome_2:
  type: '!biome'
  value:
    - minecraft:ocean
    - minecraft:deep_ocean
    - minecraft:cold_ocean

条件库

时间(Minecraft游戏时间 0~23999)

time:
  - 0~1000
  - 2000~6000

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

ypos(玩家的Y坐标)

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

biome(支持自定义生物群系)

biome:
  - minecraft:plains  <- 白名单

'!biome':
  - minecraft:plains  <- 黑名单

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(真实世界日期)

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'  <- 不以 "X" 开头的玩家名字

advanced_requirement:
  type: 'contains'
  value:
    value1: '%player_name%'
    value2: '_'  <- 包含 "_" 的玩家名字

advanced_requirement:
  type: '!equals'
  value:
    value1: '%player_name%'
    value2: 'XiaoMoMi'  <- 玩家名字不等于 "XiaoMoMi"

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

logic(创建复杂条件)

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

level(玩家经验等级)

level: 10

advanced_requirement:
  type: 'level'
  value: 10

random(0~1)

random: 0.3   <- 30% 的概率

advanced_requirement:
  type: 'random'
  value: 0.7   <- 70% 的概率

cooldown

cooldown:
  key: unique
  time: 1000 #毫秒

advanced_requirement:
  type: 'cooldown'
  value:
    key: A
    time: 100 #毫秒

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": 玩家没有这样的药水效果
"value 不低于 0": 药水效果的增幅

示例:
  LUCK==1
  LUCK<5
  LUCK>=0

geyser(如果玩家是geyser玩家)

geyser: false
  
advanced_requirement:
  type: 'geyser'
  value: true

gamemode

gamemode:
  - survival

advanced_requirement:
  type: "!gamemode"
  value:
  - adventure

self-disguised(需要LibsDisguises)

self-disguised: false

disguised-type(需要LibsDisguises)

'!disguised-type':
  - ARROW

region (需要WorldGuard)

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

is-passenger

'is-passenger': true

最后更新于