public class ModBlock extends Block {
@Override
public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
return super.onBlockActivated(state, worldIn, pos, player, handIn, hit);
//return state.onBlockActivated(worldIn, player, handIn, hit);
//return this.getBlock().getDefaultState().onBlockActivated(worldIn, player, handIn, hit);
}
}
Here is the onBlockActivated method in my own block class. The two commented lines are the ones I tried, but they resulted in a crash; java.lang.StackOverflowError: null. I guess it's because the BlockState parameter hasn't been instantiated yet? I just don't know how to access the BlockState method.