Solved Set block direction

Discussion in 'Plugin Development' started by The_Spaceman, Aug 9, 2018.

Thread Status:
Not open for further replies.
  1. Offline


    I want to know how to set the block facing. like how to rotate stairs and such...
    Since the damage value has been removed I dont know how to do this.


    This works

    Block block = player.getLocation().getBlock();
    BlockData blockData = block.getBlockData();
    if (blockData instanceof Directional) {
      ((Directional) blockData).setFacing(BlockFace.WEST);
    Last edited: Aug 15, 2018
  2. @The_Spaceman

    if(block instanceof Directional)
    ((Directional) b).setFacingDirection(BlockFace.EAST);
    that should work i think
  3. Offline


    That doesn't work. You can't cast Block to Directional.

    In the class Directional there is no .setFacingDirection, only .setFacing()

    and block.getBlockData() is not castable to Directional.
Thread Status:
Not open for further replies.

Share This Page