Get the other block from a double chest

Hello guys,

Let’s say I have the Location<World> location of a chest confirmed by a location.getBlockType().equals(BlockTypes.CHEST).

How can I know if it is a double chest, and if so, how can I get the location of the other chest block that makes it a double chest ? I guess I could check in the four directions if there’s another BlockTypes.CHEST but isn’t there another “recommended” way ?

You would use Keys.CONNECTED_DIRECTIONS to determine what directions the block is connected in, and then open the block in those relative directions as well.

1 Like

Thank you very much !

no prob. Doing it like this also ensures modded blocks are compatible with the same code.