Change a particle's color

Discussion in 'Plugin Development' started by Bartoke, Dec 18, 2013.

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

    Bartoke

    Hey!

    How does one change the color of - for example - the note or mobspell particle? The colors are randomly picked or black, but there should sure be a way to make them all one color, right?

    Thanks!

    Bump? Really need some help with this one.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  2. Offline

    xTrollxDudex

    Bartoke
    The particle's color depends on what created it and that's what determines the color AFAIK. Let me go take a look...

    Edit: I found a float data field for the particle packet
     
  3. Offline

    chasechocolate

  4. Offline

    Bartoke

    chasechocolate What that topic is saying is that there is basically no way to get colored particles into one color, other than either their color on 0 speed or random colors? Or am I bad at reading? D:

    xTrollxDudex
    Ah, so what is it and how can that be changed? Is it just another field that can be set, and to what exactly?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  5. Offline

    chasechocolate

    Bartoke for the MOB_SPELL particle, it can either be rainbow, black, or white. It can't be customized any further than that (AFAIK).
     
  6. Offline

    Bartoke

  7. Offline

    DarkBladee12

    chasechocolate You're completely right, I've messed around with particles for a long time and couldn't get them colored in a specific color besides black or white :/

    Bartoke They will remain white no matter which speed value you use.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  8. Offline

    Techy4198

    it has to be possible somehow with packets. someone needs to write a plugin that writes in the console every time a particle packet is sent, exactly what values are used. that way we can find out how actual fireworks / notes / potion effects do it.
     
  9. Offline

    DarkBladee12

    Techy4198 I think that's possible through the use of ProtocolLib.
     
    Garris0n likes this.
  10. Offline

    chasechocolate

    Bartoke if you want firework explosions, then look into codename_B 's firework effect resource.
     
  11. Offline

    Techy4198

    chasechocolate I find that no firework effect code works very well. one that I tried even made the firework launching sound! I just want the effect! any idea what library / code I can use to make silent firework effects?

    also DarkBladee12 another note on the packets, perhaps things like that accept the actual color value of the firework?for example 12412512. I know that's not an actual color value but u get the idea. perhaps that's why it uses a float. hmm...

    in relation to my last post, 16711680 would be red for fireworks

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  12. Offline

    DarkBladee12

    Techy4198 I don't think you can color these particles by modifying the speed value, I've tried out 16711680 and it crashed my client due to the high speed. The speed value of the FIREWORKS_SPARK effect just modifies the speed and nothing else. The value which is responsible for the color can't be sent with this packet, because how would they make fireworks then if speed and color share the same value?
     
  13. Offline

    codename_B

    Wool breaking particles gives you some color choices too
     
  14. Offline

    DarkBladee12

    codename_B Yeah, but the colors are limited, firework particles can have any color ;)
     
  15. Offline

    Techy4198

    DarkBladee12 just gotta figure out HOW to give them any color...
    Ahemyoumakeapacketloggingpluginahem
     
  16. Offline

    NathanWolf

    You can change the color of the firework effect, and in 1.7 you don't even need NMS to show the effect (with no launch sound) - just call detonate(). You can also use packets for this if you want to keep 1.6 support.

    I have only recently started playing with the effect packet to spawn individual particles, but imagine you could use that for firework particles? I'm not really sure on that, I do not know all the available effect types.

    EDIT: for what it's worth, feel free to check out my effects code, though I'm sure there are better libraries out there.

    https://github.com/elBukkit/MagicPl...makers/mine/bukkit/utilities/EffectUtils.java
     
    Garris0n likes this.
  17. Offline

    DarkBladee12

    NathanWolf Well I think it's already known that you can play a firework effect, but you can't spawn individual firework particles with color^^
     
Thread Status:
Not open for further replies.

Share This Page