Solved Particle Velocity

Discussion in 'Plugin Development' started by Gould_Digger, Dec 25, 2018.

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

    Gould_Digger

    I am currently working on a plugin which involves particles and I need to be able to set their velocity. I have tried multiple times however it's still not working.

    Method 1 - This just changes where the particles spawn
    Code:
    Vector vel = new Vector(loc2.getX() - loc.getX(), loc2.getY() - loc.getY(), loc2.getZ() - loc.getZ());
    loc.getWorld().spawnParticle(Particle.FLAME, loc, 1, vel.getX(), vel.getY(), vel.getZ(), 0.05);
    Method 2 - This throws an error in the console - java.lang.IllegalArgumentException: data should be class java.lang.Void got class org.bukkit.util.Vector
    Code:
    Vector vel = new Vector(loc2.getX() - loc.getX(), loc2.getY() - loc.getY(), loc2.getZ() - loc.getZ());
    loc.getWorld().spawnParticle(Particle.FLAME, loc, 1, 0, 0, 0, 0.05, vel);
    Any help would be appreciated
     
  2. Offline

    MightyOne

    Use method 1 but set the particle count to 0
     
  3. Offline

    Gould_Digger

    Yes that works thanks
     
    Last edited: Dec 26, 2018
    MightyOne likes this.
Thread Status:
Not open for further replies.

Share This Page