jobukkit
jobukkit

Reputation: 2670

How to get the block in front of a block face?

I have a BlockFace object and I need to get the block in front of it. How can I do this?

What I mean is that if for example, I have a planks block with a wool block next to it on the west side, and I have the BlockFace object of the west side of the planks block, I get the wool block from it.

Upvotes: 0

Views: 1633

Answers (1)

jobukkit
jobukkit

Reputation: 2670

Found it:

block.getRelative(blockface);

Upvotes: 2

Related Questions