Solved Recoloring Particles, How?

Discussion in 'Spigot Plugin Development' started by ShiroCode, Aug 4, 2018.

  1. Hey, so i've made my first Particles today, but the color of the EnumParticle.CLOUD is kinda ugly, so i wanna recolor it to a WHITE or even Blue, idc..

    Do anymore has some knowledge about how to recolor that?

    Thats my method:
    Code (Java):
    public static void sendParticle(Location loc, EnumParticle particletype, float offsetX, float offsetY, float offsetZ, float speed, int amount) {

            for(Player all : Bukkit.getOnlinePlayers()) {
                PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particletype, false, (float)loc.getX(), (float)loc.getY(), (float)loc.getZ(), offsetX, offsetY, offsetZ, speed, amount);
                ((CraftPlayer)all).getHandle().playerConnection.sendPacket(packet);
            }

        }
    Thanks to anyone who is willing to help me!
     
  2. There are already many threads about that, use the forums search before posting a new thread.
    There even is a spigot wiki article about it.
    And you don't need NMS or packets to do so.

    EDIT: There is the wiki article https://www.spigotmc.org/wiki/colored-particles/
     
    • Useful Useful x 1
  3. But wait, i dont get it, if offsetX,Y and Z is the color, why does my particles change the "range" when i change those floats? ._. i cant understand all of this
     
  4. And also, it spawned one Particle, and i want to spawn like 30 particles at different places around the Player-Body, so i prefer my option :/
     
  5. These will help:
    Wiki sais, amount AND speed needs to be 0. if not, offset will be applied as spawning range / floating area.
    I spawn over 350 particles each second and use bukkits World#spawnParticle, didn't recognize any performance influence.

    Maybe when spawning about 1000 it would be worth to use packets so bukkit doesn't instantiate each packet new, but for 30.... doesn't matter!
     
  6. My next Problem is, that i use 1.8.8.

    So i cant simply use p.spawnParticles();

    but aight, gonna try settings amount and speed to 0

    Ty!
     
  7. Maybe try some api.
     
  8. 1.8 is still a thing??? I don't get it...

    However you might have "world.spigot().spawnParticle()" or something?
     
    • Funny Funny x 1
  9. I would, but im trying to create them by my own..


    No i actually cant.
     
  10. You can't color the cloud particle.

    You can only color (ambient) potion and redstone particles.
     
  11. oh, alright. Thanks tho!
     
    • Like Like x 1