Jump to content

[1.18]How do I find player position on a server?


lordurel

Recommended Posts

I have no experience with modding at all and limited with Java but all I need to do is get the coordinates of my player and export them to a text file. I can't find a guide online and I can't find anything in Forge documentation. I've tried this:

PlayerEntity player = Minecraft.getInstance().player;

player.getX();

player.getY();

using this import net.minecraft.client.player; but I've edited both the import and the actual 'code' by using different commands like getPosition() and also importing net.minecraft.entity.player.PlayerEntity and EntityPlayer and also net.minecraft.world.entity.player but everything gives a 'cannot find symbol class' error, 'symbol variable' for Minecraft.getInstance() or it says the package doesn't exist for the import

Thanks in advance hopefully

Link to comment
Share on other sites

21 hours ago, lordurel said:

I have no experience with modding at all and limited with Java but all I need to do is get the coordinates of my player and export them to a text file.

What are you attempting to do with this?

21 hours ago, lordurel said:

using this import net.minecraft.client.player; but I've edited both the import and the actual 'code' by using different commands like getPosition() and also importing net.minecraft.entity.player.PlayerEntity and EntityPlayer and also net.minecraft.world.entity.player but everything gives a 'cannot find symbol class' error, 'symbol variable' for Minecraft.getInstance() or it says the package doesn't exist for the import

What guide are you trying to use for this?

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.