Solved No Particles when Running

Discussion in 'Plugin Development' started by MagmaticBacca, Nov 29, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    MagmaticBacca

    I have this code:
    Code:
    public void Helix(final Player player) {
            new BukkitRunnable() {
                double phi = 0;
    
                public void run() {
                    phi = phi + Math.PI / 8;
                    double x, y, z;
    
                    Location location1 = player.getLocation();
                    for (double t = 0; t <= 2 * Math.PI; t = t + Math.PI / 16) {
                        for (double i = 0; i <= 1; i = i + 1) {
                            x = 0.4 * (2 * Math.PI - t) * 0.5 * Math.cos(t + phi + i * Math.PI);
                            y = 0.5 * t;
                            z = 0.4 * (2 * Math.PI - t) * 0.5 * Math.sin(t + phi + i * Math.PI);
                            location1.add(x, y, z);
                            ParticleEffect.REDSTONE.display(0,0,0,0,10,location1,10);
                            location1.subtract(x, y, z);
                        }
    
                    }
    
                    if (phi > 10 * Math.PI) {
                        this.cancel();
                    }
                }
            }.runTaskTimer(this, 0, 3);
        }
    And it works fine. But i want to make it so when the player is moving it does not display this. and it displays something else. How do i do dis? Ive tried a bunch of stuff but none of them work
     
  2. Offline

    Scimiguy

    Well when are you calling this method in the first place?
     
  3. Offline

    MagmaticBacca

    Im Calling the method when the player executes a command.
     
  4. Offline

    Scimiguy

    So why would it display it when the player is moving?
     
  5. Offline

    mcdorli

    PlayerMoveEvent? A look in the API can be very helpful sometimes
    jd.bukkit.org
     
  6. Offline

    MagmaticBacca

    @mcdorli ive tried that many times over there have been complications. Anyway i fixed it on my own.
     
Thread Status:
Not open for further replies.

Share This Page