So when the player stands still I want to still spawn the particles. But every time they move it creates more and more particles. Is there a way to make it so when they move they spawn a certain amount and when they stop moving it still displays the other amount and not add more particles? Thank you! Code (Text): @EventHandler public void onPlayerMove5(final PlayerMoveEvent e) { if (ParticleAPI.volcanoash.contains(e.getPlayer().getUniqueId())) { new BukkitRunnable() { @Override public void run() { if (ParticleAPI.volcanoash.contains(e.getPlayer().getUniqueId())) { ParticleEffect.EXPLOSION_NORMAL.display(10, 15, 20, 0, 0, e.getPlayer().getLocation().add(0,2.5,0), 10); //ParticleEffect.EXPLOSION_NORMAL.display(10, 15, 20, 0, 0, e.getPlayer().getLocation().add(0.3,3,0.3), 70); //ParticleEffect.EXPLOSION_NORMAL.display(10, 15, 20, 0, 0, e.getPlayer().getLocation().add(0.3,3,0.3), 70); ParticleEffect.LAVA.display(10, 40, 1000, 0, 0, e.getPlayer().getLocation().add(0,2.6,0), 5); } else if(!(ParticleAPI.volcanoash.contains(e.getPlayer().getUniqueId()))) { e.setCancelled(true); } } }.runTaskTimer(Hub.plugin, 0, 20); } } }
I myself don't know much about this problem, but I recommend posting this on the Spigot Development Help forum, because you'll get much faster and more detailed responses there. Try making a post there or getting your thread moved.
just make a runnable that displays the particles, dont call it on player move call it when he gets into volcanoash