Making Custom compass

Started by MHK on

Topic category: Help with modding (Java Edition)

Last seen on 11:27, 30. Aug 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Making Custom compass

i know there's a lot of topic for making custom compass but none of them solves this problem. I think i found the solution but i don't speak math.

https://www.spigotmc.org/threads/find-angle-between-players-direction-and-a-location.134655/

double angle = (Math.atan2(l1.getX() - l2.getX(), l1.getZ() - l2.getZ()));
angle = (-(angle / Math.PI) * 360.0d) / 2.0d + 180.0d;

how can i make this in mcreator?

Last seen on 17:58, 2. Aug 2024
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This Should Be The 1-1…
Mon, 07/15/2024 - 04:44

This Should Be The 1-1 Equivalent. It doesn't get the Angle Relative to your look direction, just the angle based off the global coordinates.

( https://imgur.com/a/EtFDX8Q )

code

Last seen on 11:27, 30. Aug 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i want to make a custom…
Mon, 07/15/2024 - 13:03

i want to make a custom compass but like you said this just gets the angle based on my coordinates.This only works if i look at one direction. How can i make it so it adjust itself based on my look angle?