Animating Ring Particles

Discussion in 'Spigot Plugin Development' started by Peaches_MLG, Jul 24, 2018.

  1. I'm trying to learn how to animate particles.

    So far I got this code to spawn a ring around a block:
    Code (Text):
    for (int i = 0; i < 10; i++) {
                    double angle = 2 * Math.PI * i / 10;
                    Location point = this.location.clone().add(Math.sin(angle), 0.0d, Math.cos(angle)).add(0.5, 1.5, 0.5);
                    //spawn particle at point.
                    PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(EnumParticle.FLAME, true, (float)point.getX(), (float)point.getY(), (float)point.getZ(), 0, 0, 0, 0, 1);
                    for(Player p : Bukkit.getOnlinePlayers()) {
                        ((CraftPlayer)p).getHandle().playerConnection.sendPacket(packet);
                    }
                }
    Is it possible to animate the ring slowly moving down the block?
     
  2. You need to use delayed tasks. You need to work with BukkitRunnables and schedulers.