import { world, system } from "@minecraft/server";
import * as utils from "./utils";


export async function applyEffect(player, source)
{
	let random = Math.floor(Math.random() * 15);
	switch(random)
	{
		case 0:
			player.addEffect("speed", 160, { amplifier: 2 });
			break;
		case 1:
			source.addEffect("slowness", 160, { amplifier: 2 });
			break;
		case 2:
			player.addEffect("strength", 160, { amplifier: 2 });
			break;
		case 3:
			source.addEffect("instant_damage", 160, { amplifier: 2 });
			break;
		case 4:
			player.addEffect("instant_health", 160, { amplifier: 2 });
			break;
		case 5:
			source.addEffect("weakness", 160, { amplifier: 2 });
			break;
		case 6:
			player.addEffect("jump_boost", 160, { amplifier: 2 });
			break;
		case 7:
			source.addEffect("poison", 160, { amplifier: 2 });
			break;
		case 8:
			player.addEffect("regeneration", 160, { amplifier: 2 });
			break;
		case 9:
			source.addEffect("wither", 160, { amplifier: 2 });
			break;
		case 10:
			player.addEffect("resistance", 160, { amplifier: 2 });
			break;
		case 11:
			source.addEffect("levitation", 160, { amplifier: 2 });
			break;
		case 12:
			player.addEffect("fire_resistance", 160, { amplifier: 2 });
			break;
		case 13:
			player.addEffect("absorption", 160, { amplifier: 2 });
			break;
	}
}