@Mod.EventBusSubscriber(modid = main.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
public class ModClientEvents {
@SubscribeEvent
public static void onJumpNearStone(LivingEvent.LivingJumpEvent event) {
LivingEntity player = event.getEntityLiving();
World world = player.getEntityWorld();
BlockPos pos = player.func_233580_cy_();
if (world.getBlockState(pos.add(1, 0, 0)).getBlock() == Blocks.STONE) {
main.LOGGER.info(pos.add(1, 0, 0));
} else if (world.getBlockState(pos.add(-1, 0, 0)).getBlock() == Blocks.STONE) {
main.LOGGER.info(pos.add(-1, 0, 0));
} else if (world.getBlockState(pos.add(0, 0, 1)).getBlock() == Blocks.STONE) {
main.LOGGER.info(pos.add(0, 0, 1));
} else if (world.getBlockState(pos.add(0, 0, -1)).getBlock() == Blocks.STONE) {
main.LOGGER.info(pos.add(0, 0, -1));
}
}
}
It's probably very inefficient, but it works (mostly). My only problem is I must've messed up some code with the player, so instead of tracking only the player, it tracks every entity. I noticed this when I kept getting random messages when I wasn't jumping, but turning off mob spawning fixed the issue. Help?