Skip to content

条件

标签
AttributeSystem
字数
120 字
阅读时间
1 分钟

介绍

AttributeSystem条件 负责控制 一组/一行字符串 中的属性读取与否

使用

请看上一节 条件用法

定义

javascript
//@Condition()

key = "slot";
type = "ALL";
names = ["槽位: (?<slot>.*)"];

function condition(slot, entity, matcher, text) {
  if (entity == null || !(entity instanceof Player)) return true;
  const requiredSlot = matcher.group("slot");
  return requiredSlot.equalsIgnoreCase(slot);
}

function conditionNBT(slot, entity, map) {
  if (entity == null || !(entity instanceof Player)) return true;
  const requiredSlot = map.get("slot");
  return requiredSlot.equalsIgnoreCase(slot);
}

java / kotlin 中编写BaseCondition子类并register()

贡献者

The avatar of contributor named as Glomzzz Glomzzz
The avatar of contributor named as Glom-c Glom-c

页面历史