import { world } from "@minecraft/server";

// Food effect
world.afterEvents.itemCompleteUse.subscribe(data => {
    const player = data.source
	const item = data.itemStack
    
    if (player.typeId === 'minecraft:player' && item.typeId == 'oct_plev:ambrosia' ) {
        player.runCommand("/effect @s absorption 120 4 true");
	}
})