diff --git a/paper-api/src/main/java/org/bukkit/Material.java b/paper-api/src/main/java/org/bukkit/Material.java index 4873142177..450c23bc0e 100644 --- a/paper-api/src/main/java/org/bukkit/Material.java +++ b/paper-api/src/main/java/org/bukkit/Material.java @@ -387,6 +387,30 @@ public enum Material { return id < 256; } + /** + * Checks if this Material is edible. + * + * @return true if this Material is edible. + */ + public boolean isEdible() { + return equals(Material.BREAD) + || equals(Material.COOKIE) + || equals(Material.MELON) + || equals(Material.MUSHROOM_SOUP) + || equals(Material.RAW_CHICKEN) + || equals(Material.COOKED_CHICKEN) + || equals(Material.RAW_BEEF) + || equals(Material.COOKED_BEEF) + || equals(Material.RAW_FISH) + || equals(Material.COOKED_FISH) + || equals(Material.PORK) + || equals(Material.GRILLED_PORK) + || equals(Material.APPLE) + || equals(Material.GOLDEN_APPLE) + || equals(Material.ROTTEN_FLESH) + || equals(Material.SPIDER_EYE); + } + /** * Attempts to get the Material with the given ID *