All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.conditions.food.js Maven / Gradle / Ivy

There is a newer version: 1.6.7-beta-6
Show newest version
//@Condition()

Player = find("org.bukkit.entity.Player");
Coerce = static("Coerce");

key = "food";

names = ["要求饱食度: (?\\d+)"];

function parameters(matcher, text) {
  const value = Coerce.toInteger(matcher.group("value"));
  return mapOf({ value: value });
}

function condition(entity, map) {
  if (entity == null || !(entity instanceof Player)) return true;
  const level = Coerce.toInteger(map.get("value"));
  return entity.foodLevel >= level;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy