Posted April 28, 201411 yr I am trying to make a sword that teleports you to a close by but random location like the enderman if you hold the block position It is called in the onEaten method: @Override public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { par3EntityPlayer.setPosition(par3EntityPlayer.posX , par3EntityPlayer.posY , par3EntityPlayer.posZ); return super.onEaten(par1ItemStack, par2World, par3EntityPlayer); } Creator Of Weapons+ Mod & Sword Art Online HUD Mod
April 28, 201411 yr You could use that code or... player.setPositionAndUpdate(//fields) You can get a random value (Random.class), and place it in the fields for teleportation like an enderman.
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.