How to make particles spawn on an entity when it attacks

Started by banana_cookies25 on

Topic category: Help with modding (Java Edition)

Last seen on 15:46, 30. Dec 2023
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make particles spawn on an entity when it attacks

I've been checking other forums about this but i still don't know what to do since its kind of complicated

 

Can someone help me spawn particles on an entity when it attacks the player?

Last seen on 18:06, 24. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There's two types of…
Sat, 12/30/2023 - 15:07

There's two types of particle functions, both in the 'world management' tab. The first one lets you spawn a number of particles in a radius with a given speed, and the second lets you spawn individual particles with a specific location, speed, etc. The first one works for most things if you just want a random burst of particles, but the second is good if you want to program in a more complicated particle generation procedure. In your case, you would want to use the 'before entity is hurt' procedure trigger, and, if the source entity, (not the event/target entity), is your custom entity, use the 'spawn particles' function at the x/y/z position of the source entity.