import { Player } from "@minecraft/server";
import { EntityHelper as EHelper } from "../../entities/utils/entityHelper";

export const IGUANA_MEAT = {
    _consumeEffect: EHelper.createEntityEffect("fire_resistance", 14, 1, true),
    _iguanaMeatRawType: "piki_beyondsurvival:iguana_meat_raw",
    _iguanaMeatCookedType: "piki_beyondsurvival:iguana_meat_cooked",

    /**
     * 
     * @param {Player} player 
     */
    onConsume: function(player) {
        const {effectType, duration, amplifier, showParticles} = this._consumeEffect
        player.addEffect(effectType, duration, {amplifier: amplifier, showParticles: showParticles})
    },
    isConsumed: function(typeId) {
        return typeId == this._iguanaMeatCookedType || typeId == this._iguanaMeatRawType
    }
} 