[SPIGOT-7984] FoodComponent Nutrition/Saturation Created: 17/Dec/24  Updated: 25/Dec/24  Resolved: 23/Dec/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Flavio Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates SPIGOT-7942 Add Consumable Component Resolved
Version:  CraftBukkit version 4398-Spigot-60c9969-561ceb9 (MC: 1.21.3) (Implementing API version 1.21.3-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

Using FoodComponent API you can set Nutrition/Saturation however the changes do not affect the item in the desired way

food components were marked on path "food" until 1.21.2, now them are marked as "consumable"

an edited item with spigot api where you set nutrition as 10 becomes

stone[food=\{nutrition:10,saturation:0.0f}]

while it should be

stone[consumable=\{nutrition:10,saturation:0.0f}]

 

food components now require consumable component to be eatable

stone[food=\{nutrition:10,saturation:0.0f}]

cannot be eaten, require to be

stone[consumable={},food=\{nutrition:10,saturation:0.0f}]

consume seconds goes on consumable component

stone[consumable=\{consume_seconds:1.6f},food=\{nutrition:10,saturation:0.0f}]


Generated at Sun Mar 30 18:01:22 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.