#Food isn`t working

39 messages · Page 1 of 1 (latest)

peak herald
#

My food script isn't working, i don't know what is wrong with it

StartupEvents.registry('item', event => {
event.create('maizena').displayName('§6§oBolacha Maizena').food(food =>{
food
.hunger(10)
.saturation(0.6)
.effect('minecraft:regeneration', 1800, 1, 1)
.effect('minecraft:strength', 1800, 1, 1)
.removeEffect('poison')
.alwaysEdible()
})
})

hoary flameBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

solid fox
#

i'm not sure that's how it works

#

iirc you first need to define the item, and in a later event modify it's properties so it actually becomes a food

#

like that :

StartupEvents.registry('item', event => {
  event.create('maizena').displayName('§6§oBolacha Maizena')
})

ItemEvents.modification(event => {
  event.modify('kubejs:maizena', item => {
    item.foodProperties = food => {
       food.hunger(10)
       food.saturation(0.6)
       food.effect('minecraft:regeneration', 1800, 1, 1)
       food.effect('minecraft:strength', 1800, 1, 1)
       food.removeEffect('poison')
       food.alwaysEdible()
       // Que maizena abençoada é essa?
    }
  })
})
peak herald
#

1 sec, i will see if it works

solid fox
#

actually there's an error

peak herald
#

?

solid fox
#

forgot a line

peak herald
#

oh

#

alright

solid fox
#

srry for that

peak herald
#

np

peak herald
solid fox
#

did you gt any errors?

peak herald
peak herald
#

but there`s a warning

#

2 warnings*

solid fox
#

could you check :

your_modpack_namespace/logs/kubejs/startup?

solid fox
peak herald
solid fox
#

i would like to see the logs in the startup folder, these weren't very helpful

peak herald
lean sierraBOT
#

Paste version of startup.log from @tawny coral

solid fox
#

that is weird

#

do you have any errors in latest log?

peak herald
#

let me see

#

1 sec

lean sierraBOT
#

Paste version of latest.log from @tawny coral

solid fox
#

i see nothing wrong

#

that's a weird behavior, even the startup logs are fine

peak herald
#

could it be a mod in the modpack?

solid fox
#

not likely

peak herald
#

alright, this is strange

solid fox
#

true