[Solved] Particle Effect Around Mob

Started by Gman on

Topic category: Help with modding (Java Edition)

Last seen on 02:18, 17. Jun 2024
Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Solved] Particle Effect Around Mob
Tue, 06/04/2024 - 01:52 (edited)

In short, I am having extreme difficulties making a looping command to make particles surround a mob while that mob is alive. I have made a system where when a mob kills a player, they become enhanced. As such, I'd like to have particles floating around the mob while they're alive and disappear when they die. Unfortunately, I have had ungodly trouble trying to make a loop where the particles keep spawning and properly disappear when the mob is dead.

Yes, I have looked at almost every looping tutorial provided by MCreator. And yes, I'm sure there is a simple solution to this that I am completely missing.

Any help would be appreciated.

Edited by Gman on Tue, 06/04/2024 - 01:52
Last seen on 18:01, 13. Jun 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For the most basic particle…
Mon, 06/03/2024 - 15:28

For the most basic particle effect, you would make a procedure that just uses the 'spawn # particles at x/y/z.' (This is found in the world actions tab.) Then you'd add an if-bracket to check if the entity is enhanced, and connect this procedure to the entity's 'update tick' trigger, so that it spawns particles every tick that the entity is enhanced. The important part is that it triggers on update tick, you don't actually need a loop for this. (You could also make a custom potion effect that does this on effect tick.)

(For some more advanced particle patterns, you could check out some of the procedure templates. The sphere and cylinder patterns work pretty well.)

Last seen on 02:18, 17. Jun 2024
Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The problem is attaching it…
Mon, 06/03/2024 - 22:55

The problem is attaching it to an entity and making the effect follow it. I'm not spawning in a new entity, just attaching the particles to the already living one. So getting the entity's data (i.e. the NBT tag) is a bit tricky, as I don't know of a way to detect mobs in the world with an NBT tag. 

I've tried "For Each Entity in # blocks" but the problem there is; what should I set the source of the coordinates for the detection radius? How am I going to make the procedure detect that an enhanced mob exists in the world?

Last seen on 02:18, 17. Jun 2024
Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ah nevermind, I found the…
Tue, 06/04/2024 - 01:52

Ah nevermind, I found the solution you were talking about. Cheers!