Particles even when player is standing still?

Discussion in 'Spigot Plugin Help' started by MaxNatural, May 13, 2016.

  1. Hello!
    How would I create particles even if the player is standing still?

    This is my class code and it still doesn't work

    Code (Text):
        @EventHandler
        public void onPlayerMove5(PlayerMoveEvent e) {
            if (ismoved.containsKey(e.getPlayer().getUniqueId())) {
                ParticleEffect.FIREWORKS_SPARK.display(10, 15, 20, 0, 0, e.getPlayer().getLocation().add(0,5,0), 70);
                   
                    } else {
                        if(!(ismoved.containsKey(e.getPlayer().getName()))) {
                                ParticleEffect.FIREWORKS_SPARK.display(10, 15, 20, 0, 0, e.getPlayer().getLocation().add(0,5,0), 70);
               

                    }
     
    I tried using HashMaps

    Code (Text):
        public static HashMap<String, Location> ismoved = new HashMap<String, Location>();
    I also tried ArrayLists. Is there a way to see if there not in the Array List that the particle still spawns above the head.

    Thank you! :D
     
  2. Create a timer and run it onEnable
     
  3. I have it in a GUI so when the player selects the particles it gives them the particles.
     
  4. wow4201

    Patron

    Place:
    RepeatParticle(player);

    When the player clicks the particle GUI.

    Code (Text):

     public void RepeatParticle(final Player player) {
            Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
                public void run() {
                    ParticleEffect.FIREWORKS_SPARK.display(10, 15, 20, 0, 0, player.getLocation().add(0,5,0), 70);
                }
            }, 10L, (10L)); // 4 minutes

        }
     
    Note: scheduleSyncRepeatingTask is depreciated so yeah.
     

  5. Like this?

    Code (Text):
        public NoFlex(Hub hub) {
            // TODO Auto-generated constructor stub
        }

        public void RepeatParticle(final Player player) {
        if (ParticleAPI.helix.contains(player.getUniqueId())) {
            Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Hub.plugin, new Runnable() {
                public void run() {
                    ParticleEffect.FIREWORKS_SPARK.display(10, 15, 20, 0, 0, player.getLocation().add(0,5,0), 70);
        }

                }, 10L, (10L)); // 4 minutes
            }

        }

    }