Script de partículas
Crea un circulo de partículas alrededor de una entidad.unknown
javascript
3 years ago
728 B
31
Indexable
// EFECTOS: https://helpch.at/docs/1.7.10/index.html?org/bukkit/Effect.html
var Effect = Java.type("org.bukkit.Effect");
function onInteract(event) {
var player = event.getPlayer();
// PARÁMETROS: Entidad, Radio, Cantidad de partículas, Tipo de efecto, data
particleCircle(player, 3, 100, Effect.COLOURED_DUST, 0);
}
function particleCircle(entity, radius, particles, effectType, data) {
for (var i = 0; i < particles; i++) {
var angle = i * 2 * Math.PI / particles;
var x = radius * Math.cos(angle);
var z = radius * Math.sin(angle);
var loc = entity.getLocation().clone().add(x, 0, z);
loc.getWorld().playEffect(loc, effectType, data);
}
}Editor is loading...