ItemEvents.foodEaten(event => {

    let { server, player } = event

    if (event.item.id === 'minecraft:golden_apple') {
        player.potionEffects.add("minecraft:regeneration", 100, 3, true, false)
    }

    if (event.item.id === 'minecraft:enchanted_golden_apple') {
        player.potionEffects.add("minecraft:regeneration", 400, 4, true, false)
    }
});