[Discontinued] 🗓 Calendar + Time controller [v3.2] [FR/EN]

Calendar

Calendar is a plugin that allow you to create a time structure to each of your worlds. Create months and days in a week for each world and control the day cycle of each one.

Commands

/calendar - Display the time of the world you are in.
/cld - Display the time of the world you are in.
/calendar setTime [tick] - Set the time of the world without resetting the calendar.
/calendar file calendar setFormat [format] - Set the format of the file. JSON, HOCON or YAML

How it works

Each world has its own time structure. That means, you can control the year, the number of month in a year, the number of week in each month, the days in a week and the day/night cycle. The day cycle is in tick, a normal minecraft day is 24000 ticks.
To see the time on each world, you can format the time value. You can format how the time is displayed and the style of the text.

Formats

  • Time
  • %yy: Get the year in this format. 01, 02, 03, … 10, 11, 12 … 100, 101, 102
  • %MM: Get the month in this format. 01, 02, 03, … 10, 11, 12
  • %WW: Get the week in this format. 01, 02, 03, … 10, 11, 12
  • %dd: Get the day in month in this format. 01, 02, 03, … 10, 11, 12
  • %HH: Get the hour in this format. 01, 02, 03, … 10, 11, 12
  • %mm: Get the minute in this format. 01, 02, 03, … 10, 11, 12
  • %ss: Get the second in this format. 01, 02, 03, … 10, 11, 12
  • %y: Get the year in this format. 1, 2, 3, … 10, 11, 12
  • %M: Get the month in this format. 1, 2, 3, … 10, 11, 12
  • %G: Get the name of the month.
  • %W: Get the week in this format. 1, 2, 3, … 10, 11, 12
  • %E: Get the name of the day.
  • %d: Get the day in month in this format. 1, 2, 3, … 10, 11, 12
  • %H: Get the hour in this format. 1, 2, 3, … 10, 11, 12
  • %m: Get the minute in this format. 1, 2, 3, … 10, 11, 12
  • %s: Get the second in this format. 1, 2, 3, … 10, 11, 12
  • Color and text style
  • Go on this website to get the codes.

Events

The events are important with Calendar, because you can display time automatically with them. To handle an event, you have to set the format of the time in the formats like below.

  • Events:
  • time: When the player do /cld or /calendar. If not defined in the config, there is a default value.
  • second: When the second change.
  • minute: When the minute change.
  • hour: When the hour change.
  • day: When the day change.
  • week: When the week change.
  • month: When the month change.
  • year: When the year change.

This is an example in the config file.

{
    "formats": {
        "time": "&a[Calendar] &c%yy/%MM/%dd %HH:%mm &a- &c%d %G %y", 
        "minute": "&a[Calendar] New minute! &c%yy/%MM/%dd %HH:%mm", 
        "hour": "&a[Calendar] New hour! &c%yy/%MM/%dd %HH:%mm", 
        "day": "&a[Calendar] New day! &c%yy/%MM/%dd %HH:%mm",  
        "week": "&a[Calendar] New week! &c%yy/%MM/%dd %HH:%mm", 
        "month": "&a[Calendar] New month! &c%yy/%MM/%dd %HH:%mm", 
        "year": "&a[Calendar] New year! &c%yy/%MM/%dd %HH:%mm"
    },
    "worlds": {
        "world" <--(World name): {
            "dayCycle": 2400,  <--(day cycle 10x faster than normal minecraft day)
            "nightCycle": 1200,<--(night cycle 2x faster than day cycle)
            "startYear": -200, <--(If the world time is 0, the year will be this one)
            "days": [          <--(days in a week)
                "Monday",      <--(name of the first day)
                "Wednesday",
                "Friday",
                "Sunday"
            ],
            "months": [       <--(months in a year)
                {
                    "weeks": 2,        <--(number of week in this month)
                    "name": "December" <--(name of the month)
                },
                {
                    "weeks": 1,
                    "name": "June"
                }
            ]
        }
    }
}

Config example

This config set a calendar for the worlds named world and nether and with three formats: when commands are called, when hour change and when the day change.

{
    "formats": {
        "time": "&f[&6Calendar&f] &c%yy/%MM/%dd %HH:%mm:%ss &a- &c%d %G %y",
        "hour": "&f[&6Calendar&f] &c%yy/%MM/%dd %HH:%mm:%ss &a- &c%d %G %y"
    },
    "worlds": {
        "world": {
            "dayCycle": 800, 
            "nightCycle": 400, 
            "startYear": -200,
            "days": [ 
                "Monday",
                "Wednesday",
                "Friday",
                "Sunday"
            ],
            "months": [ 
                {
                    "weeks": 2,
                    "name": "June"
                },
                {
                    "weeks": 1,
                    "name": "September"
                },
                {
                    "weeks": 2,  
                    "name": "December" 
                },
                {
                    "weeks": 1,
                    "name": "March"
                }
            ]
        },
        "nether": {
            "dayCycle": 600, 
            "nightCycle": 200, 
            "startYear": 0,
            "days": [
                "Friday"
            ],
            "months": [ 
                {
                    "weeks": 1,  
                    "name": "October" 
                }
            ]
        }
    }
}

Links

5 Likes

Oh man, this is going to be so great for RP servers with custom date systems. Thanks for building this!

1 Like

Really great your plugins. For RP servers it’s really awsome. Is it possible to have an extra part that would control the climate while following the calendar? It could be the top!

It’s a very funny plugin, thank’s!

1 Like

I greatly enjoy using JSON text in my server, could you add a way to allow use of the JSON serializer instead of the formatting code serializer? Or maybe loading the Text object directly from the config?

You want to use the JSON format of Mojang {"text":[{"color":"green","text":"hello"},{"color":"red","text":"world"}]}? I could check to add this possibility.

Yes.
Also, looking over your code, why do you use manual methods instead of Configurate’s JSONConfigurationLoader? For that matter, why JSON and not HOCON? Configurate makes everything easier, and if you did that, you could also just save and load Text objects directly from the config.

I know I could use the JSONConfigurationLoader of Sponge, but I prefer this JSON library. Let me a week, I’m currently working on another project and I will add the possibility to format texts with JSON.

lol that’s not a library that’s the website describing what JSON is.
a large list of libraries, configurate not included, are then listed below that page.

Sorry, but before there was a direct link to the java library I’m using. This is the library.

This is really cool, works well, adds a fun element of rp to the server. However it seems to break beds changing night to day and time change commands.

It would be nice to have the option to run the calendar independently of game time so it didn’t effect this.

1 Like

I look that. I will try to fix the bug with the time change command and the bed.

1 Like

Might I suggest the ability to individually customize the length of day and the length of night? I like having longer days, but players tend not to enjoy the long nights that come with it. For example, my server’s day-night cycle is 6 hours, or 432000 ticks. (Thanks to this plugin!) I think it’d be useful if I could set the day to last 4 hours and the night to last only 2 hours.

Thanks for your time,
~ WryWolfy

Yes, I could add this possibility to the plugin.

1 Like

Update 2.0

  • Support the seconds.
  • Support day and night cycle.
  • Removed the value day of the year.
  • Fix a bug with the bed.
  • Fix a bug with the commands to set the time.

Your config will be erased, check the config file to update yours.

Links

2 Likes

A warning about this update:
If you update the jar and not the config, then restart the server, your config will be erased. Keep backups.

1 Like

How create calendar?

Here you can see how to create your calendar and you have an example here.

I havn’t config file. Where to write it?

Hi Djxy, thanks for implementing my suggestion of the night cycle!
However, due to the way your plugin handles time by constantly setting the value, it makes shaders VERY confused and the shadows constantly change - it gets a bit irritating. To fix this, on your previous version I set the doDaylightCycle gamerule to false so that the only change of time of day was made by your plugin. However, this latest update changed how that worked and thus my solution is no longer. I was wondering if you could implement a setting somewhere to allow the calendar to continue running even when doDaylightCycle is set to false? I’d really appreciate it and I’m sure everyone else with shaders would as well!

Thanks for your time,
~ WryWolfy

Update 2.0.1

  • Fix a bug with the gamerule doDaylightCycle.

Links