Hey plugins developers! For a while i have been thinking how cool a time locking door would be. For example the doors stay open in day and lock at night. Maybe you could set the times it locks and unlocks with a command?
this is very interesting! hmm ill take a look into how doors open/close * method wise * EDIT: sure ill attempt this. i wasnt able to get this to work. if i was you, maybe try and ask Hidendra for this. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
It looks like you can set doors to open or closed using setOpen(true) / setOpen(false) Code: onPlayerInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); Block block; long time = player.getWorld().getTime(); if (event.getAction() == Action.RIGHT_CLICK_BLOCK) { time = player.getWorld().getTime(); if (time > 38000 && time < 46500) { //Is night. block = event.getBlock(); //Might not be correct way to get the block. if (block.getType() == Material.DOOR) { Door door = (Block) block; if (door.isOpen) { door.setOpen(false); } else { //Door already closed } } } }
Thanks For Trying Mate Iron doors would probably work the best! Thanks For Trying Guys! EDIT by Moderator: merged posts, please use the edit button instead of double posting.