Auto Door Closer (and opener) [1.12.x, 1.13.2]
1.0.12Automatically close doors, gates, and trap doors
Simple plugin to automatically close doors, gates, and trap doors after a configurable number of seconds.
It's annoying on a server when you have, say, a town all set up, and you have wooden doors, trap doors, maybe gates around livestock, etc. and folks leave them open. You could simply use something like WorldGuard to disallow interaction, but what if you want to let players use the doors, and just enforce some closing?
That's what this plugin does. Whenever a player opens a door/gate/trap door that meets the criteria in the config file, it queues up a task to close the door in X seconds, where X is specified in the config file.
There's one additional feature here, that is a bit out of scope, but useful anyway. This plugin will also (optionally) synchronize the door opening/closing of double doors. Double doors are defined as doors that are right next to each other and have their hinges on opposite sides.
Written for Spigot 1.12 and Java 1.8. Latest version supports 1.13.1
Written on Windows 10, tested on Ubuntu
If you are using 1.12, you MUST use the 1.03 version of this plugin. The latest version works only with 1.13.x (ideally 1.13.2) due to the significant API changes.
Configuration file 1.13.2:
This works only with the latest version of the plugin. The changes were not backported to the 1.12.x-supporting version.
This file adds in the new 1.13 types, and also an option to play the correct sound when the door/gate/trap door is closed. Default close time also set to 10 seconds rather than 20.
If you are upgrading from an old version, you must manually add the entries below (and remove the old types), or delete your config and let the plugin regenerate it either on load or when you execute /dcreload
# Config file for DoorCloser
# Time (in integer seconds) to allow the door to remain open
# This is an estimate. How long it really stays open depends
# on how quickly Spigot can get to the event handler. It won't
# be faster than this, but will typically be slower, again,
# depending upon server load, number of plugins running, etc.
Time: 10
# double-door handling. This is a bit outside the original scope
# of this plugin, but was a community request. It's optional here
# because you may already have plugins handling this, and so the
# behavior might be weird.
#
# SynchronizeDoubleDoorOpen: automatically open the second door
# when you click on one of the doors in a pair. Detection algorithm
# checks for where the hinges are located.
SynchronizeDoubleDoorOpen: true
SynchronizeDoubleDoorClose: true
# True if the door/gate/trapdoor closing sound should be played
PlaySound: true
# true if you want to ignore the door when the player is in creative mode
# if this is not set to true, you'll never be able to create an open door
# unless you turn on sneaking.
IgnoreIfInCreative: true
# true if you want to ignore the door when the player is sneaking
# note that this will work for all players, not just someone in creative
IgnoreIfSneaking: false
# List of Block IDs for blocks (trap doors, gates, and doors) that you want to auto-close
# Case is not important, but use the official block names as found here:
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
TrapDoorBlocks:
- acacia_trapdoor
- birch_trapdoor
- dark_oak_trapdoor
- jungle_trapdoor
- oak_trapdoor
- spruce_trapdoor
GateBlocks:
- oak_fence_gate
- spruce_fence_gate
- birch_fence_gate
- jungle_fence_gate
- dark_oak_fence_gate
- acacia_fence_gate
DoorBlocks:
- oak_door
- spruce_door
- birch_door
- jungle_door
- acacia_door
- dark_oak_door
Configuration file 1.12.x:
Config file lets you specify the block types that are in scope, as well as whether or not to auto-close if sneaking or in creative mode.
Config file is pretty simple. I don't do a lot of error checking, though, so don't, for example, put gate blocks in the trap door or door sections. Behavior there is untested and undefined.
# Config file for DoorCloser
# Time (in integer seconds) to allow the door to remain open
Time: 20
# true if you want to ignore the door opening when the player is in creative mode
IgnoreIfInCreative: true
# true if you want to ignore the door opening when the player is sneaking
IgnoreIfSneaking: false
# List of Block IDs for blocks (trap doors, gates, and doors) that you want to auto-close
# Case is not important, but use the official block names as found here:
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
TrapDoorBlocks:
- trap_door
GateBlocks:
- fence_gate
- spruce_fence_gate
- birch_fence_gate
- jungle_fence_gate
- dark_oak_fence_gate
- acacia_fence_gate
DoorBlocks:
- wooden_door
- spruce_door
- birch_door
- jungle_door
- acacia_door
- dark_oak_door
1.12.x plugin:
https://github.com/Psychlist1972/Mi...b/master/target/DoorCloser-1.0.3.jar?raw=true
Latest config is always in the source tree:
https://github.com/Psychlist1972/Minecraft-DoorCloser/blob/master/src/main/resources/config.yml
Added commands:
/dcreload : reload the configuration file and re-read settings
requires tenrem.doorcloser.reload permission
I wrote this because the DoorClose plugin by another author was apparently abandoned and wouldn't work with recent Spigot versions.
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta
