john01dav Posted September 14, 2014 Posted September 14, 2014 Hello Forge! I am in need of a mechanism to get a player's X Y and Z coordinates, I have tried two different ways: - entityPlayer.getPosition(0).xCoord; // I don't know what the parameter in getPosition is for - entityPlayer.posX Both cause NoSuchMethod errors during runtime. So, my question is how do I get a player's location? Thanks in advance for any answers!
sequituri Posted September 14, 2014 Posted September 14, 2014 entityPlayer.getPlayerCoordinates() -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
MultiMote Posted September 14, 2014 Posted September 14, 2014 getPosition is clientside. .posX can't cause NoSuchMethodError
john01dav Posted September 14, 2014 Author Posted September 14, 2014 On 9/14/2014 at 6:28 AM, sequituri said: entityPlayer.getPlayerCoordinates() Thanks! It works perfectly!
Smoothley Posted February 20, 2021 Posted February 20, 2021 Is there any way to get a more precise coordinate of the player? The getting of xyz coordinates from the method that you said only returns int values, is there anyway to get it more accurate to more decimal places? (assume what you meant for getting the position to be - Minecraft.getMinecraft().thePlayer.getPosition() then .getX() etc.)
Recommended Posts