Created
May 26, 2019 08:38
-
-
Save theresajayne/d4481ab6d387fcb0c8c5fa1d6d1365fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Block getTargetBlock(Player player, int range) { | |
Location loc = player.getEyeLocation(); | |
Vector dir = loc.getDirection().normalize(); | |
Block b = null; | |
for (int i = 0; i <= range; i++) { | |
b = loc.add(dir).getBlock(); | |
} | |
return b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment