#Modify an item in KubeJS6
24 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
This is a list of all the events. Choose your version.
get the item modify event from there (use ctrl +f to search it for modif and then use that instead of the old event in the old example, with the rest the same
I think i applied it properly, but it still isnt working. No errors when reloading though
ItemEvents.modification(e => {
e.modify('forge:super_glue', item => {
food.hunger(4)
food.saturation(3)
food.alwaysEdible();
})
})```
Still not working after a game restart,
why do u have a mod who is adding items to the forge namespace?
e.modify('forge:super_glue'
That says its an item from forge.. and forge doesnt add items
lemme try changing that
I get this error now:
Error occurred while handling event 'ItemEvents.modification': TypeError: Cannot find function hunger in object super_glue. (startup_scripts:glue_edible.js#3)
Not sure how tough, i thought item.alwaysEdible(); would add hunger properties to that item
those are all food builder methods
e.modify('item', item => {
item.food(food => {
food.hunger(2)
})
})
This still gives me a syntax error
ItemEvents.modification(e => {
e.modify('create:super_glue', item => {
item.food(food => {
food.hunger(4)
food.saturation(3)
food.alwaysEdible(true);
})
})
})
Error occurred while handling event 'ItemEvents.modification': TypeError: Cannot find function food in object super_glue. (startup_scripts:glue_edible.js#3)
(thanks for helping my thus far btw)
oh its .foodProperties = food => {
you mean like this?
ItemEvents.modification(e => {
e.modify('create:super_glue', item => {
item.foodProperties(food => {
food.hunger(4)
food.saturation(3)
food.alwaysEdible(true);
})
})
})
it still doesnt work
no, like this:
ItemEvents.modification(e => {
e.modify('create:super_glue', item => {
item.foodProperties = food => {
food.hunger(4)
food.saturation(3)
food.alwaysEdible(true)
}
})
})
its really odd syntax
yes that was it! thanks alot ❤️