import { EffectTypes } from "@minecraft/server";
import { Vector3 } from "../Vector3";
import { spawnParticleAtPlayer } from "../SpawnParticle";

//Function run when using the spell
export function healingSpell(player) {
  player.sendMessage(`<${player.nameTag}> Healing spell!`);
  //Effect
  player.addEffect(EffectTypes.get('regeneration'), 40, {amplifier: 4, showParticles: false});
  //Particle
  let particleLoc = new Vector3(player.location.x, player.location.y, player.location.z);
  spawnParticleAtPlayer(player, "blockception_magic:healing_spell", particleLoc);
  spawnParticleAtPlayer(player, "blockception_magic:healing_ring", particleLoc);
  spawnParticleAtPlayer(player, "blockception_magic:healing_runes", particleLoc);
  spawnParticleAtPlayer(player, "blockception_magic:healing_cloud", particleLoc);
}