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

world.beforeEvents.worldInitialize.subscribe(e => {
    e.itemComponentRegistry.registerCustomComponent('mc_ark:cooked_prime_meat', { 
        onConsume({ itemStack, source }) {
            // Duración de 25 segundos (500 ticks)
            const duration = 25 * 20;
            source.addEffect('resistance', duration, {
                showParticles: false,
                amplifier: 0
            });
        }
    });
});