Modify an item to be a food #1008
Unanswered
plavie
asked this question in
Script-related questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to customize an item : to turn it into food. Firstly i tryed to do it my self but i failed. Then, I tryed to use the excate same exemple provid by the wiki but it fails. I tryed to find a solution but it seems that their is only old solution, I am in 1.21.1 in NeoForge.
The exemple is :
ItemEvents.modification(event => {
event.modify('minecraft:diamond', item => {
item.foodProperties = food => {
food.hunger(2)
food.saturation(3)
food.fastToEat()
}
})
event.modify('minecraft:pumpkin_pie', item => {

item.foodProperties = null // make pumpkin pies inedible
})
})
startup log.txt
Thank You in advence
Beta Was this translation helpful? Give feedback.
All reactions