Posted October 3, 201410 yr I was wondering if anyone knew how to make the OnRightClick method work on the block that the crosshair is pointing to,
October 3, 201410 yr If you intend to do something whenever a player right-clicks a block, use PlayerInteractEvent. I like to make mods, just like you. Here's one worth checking out
October 4, 201410 yr You can get the reference of the block as follows: MovingObjectPosition pos = mc.renderViewEntity.rayTrace(200, 1.0F); if(pos != null) { Block block = Minecraft.getMinecraft().thePlayer.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ); ... }
October 4, 201410 yr @Override public boolean onItemUse(ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { return true; } =_=
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.