Skip to content

功能模块

模块是子关卡的最小功能单元。每个模块通过 type 字段指定类型,并附带各自的配置项。

所有带坐标的模块,其坐标必须在主关卡的区域范围内,否则加载时会报错。坐标不需要指定世界名,插件会自动使用主关卡区域的世界。

accessible — 可进入区域

玩家首次进入指定范围时触发脚本。离开再进入可重复触发。

yaml
模块名:
  type: accessible
  pos-A: [100, 60, 200]
  pos-B: [110, 70, 210]
  on-enter: |-
    tell color "&a你进入了区域!"
配置项类型必填说明
pos-A[x, y, z]区域起点坐标
pos-B[x, y, z]区域终点坐标
on-enterString进入区域时执行的 Kether 脚本

singleaccess — 一次性触发区域

accessible 类似,但全局只触发一次。一旦有任何玩家进入过,后续玩家不再触发。

yaml
模块名:
  type: singleaccess
  pos-A: [100, 60, 200]
  pos-B: [110, 70, 210]
  on-enter: |-
    tell color "&e一次性机关触发!"
配置项类型必填说明
pos-A[x, y, z]区域起点坐标
pos-B[x, y, z]区域终点坐标
on-enterString首次进入时执行的 Kether 脚本

clickable — 可点击方块

右键点击指定方块时触发脚本。

yaml
模块名:
  type: clickable
  pos: [125, 65, 225]
  on-click: |-
    tell color "&b你点击了方块!"
配置项类型必填说明
pos[x, y, z]可点击方块的坐标
on-clickString点击时执行的 Kether 脚本

pressable — 可按压方块

玩家需要持续右键按住指定方块一段时间后触发。松手会重置计时。

yaml
模块名:
  type: pressable
  pos: [125, 65, 225]
  time: 60
  on-click: |-
    tell color "&a按压完成!"
配置项类型必填说明
pos[x, y, z]可按压方块的坐标
timeLong需要按压的时间(tick,20 tick = 1 秒)
on-clickString按压完成后执行的 Kether 脚本

deathtrap — 死亡陷阱

玩家进入指定范围后立即死亡,并触发脚本。

yaml
模块名:
  type: deathtrap
  pos-A: [100, 60, 200]
  pos-B: [102, 62, 202]
  on-death: |-
    tell color "&c你踩到陷阱了!"
配置项类型必填说明
pos-A[x, y, z]陷阱区域起点
pos-B[x, y, z]陷阱区域终点
on-deathString玩家死亡时执行的 Kether 脚本

airwall — 空气墙

玩家进入范围时会被弹开,并触发脚本。

yaml
模块名:
  type: airwall
  speed: 0.3
  pos-A: [100, 60, 200]
  pos-B: [102, 70, 202]
  on-enter: |-
    tell color "&7前方不可通行"
配置项类型必填说明
pos-A[x, y, z]空气墙起点
pos-B[x, y, z]空气墙终点
speedDouble击退速度,默认 0.3
on-enterString被弹开时执行的 Kether 脚本

spawner — 刷怪点

在指定位置周期性生成 MythicMobs 怪物。只有附近有玩家时才会刷怪。需要 MythicMobs 插件。

yaml
模块名:
  type: spawner
  async: false
  pos: [125, 65, 225]
  period: 100
  times: 3
  distance: 15
  random-x: 3
  random-y: 0
  random-z: 3
  mobs:
    - mob: SkeletalKnight
      amount: 2
    - mob: AngrySludge
      amount: 1
配置项类型必填说明
pos[x, y, z]刷怪点中心坐标
mobsList怪物配置列表(mob: MM怪物ID, amount: 数量)
periodLong刷怪间隔(tick),默认 20
timesInt刷怪波数,默认 1
distanceDouble检测玩家的范围,默认 10.0
asyncBoolean是否异步执行,默认 false
random-xIntX 轴随机偏移,默认 0
random-yIntY 轴随机偏移,默认 0
random-zIntZ 轴随机偏移,默认 0

TIP

关卡停止时,所有刷出的怪物会被自动清除。

autoclose — 自动关闭

在指定延迟后自动推进到下一个子关卡。

yaml
模块名:
  type: autoclose
  time: 200
配置项类型必填说明
timeLong延迟时间(tick)

delay-executor — 延迟执行

在指定延迟后执行 Kether 脚本。

yaml
模块名:
  type: delay-executor
  time: 100
  script: |-
    tell color "&e延迟任务执行!"
配置项类型必填说明
timeLong延迟时间(tick)
scriptString延迟后执行的 Kether 脚本

landmark — 地标

在指定位置显示 DecentHolograms 全息图。需要 DecentHolograms 插件。

yaml
模块名:
  type: landmark
  hologram: my_hologram
  pos: [120, 68, 220]
配置项类型必填说明
pos[x, y, z]全息图显示位置
hologramStringDecentHolograms 中的全息图名称

TIP

模块激活时将全息图复制到指定位置并显示,停止时隐藏并移除。

killtrigger — 击杀触发

击杀指定 MythicMobs 怪物时触发脚本。需要 MythicMobs 插件。

yaml
模块名:
  type: killtrigger
  mob-type: SkeletalKnight
  on-kill: |-
    areamodule:score add kill by 1
配置项类型必填说明
mob-typeStringMythicMobs 怪物 ID
on-killString击杀后执行的 Kether 脚本

ady-npc — Adyeshach NPC

在指定位置生成一个 Adyeshach NPC,玩家右键交互时触发脚本。交互后 NPC 自动消失。需要 Adyeshach 插件。

yaml
模块名:
  type: ady-npc
  npc-name: "老村长"
  npc-type: VILLAGER
  pos: [130, 65, 230]
  script: |-
    tell color "&6老村长: 感谢你的帮助!"
配置项类型必填说明
npc-nameStringNPC 显示名称
npc-typeStringNPC 实体类型(Adyeshach EntityTypes)
pos[x, y, z]NPC 生成坐标
scriptString交互时执行的 Kether 脚本

message — 消息显示

持续向区域内玩家显示 ActionBar 或 BossBar 消息。

yaml
模块名:
  type: message
  message-type: BOSSBAR
  message: "&e挑战进行中..."
配置项类型必填说明
message-typeString消息类型:BOSSBARACTIONBAR
messageString消息内容,支持颜色代码

TIP

BossBar 模式下会自动跟踪区域内玩家的变化(加入/离开),ActionBar 每秒刷新一次。关卡停止时自动清理。

基于 TabooLib 构建的 Minecraft 区域关卡插件