import { Entity } from "@minecraft/server";

/**
 *
 * @param {Entity} source
 */
export function circuleParticle(source, radius) {
    const location = source.location;
    const steps = 100;
    const angleStep = (2 * Math.PI) / steps;
    for (let radiu = 0; radiu < radius; radiu += 2) {
        for (let i = 0; i < steps; i += 1) {
            const angle = i * angleStep;
            const newLocation = {
                x: location.x + radiu * Math.cos(angle),
                y: location.y,
                z: location.z + radiu * Math.sin(angle),
            };
            source.dimension.spawnParticle(
                "minecraft:blue_flame_particle",
                newLocation
            );
        }
    }
}
