Posted July 12, 201510 yr Hello, I made an item which shows your coordinates on right-click. The problem is upon rightclick it shows 2 messages. Like this: X: 555 Y: 65 Z: 555 X: 555 Y: 67 Z: 555 No matter where I rightclick it shows 2 messages and the second one adds 2 to the Y coordinate. My code is: public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player){ player.addChatComponentMessage(new ChatComponentText("X: " + player.getPlayerCoordinates().posX + " Y: " + player.getPlayerCoordinates().posY + " Z: " + player.getPlayerCoordinates().posZ)); return item; }
July 12, 201510 yr onItemRightClick gets called two times, on server and on client side. I guess you want it to be only shown on client side, so use the world object to find out on which side you are
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.