scripts.conditions.altitude.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Pouvoir Show documentation
Show all versions of Pouvoir Show documentation
Bukkit Script Engine Plugin.
The newest version!
//@Condition()
Coerce = static("Coerce");
key = "altitude";
names = ["高度: (?\\d+)-(/\\d+)", "高度: (?\\d+)"];
function parameters(matcher, text) {
const min = Coerce.toDouble(matcher.group("min"));
let max = 10000;
try {
max = Coerce.toDouble(matcher.group("max"));
} catch (ignored) {}
return mapOf({ min: min, max: max });
}
function condition(entity, map) {
if (entity == null) return true;
const min = Coerce.toDouble(map.get("min"));
let max = 10000;
try {
max = Coerce.toDouble(map.get("max"));
} catch (ignored) {}
return entity.location.y >= min && entity.location.y <= max;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy