@SubscribeEvent public void onRightClick(PlayerInteractEvent.RightClickBlock e) { if (!e.getWorld().isRemote) { BlockPos pos = e.getPos(); IBlockState state = e.getWorld().getBlockState(pos); if (state.getBlock() instanceof BlockCrops) { BlockCrops block = (BlockCrops) state.getBlock(); if ((block == Blocks.wheat || block == Blocks.carrots || block == Blocks.potatoes) && state.getValue(BlockCrops.AGE) == 7) { performAction(e.getWorld(), e.getPos(), state, BlockCrops.AGE); } else if (block == Blocks.beetroots && state.getValue(BlockBeetroot.BEETROOT_AGE) == 3) { performAction(e.getWorld(), e.getPos(), state, BlockBeetroot.BEETROOT_AGE); } } } }