Skip to content

Instantly share code, notes, and snippets.

@Flamedek
Created August 28, 2014 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Flamedek/c049a89eaf032f40e38f to your computer and use it in GitHub Desktop.
Save Flamedek/c049a89eaf032f40e38f to your computer and use it in GitHub Desktop.
public Block targetBlock(Player p) {
Location pos1 = p.getEyeLocation();
BlockIterator bit = new BlockIterator(pos1, 0D);
Block next = null;
while(bit.hasNext()) {
next = bit.next();
if(!next.isEmpty()) {
break;
} }
return next;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment