import { onConsumeWrapper } from "./wrapper";
import { ItemComponentConsumeEvent, world } from '@minecraft/server';

export class WardenHeart extends onConsumeWrapper {
    constructor() {
        super();
    }

    /** @param {ItemComponentConsumeEvent} e */
    onConsume(e) {
        e.source.addEffect('strength', 4800, { amplifier: 2 });
        e.source.addEffect('resistance', 4800, { amplifier: 3 });
        e.source.addEffect('regeneration', 100, { amplifier: 1 });
        e.source.addEffect('absorption', 2400, { amplifier: 0 });
        world.scoreboard.getObjective('plank_waao:blindness_immunity').setScore(e.source, 9600);
    }
}