JoelGodOfWar Posted May 10, 2015 Share Posted May 10, 2015 I'm pretty new to modding, due to a need on the server i play on, i want to make a mod. So i am trying to learn. I have eclipse, and forge setup. I just can't seem to find the right dependency to get the information i want. I want to get the XYZ of the player, and display it in the bottom right of the screen. Later i will want to detect when the player makes a nether portal, and then display the coords of where the other portal should go, based on where they are when they make the first portal. code is helpful, but just pointing me to the right dependency will be good. Quote Link to comment Share on other sites More sharing options...
larsgerrits Posted May 10, 2015 Share Posted May 10, 2015 player.posX/Y/Z ? Quote Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/ Link to comment Share on other sites More sharing options...
JoelGodOfWar Posted May 10, 2015 Author Share Posted May 10, 2015 The code i'm looking at, from Zyin, shows this, public static int GetXCoordinate() { return (int) Math.floor(mc.thePlayer.posX); } But when i try to use that i get errors. With imports of import net.minecraft.client.Minecraft; import net.minecraft.util.BlockPos; The error says "mc cannot be resolved to a variable". Quote Link to comment Share on other sites More sharing options...
larsgerrits Posted May 10, 2015 Share Posted May 10, 2015 You do know Java, right? From the code you got from somebody (bad person, don't give code without explanation), you clearly don't know Java. If you do know it, you can solve the error yourself. Quote Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/ Link to comment Share on other sites More sharing options...
JoelGodOfWar Posted May 10, 2015 Author Share Posted May 10, 2015 Well i'm not as familur with Java as i am with vb, html, or javascript. I think i've solved this part. Here's the code i have now, that has no errors. import net.minecraft.client.Minecraft; protected static Minecraft mc = Minecraft.getMinecraft(); public static int GetXCoordinate() { return (int) Math.floor(mc.thePlayer.posX); } public static int GetYCoordinate() { return (int) Math.floor(mc.thePlayer.posY); } public static int GetZCoordinate() { return (int) Math.floor(mc.thePlayer.posZ); } Now to figure out how to show that on the game screen. Thank you for your replies. Quote Link to comment Share on other sites More sharing options...
larsgerrits Posted May 10, 2015 Share Posted May 10, 2015 You can draw to ingame GUI using the RenderGameOverlayEvent. Quote Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.