

export default {
    execute(item, player) {
        const fatigueTag = item.getTags().find(tag => /fatigue:[0-9]+:[0-9]+/.test(tag));
        
        if (!fatigueTag) return;
        const [ duration, amplifier ] = fatigueTag.split(":").slice(1).map(Number);
        // player.onScreenDisplay.setActionBar({ translate: "trueweapons.fatigue.line" });
        player.addEffect("weakness", duration, { showParticles: false, amplifier: amplifier });
    }
}