Posted April 16, 20169 yr well I'm trying to create and item that gets the players coordinates when right clicked at first and then teleport then to those cords whenever right clicked after that here is my code. public void func_meta(ItemStack itemstack, int a) { itemstack.setItemDamage(a); } public static int func_return(int a) { return a; } public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player, int x, int y, int z) { int i1 = itemstack.getItemDamage(); int j1 = func_return(i1); if(j1 == 0){ itemstack.setItemDamage(1); player.getPlayerCoordinates().posX = x; player.getPlayerCoordinates().posY = y; player.getPlayerCoordinates().posZ = z; return itemstack; } if(j1 == 1){ if (player.capabilities.isCreativeMode) { return itemstack; } else { // --itemstack.stackSize; if (!world.isRemote) { player.setPosition(x, y, z); return itemstack; } return itemstack; }
April 16, 20169 yr When you post code use the [.code] and [./code] modifiers without the periods and if it's a longer piece of code use a spoiler around that or pastebin.com. Then it will appear as such: //---------------------- // Coding!!! //---------------------- Just a suggestion not meaning any offense.
April 16, 20169 yr This does not get the player's coordinates. This moves the player to a location (x,y,z) player.getPlayerCoordinates().posX = x; player.getPlayerCoordinates().posY = y; player.getPlayerCoordinates().posZ = z; This also moves the player player.setPosition(x, y, z); Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
April 17, 20169 yr When you post code use the [.code] and [./code] modifiers without the https://skinnyexpress.com/phenq-review phenq periods and if it's a longer piece of code use a spoiler around that or pastebin.com. Then it will appear as such: //---------------------- // Coding!!! //---------------------- Just a suggestion not meaning any offense. Have you figured out how to do this NEG2013? I want to be able to easily teleport to players locations too on my server.
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.