Help with spawn location offsets

Started by Bellmeister on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with spawn location offsets
Mon, 09/09/2024 - 11:46 (edited)

I've been trying to figure out how to offset the spawn location of projectiles and particles based on the player's look angle and have been somewhat successful. So far I've managed to offset them forward, backwards, left and right using 2 different code blocks.

Forward and back is done using the following:

Left and right is done using the following:


I'm simply wondering if anyone knows the maths required to offset the particles/projectiles diagonally, and still be able to follow the player correctly as they turn, as this only seems to be possible so far with those 4 basic directions.

(also the images i attached aren't showing for some reason but if you copy the image address they'll open on imgur)

Edited by Bellmeister on Mon, 09/09/2024 - 11:46