Started by
MHK
on
Topic category: Help with modding (Java Edition)
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?
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 )
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?