Change block direction

Discussion in 'Spigot Plugin Development' started by ultracakebakery, Apr 30, 2017.

  1. Hey everyone.
    i'm working on a plugin that allows players to spawn custom building presets.

    Some buildings contain ladders, but how do i set the direction the ladder is facing?
    Code (Text):

    .getLocation().subtract(1, 1, 1).getBlock().setType(Material.LADDER);
     
    This is how i place the blocks but how do i set the direction?
     
    • Agree Agree x 1
  2. Either set the data (look at the values on the wiki), or use one of the direction enums (depending on if you use Bukkit, NMS, or WE to set the blocks)