import { Player, system } from "@minecraft/server"
import { namespace } from "../../namespace"

/**
 * 
 * @param {Player} player 
 */
export function hackerApple(player) {
    player.dimension.playSound(`${namespace}:apple_on`, player.location)
    player.addEffect("resistance", 20 * 60, { amplifier: 10, showParticles: true })
    player.addEffect("absorption", 20 * 60, { amplifier: 10, showParticles: true })
    player.addEffect("fire_resistance", 20 * 60, { amplifier: 10, showParticles: true })
    player.addEffect("night_vision", 20 * 60, { amplifier: 10, showParticles: true })
    player.addEffect("strength", 20 * 60, { amplifier: 10, showParticles: true })
    player.addEffect("jump_boost", 20 * 60, { amplifier: 10, showParticles: true })
    player.addEffect("water_breathing", 20 * 60, { amplifier: 10, showParticles: true })
    player.addEffect("haste", 20 * 60, { amplifier: 10, showParticles: true })
    player.addEffect("health_boost", 20 * 60, { amplifier: 10, showParticles: true })
    player.addEffect("instant_health", 20 * 60, { amplifier: 10, showParticles: true })
    system.runTimeout(() => {
        player.dimension.playSound(`${namespace}:apple_off`, player.location)
    }, 20 * 60)
}

