scripts.conditions.slot.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AttributeSystem Show documentation
Show all versions of AttributeSystem Show documentation
Bukkit Attribute Engine Plugin.
The newest version!
//@Condition()
key = "slot";
names = ["槽位: (?.*)"];
function parameters(matcher, text) {
var requiredSlot = matcher.group("slot");
return mapOf({ required: requiredSlot });
}
function condition(entity, map) {
if (entity == null) return true;
// 槽位会自动初始化到参数中
const slot = map.get("slot");
const required = map.get("required");
if (slot == null || required == null) return true;
return slot.equalsIgnoreCase(required);
}