MyNameIsSilver Posted October 3, 2014 Share Posted October 3, 2014 I was wondering if anyone knew how to make the OnRightClick method work on the block that the crosshair is pointing to, Quote Link to comment Share on other sites More sharing options...
Jwosty Posted October 3, 2014 Share Posted October 3, 2014 If you intend to do something whenever a player right-clicks a block, use PlayerInteractEvent. Quote I like to make mods, just like you. Here's one worth checking out Link to comment Share on other sites More sharing options...
hpisti Posted October 4, 2014 Share Posted October 4, 2014 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); ... } Quote Link to comment Share on other sites More sharing options...
MultiMote Posted October 4, 2014 Share Posted October 4, 2014 @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; } =_= Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.