(SOLVED) Spawning a particle in front of the player

Started by Oofeiro on

Topic category: Help with modding (Java Edition)

Last seen on 22:28, 26. Aug 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(SOLVED) Spawning a particle in front of the player
Sun, 08/11/2024 - 17:42 (edited)

I wanna make a custom particle that spawns in front of the player when something is done, kinda like the vanilla sword slash. I played a little with the player's coords alongside the direction (yaw) block, trying to achieve something similar to my original idea but the particle didn't spawn. Then i gave up on the direction (yaw) block and used only the player coords, making the particle's spawning position based on the direction the player was looking (North, East, etc.). It did go well but not in the way i wanted, it was spawning in a fixed direction and not exactly where the player was looking.

Is there a way to do that? Spawn a particle exactly in front of the player?

Edited by Oofeiro on Sun, 08/11/2024 - 17:42
Last seen on 22:28, 26. Aug 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for answering me, bo…
Mon, 08/05/2024 - 21:22

Thanks for answering me, bo_bo, but none of those blocks solved my problem. I made some formulas between those blocks and the player's coords. The particle spawned nearby (not in front of the player) but every time i moved the camera, the particle would stop spawning.

Here's the procedure if you want to see it: https://imgur.com/a/cn1ApgJ (the Y coord doesn't matter as the particle will only follow the player's horizontal direction)

i tried 3 formulas: 1. adding the look pos to the coords; 2. subtracting the look pos by the coords; 3. multiplying the look pos by 0.1 to then adding it again with the coords. Only the first one went "well".

Last seen on 09:29, 9. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
try without any formula,…
Tue, 08/06/2024 - 00:16

try without any formula, like this: https://imgur.com/acIW00h (remove it for y since you don't need it) that should work better

Last seen on 07:42, 9. Sep 2024
Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use New Procedures Plus+…
Sat, 08/10/2024 - 14:41

Use New Procedures Plus+ plugin

Last seen on 22:28, 26. Aug 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
New Procedures+ solved my…
Sun, 08/11/2024 - 17:42

New Procedures+ solved my problem. Thanks for helping me guys