LockClock
Displays Minecraft time in a scoreboard and allows players to lock blocks for a set amount of time. This can be useful for example, on an RPG server where you can lock doors on shops at night and have the doors be accessible during the day.
Created in response to this plugin-request: Digital clock and locks
The scoreboard clock
The scoreboard clock is displayed in the sidebar and shows Minecraft time in a quasi-military format, i.e. 24-hour time (without leading zeroes). The clock can been hidden/shown with a command (see Commands below).
Players with the permission lockclock.clock
get the clock automatically at login.
Commands
There are four in-game commands:
Player Command | Description | Usage | Alias(es) |
---|---|---|---|
lock [from_time] [to_time] |
Lock a door, chest, furnace etc for a specified time. | lock 10:30pm 6:00am or in server ticks lock 16500 0 , then click a block |
timelock, lockclock, lockblock |
lockmsg [message] |
Add a message to a time locked block. | lockmsg No! Go away. , then click locked block |
lockmessage, timemessage, timemsg |
unlock |
Remove a time lock from a block. | unlock , then click locked block |
- |
clock |
Toggles the clock scoreboard on and off. | clock |
- |
Two commands are also available to use from the console:
Console Command | Description |
---|---|
lock |
Toggle the lock_for_owner config option between true and false . |
lockmsg [message] |
Set the default_message in the config. |
Permissions
lockclock.lock
- Allow players to add/remove time locks.
lockclock.message
- Allow players to add time lock messages.
lockclock.clock
- Allow players to have a clock scoreboard.
Configuration
The default configuration is shown below:
lockables: - CHEST - TRAPPED_CHEST - ENDER_CHEST - ANVIL - BEACON - BREWING_STAND - DISPENSER - DROPPER - ENCHANTMENT_TABLE - FURNACE - HOPPER - IRON_DOOR_BLOCK - TRAP_DOOR - WOODEN_DOOR plugin_name: LockClock default_message: '&9This %s is locked. &2It will open at %s.' lock_for_owner: false
lockables
The lockables list allows you to configure which blocks can be locked in-game. Only blocks appearing here will be lockable. Check https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/Material.java for valid lockable names.
plugin_name
You can change the string that appears before the plugin's in-game messages. It defaults to the plugin name, but you could for example, change it to TimeLock
.
default_message
This is the message that is used, if a custom message is NOT specified for the locked block. In-game the message looks like:
[LockClock] This CHEST is locked. It will open at 2130.
It supports colour codes in the form of &1
etc. It has two place holders (%s
) that are formatted when the message is sent:
- the first will receive the locked block type e.g. CHEST
- the second will receive the time the block will be unlocked
lock_for_owner
This setting determines whether the time lock applies to all players (true
) or all players except the lock owner (false
).
Source code
https://github.com/eccentricdevotion/LockClock
Dev builds
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
@Sonic5317
Added a command to turn off the warning message for a door, so if you have double doors, you can turn it off for one of them:
/warn_toggle
, then click the doorBuild #8 or higher on the Jenkins server
@eccentricnz
I didn't expect this so soon! Thank you!
One small issue im having, the shop has double doors so I have to set each door which works okay but will also send two warning messages :(
Could support for double doors be added or perhaps the ability to set different warning per door? (Disable the other message?)
Thanks again for these updates! :)
@Sonic5317
New Jenkins build available, new config options for warnings, open doors should close automatically, also fixed a bug with setting times that contained minutes e.g. 12:30pm and added a console only command to convert hh:mm to ticks;
lock convert [hh:mm<am|pm>]
If
warn.time
is set to0
, then warnings will be turned off@eccentricnz
Yeah a warning message is probably the best way and I like the idea of configurable timer :) Looking forward to these features!
@Sonic5317
Hope the All day or all of the night plugin works okay for you, I've never tested both plugins together, but so long as the lock times are within the restricted world times it should be OK.
Not really possible to teleport players, as LockClock has no idea where the shop region is located, therefore can't accurately determine which players are actually inside... could maybe add messaging to nearby players saying "the store is closing soon" and "not to get locked inside" a few (configurable) seconds before the door locks.
@eccentricnz
Hey again, Thanks for the suggestion, your plugin does look like a very good alternative! so I have ditched the Timelock plugin.
Thanks also for looking into closing doors only thought that comes to mind then is players getting trapped inside a shop, was perhaps thinking if it was possible to teleport them out somehow.
@Sonic5317
TimeLock resets the time back to 6000 ticks e.g. morning (if always day) every 5 seconds. IMHO its not a very good way of keeping it day... You could try using All day or all of the night instead, as that lets the time run normally between two set points, instead of resetting it all the time.
Will look into closing doors when I get time.
@eccentricnz
Thanks got hold of your latest build and the error spam is gone although I do have some issues that maybe you could look into?
- Using the TimeLock plugin seems to bypass locks that are set even after time gets unlocked, using the normal /time set command puts it right again could this be fixed somehow? http://dev.bukkit.org/bukkit-plugins/timelock/
- Open doors, if a player leaves a door open and the lock time passes the door locks in a open state, is there anyway to get the doors to close after the time passes?
@Sonic5317
Sorry, haven't updated this page for 2 years and 1 day!, the URL has changed:
http://tardisjenkins.duckdns.org:8080/job/LockClock/lastSuccessfulBuild/me.eccentric_nz.lockclock$LockClock/
Editing page link now :)
@eccentricnz
Cant seem to access your link at keetley.servegame.com?
@Sonic5317
New Jenkins build available, use link above.
@Sonic5317
You can add new doors in the config, check https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/Material.java for the lockable names.
Locks will not be active for the player who locked them, unless
lock_for_owner
istrue
in the config.Would be helpful to know what the console errors are, otherwise how am I supposed to know how to fix them (no errors are occurring in my console when running the plugin...)
Really wish this got an update, currently spams the console with errors and the locks dont seem to work, also with lack of newer doors :(