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

export const COLD_ROTTEN_FLESH = {
    _consumeEffect: EHelper.createEntityEffect("slowness", 30, 0, true),
    _coldRottenFleshType: "piki_beyondsurvival:cold_rotten_flesh",

    /**
     * 
     * @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._coldRottenFleshType
    }
}