how do I place a door per code?

Discussion in 'Plugin Development' started by lgplay, Jun 8, 2017.

Thread Status:
Not open for further replies.
  1. Always when I place a door the door disapears
     
  2. Offline

    Zombie_Striker

    @lgplay
    Can you post your code? Are there any errors?

    Try adding a second door block ontop of the first door block; Minecraft/bukkit may remove glitched doors.
     
  3. Code:
                Location l = e.getPlayer().getLocation();
    
            l.getBlock().setType(Material.WOODEN_DOOR);
            l.add(0, 1, 0);
            l.getBlock().setType(Material.WOODEN_DOOR);
    @Zombie_Striker than this happens
    http://imgur.com/a/LtpuO
     
    Last edited: Jun 8, 2017
  4. I don't know need help pls
     
  5. Offline

    Zombie_Striker

    @lgplay
    1. onCommand
    2. If the command send is equal to your command.
    3. get the player's location and set the block type to be equal to one of the many doors.
    4. After that, add +1 to the Y and set the block's type to be equal to the same door as below.
    5. After doing that, you need to get the doors MaterialData, cast it to a Door, and then set it to the TopHalf. This will make the door look normal, instead of two bottom halfs.
     
  6. Online

    timtower Administrator Administrator Moderator

    Merged threads.
     
Thread Status:
Not open for further replies.

Share This Page