How do you spawn particles on an item?

Started by Tryak on Sun, 02/28/2021 - 12:20

Topic category: Help with modding (Java Edition)

Last seen on 11:58, 2. Mar 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How do you spawn particles on an item?
Sun, 02/28/2021 - 12:20

I'm trying to make a musket and I want a smoke particle to appear on the tip of the musket after you shoot it. So far I can only spawn a particle on the player, can anyone help?

Last seen on 17:06, 13. Apr 2021
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
its quite complicated to…
Tue, 03/02/2021 - 06:51

its quite complicated to explain the math, but you'll need to do some math to transform the entity's body and arm rotations plus the weapon's offsets to world coordinates, and then spawn the particles there.

also, the above only gets you the coordinates in 3rd person view. you'll also need a whole other set of calculations to get the 1st person view coordinates.