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;
}