Discussion in 'Spigot Plugin Development' started by Preodym, Apr 27, 2017.

  1. Hey,

    how can i get the Block behind a Ladder?

    "Ladder l = (Ladder) w.getBlockAt(x, y, z).getState();" does not work...

    who can help me?
    • Like Like x 1
  2. You don't want the ladder but the block it is resting on, correct?
    • Like Like x 1
  3. I have found this:
    Ladder ladder = (Ladder)world.getBlockAt(x, y, z).getState().getData();
    • Funny Funny x 1
  4. Would be similar to this:

    Code (Text):

    Block oppositeBlock = ladderBlock.getRelative(ladderBlock.getFace(ladderBlock).getOppositeFace());
    • Agree Agree x 1
  5. To be correct, this is how you do it

    Code (Text):

    Ladder ladder = (Ladder) ladderBlock.getState().getData();
    Block oppositeBlock = ladderBlock.getRelative(ladder.getFacing().getOppositeFace());