let data = JsonIO.read('kubejs/config/food.json')

ItemEvents.modification(event => {
    event.modify(Object.keys(data), item => {
        item.foodProperties = food => {
            let dataEntry = data[item.arch$registryName().toString()]
            food.hunger(dataEntry.heal)

            for(let effectDef of dataEntry.effects) {
                switch(effectDef.type) {
                    case "give":
                        food.effect(effectDef.effect, effectDef.time, effectDef.level, effectDef.chance)
                        break
                }
            }
        }
    })
})