Jump to content

Need help teleporting player with a command and saving data to the player


endershadow

Recommended Posts

For the mod I'm making, I need to save the players dimension and coordinates when they do a certain thing. I then want to be able to get that data when the player types in a command so that they can teleport to that location. I thing I need to do something with IAdditionalEntityData or something but I'm not sure. please help. Oh! and I also have the command set up already. I just don't know how to make it teleport the player. https://github.com/code-lyoko-modding/CodeLyokoMod/blob/master/matt/lyoko/handlers/CommandHandler.java

Link to comment
Share on other sites

... why did I not think of that. On to the second problem, how do I save the location of the player at a certain point in time and then retrieve it later on? if needed, I can save it to a file and then read it from there, but I'd prefer to save it to NBT data.

Link to comment
Share on other sites

I don't know how to use IAdditionalEntityData... but teleporting a player is player.setLocationAndAngles(x,y,z,yaw,pitch). I use 90 and 0 for the last two arguments; that works well enough.

Instead of just using 90 and 0, you can use the actual yaw and pitch.

player.setLocationAndAngles(x, y, z, player.rotationYaw, player.rotationPitch);

Read my thoughts on my summer mod work and tell me what you think!

http://www.minecraftforge.net/forum/index.php/topic,8396.0.html

 

I absolutely love her when she smiles

Link to comment
Share on other sites

I don't know how to use IAdditionalEntityData... but teleporting a player is player.setLocationAndAngles(x,y,z,yaw,pitch). I use 90 and 0 for the last two arguments; that works well enough.

Instead of just using 90 and 0, you can use the actual yaw and pitch.

player.setLocationAndAngles(x, y, z, player.rotationYaw, player.rotationPitch);

Good point, not that I'm sure it matters. :P

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

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.

Announcements



×
×
  • Create New...

Important Information

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