Jump to content

Changing Colors of Particles?


Guest

Recommended Posts

Hello,

 

I was wondering if there was a way to spawn particles with modified colors. Specifically, I'd like to spawn EnumParticleTypes.DRIP_WATER but orange. (It's supposed to be like tree sap dripping from the tree.)

 

Does anyone know how to accomplish this?

Link to comment
Share on other sites

You would either need to create your own particle class or use WorldRenderer#addParticleUnchecked(it's private so you need reflection) that gets you the reference to the added particle so you can manually change it's colour fields. 

That is assuming 1.13.2. In 1.12 the method you need is RenderGlobal#spawnParticle0.

You could also use ParticleManager#spawnEffectParticle(1.12) or ParticleManager#addParticle(1.13) but you would need to replicate some checks WorldRenderer does.

You could also iterate the particle list(it is also private), find your particle there and change it's colour fields.

Link to comment
Share on other sites

11 hours ago, V0idWa1k3r said:

You could also iterate the particle list(it is also private), find your particle there and change it's colour fields.

How would I go about doing that? I'm in 1.12, so would I end up using RenderGlobal#spawnParticle() or something else?

Link to comment
Share on other sites

14 hours ago, Wolftopia said:

How would I go about doing that?

I just told you. Use reflection to access the list, iterate it, find your particle in it(likely based on it's position) and change the colour fields. I wouldn't recommend this way though.

 

14 hours ago, Wolftopia said:

would I end up using RenderGlobal#spawnParticle()

Sure, you can do that, that's one of the ways I've suggested.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.