Check out example codes for "get block player is looking at bukkit". It will help you in understanding the concepts better.

Code Example 1

Player player = (Player) sender;
Block block = player.getTargetBlock(null, 100);
Location bl = block.getLocation();

Learn ReactJs, React Native from akashmittal.com