As another note, the result from the (new) ``getTargetBlock()`` method will always be non-null; a BlockTargetResult object.  To see if the player actually has something targeted, check if either ``getTargetedFace()`` or ``getTargetedLocation()`` return a non-null value.  

The ``getBlock()`` method returns the block being looked at; in the case of the player looking into thin air, for example, it will be the block that is ``maxDistance`` blocks along the line of sight (and in that case, both ``getTargetedFace()`` or ``getTargetedLocation()`` will return null).