Skip to content

Commit 0a95a3e

Browse files
committed
Fix ItemType#isEdible to also check for DataComponents#CONSUMABLE
This fix only allows items that can actually be eaten by the player. For example, since version 1.21.11, fish buckets have also provided the FOOD component, but they cannot be eaten.
1 parent 354a5d5 commit 0a95a3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public short getMaxDurability() {
143143

144144
@Override
145145
public boolean isEdible() {
146-
return this.getHandle().components().has(DataComponents.FOOD);
146+
return this.getHandle().components().has(DataComponents.FOOD) && this.getHandle().components().has(DataComponents.CONSUMABLE);
147147
}
148148

149149
@Override

0 commit comments

Comments
 (0)