Solved Colored Particles

Discussion in 'Plugin Development' started by AdraliK, Aug 10, 2018.

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

    AdraliK

    Hello everyone. How to create particles with custom or RGB colors?
     
  2. Offline

    Zombie_Striker

    @AdraliK
    1. For 1.12 ans lower, spawn a REDSTONE particles, where the xOffset, yOffset, and zOffset (the 4th,5th,and 6th values for spawnParticle) represent the RGB color.
    2. For 1.13, for the T value at the end, create a new DustColor object with the Color instance.
     
  3. Offline

    AdraliK


    Ok. And looks like or is indicated by a <T> value?
     
  4. Offline

    Zombie_Striker

    @AdraliK
    Its the T value at the end of the spawnParticle method.
     
  5. Offline

    AdraliK

    (

    I'm not getting anywhere((
    p.getWorld().spawnParticle(Particle.REDSTONE, x, y, z, 5, 0.1, 0.1, 0.1, 0.1); here error
    When I put a different effect then all works..
     
    Last edited: Aug 10, 2018
  6. Offline

    Zombie_Striker

    This is some code from one of my projects. This is how you would set the color of a particle:
    Code:
                if (USES 1.13) {
                    Particle.DustOptions dust = new Particle.DustOptions(
                            Color.fromRGB((int) r * 255, (int) g * 255, (int) b * 255), 1);
                    loc.getWorld().spawnParticle(Particle.REDSTONE, loc.getX(), loc.getY(), loc.getZ(), 0, 0, 0, 0, dust);
                } else {
                    loc.getWorld().spawnParticle(Particle.REDSTONE, loc.getX(), loc.getY(), loc.getZ(), 0, r, g, b, 1);
                }
     
    knokko likes this.
  7. Offline

    AdraliK


    Thanks, everything works fine)
     
Thread Status:
Not open for further replies.

Share This Page