Digital Clock and locks

Discussion in 'Archived: Plugin Requests' started by Link223, Mar 6, 2014.

  1. Offline


    General Idea:
    This plugin would be a bit complex but ill try to explain this as best as I can.
    All right, so first ill explain the basics of my idea. There would be a scoreboard that all players can see. (given a perm like time.scoreboard) The scoreboard would need to keep track of Minecraft time. Along with keeping track of time, there would be a way to lock things such as doors for a certain amount of time. This would be cool to have on a RPG server where you could lock doors on shops at night and have the doors be accessible during the day. There would also need to be a configurable message when a player tries to open a door, furnace, chest etc that is locked.

    /timelock <time> to <time>
    Example: /timelock 11:00pm to 5:00am
    This means that the door, chest, furnace etc. will not be accessible from 11:00pm to 5:00am Minecraft time.
    /timelock message <message>
    Example: /timelock message Sorry this shop is closed, come back later.
    The message would appear when a player tries to open a door, furnace, chest etc. when it is locked/closed. The message would not show up when it it accessible. The & symbol colors would work for the messages as well.
    Example: /timelock message &1This chest is locked. &2Open at 7:00am.

    After executing either of these commands you would left lick and or right click the door, furnace, chest etc.

    - To avoid confusion in chat, the message should have some sort of indicator like:
    [Timelock] <the message you put>
    It would be strange to just have a random message in chat with nothing to show what it is "saying".
    If you don't understand just comment below.

    Possible scoreboard layout:
    - hour:minute -

    Here's a link to the Minecraft time mechanics: and yes if you read the information on this link you know that the minutes would change every .87 seconds. lol
    time.scoreboard - Gives players a score board with a digital clock that keeps track of minecraft time.
    time.lock - Allows players to use /timelock <time> to <time>
    time.msg - Allows players to use /timelock message <message>
    Ops would not need the permissions.
  2. Offline


    Is there anyone that is going to reply? :(
  3. Offline


    Got to wait like everyone else does. Just be patient and someone might take their time to make this for you. ;)
    Good luck!
  4. Offline


    There is a problem with trying to display a formatted time in a scoreboard. Scoreboards only accept a number when updating the score, so you can't display the time as 4:53am, the best you would be able to do is show something like: 453 - and for time > than noon something like 2105 (5 past 9pm), perhaps also the world name could be displayed instead of the 'h:m' as time is world specific.


    The other issue that will affect this plugin is that because the time is being updated constantly, other scoreboards that use the sidebar display slot don't get a look in... To this end I have added a /clock command to toggle the clock on and off


    If the block is time locked, is it locked for all players, or all players except the player who locked it?

    EDIT: never mind I made it configurable$LockClock/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 7, 2016
  5. Offline


    I like it, although as an op I get an error for /clock. Most regular players with the permission can use /lock, others get the internal server error as well. I also cant get the /lock command to lock things. It says that it was successfully locked but regular players can still access it during the times they're not suppose to. But overall I really thank you for creating it! :D
  6. Offline

    timtower Moderator Moderator

  7. Offline


    "An internal error occurred while attempting to perform this command."
  8. Offline


    That's not an "Error log" timtower means from your console.
    timtower likes this.
  9. Offline


    02.04 19:38:04 [Server] INFO at me.eccentric_nz.lockclock.LockClockCommand.onCommand( ~[?:?]
    02.04 19:38:04 [Server] INFO at me.eccentric_nz.lockclock.LockClockScoreboard.getScoreboard( ~[?:?]
    02.04 19:38:04 [Server] INFO at java.lang.String.substring(Unknown Source) ~[?:1.7.0_45]
    02.04 19:38:04 [Server] INFO Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 10
    Is this is?
  10. Offline

    timtower Moderator Moderator

    That is it
  11. Offline


    Ah yes, thank you.
  12. Offline


    Actually you can do that even in Vanilla minecraft with ligth sensors and redstone overall. I am just not sure if you can do the scoreboard thingy in vanilla/with command blocks.
    Only for the case that you want to know, obviously :)
  13. Offline


    Link223 Only just seen the you have some problems, do you have a console error for when players are getting an error for /lock

    Have fixed the /clock error - new file available on the jenkins server

    In future can you use the dev bukkit page to post comments thanks

    New file uploaded to the plugin page on devbukkit
    * fixes java.lang.StringIndexOutOfBoundsException when player name was shorter than 11 characters
    * adds UUID support

Share This Page