Configurations - Alex39099/TimeControl GitHub Wiki
Configurations
The default config.yml is available at the plugin's Spigot page.
Basic Configurations
This will cover most of the configurations but yet also the most important ones for a first setup.
(Default) World Settings
The default world settings are located within the config.yml file. The first time a world gets affected by the plugin there will be no specified settings for that world so those values will be used as template. After that those values will have no effect for that world anymore hence there will be individual settings within the worldConfigurations.yml file for that world from now on.
We will not bother about minecraft-day-start-tick or minecraft-day-length in this section. Please see the Advanced Configurations for that. Apart from that a world has the following attributes:
| Name | Type | Special Properties | Description |
|---|---|---|---|
| day-length | Integer | must be greater 0 | Flat amount of day time |
| night-length | Integer | must be greater 0 | Flat amount of night time |
| needed-sleep-percentage | Double | must be between 0 and 1 | Percentage of players needed to skip night/storm |
| sleeping-night-time-multiplier | Integer | must be at least -1 | Time-Multiplier if world is sleeping during night |
| sleeping-storm-time-multiplier | Integer | must be at least -1 | Storm-Time-Multiplier if world is sleeping during thunder |
For information about changing those attributes via commands (recommended), please see Commands. Note that the default world settings located in the config.yml cannot be changed via command.
day-length & night-length
Those values represent the flat amount of day-time & night-time. For example if you set day-length to 24000 it will simply be day for exactly 24000 ticks.
needed-sleep-percentage
This value determines the percentage of players that are needed for a world to count as sleeping. A hundred percent is represented by all players in a world that are not sleeping ignored. There must always be at least one player sleeping before anything happens.
A world will count as sleeping if more or equal players are sleeping than needed.
Settings this value to 0 will disable sleeping mechanics. However players will still be able to lay in bed.
sleeping-night-time-multiplier & sleeping-storm-time-multiplier
If a world is counted as sleeping the time will be sped up during night by sleeping-night-time-multiplier. If it is thundering/raining the duration till clear weather will be reduced by sleeping-storm-time-multiplier.
Setting one of the values to -1 will restore vanilla behavior. So if players are sleeping at night and/or during thunder it will be skipped instantly and a new day will begin.
For example if you set sleeping-night-time-multiplier to 20 a full night with night-length 7000 will take then only 7000 / 20 = 350 ticks equal to 17,5 seconds if the world is counted as sleeping.
A thunderstorm has a default weather duration of around about 17000 ticks. Let assume you set sleeping-storm-time-multiplier to 60 for instance. Then a thunderstorm of 17000 ticks will take only 17000 / 60 = 283,33 ticks to sleep through (which is about 14 seconds).
This following note is not relevant for MC versions 1.17 and onwards: A final note to the sleeping mechanics: The mechanic will stop at any time if less people are sleeping than needed. This can happen if a player leaves his bed or someone joins into the world. Unfortunately tho Minecraft will kick all out of bed if everyone is either sleeping or "hard sleeping ignored". With the latter I mean players that are sleeping ignored within the Spigot API. This can be done by other plugins, for example Essentials if a player has the permission essentials.sleepingignored. Therefore in this case the sleeping process will not be interrupted. I recommend to only use the provided methods of this plugin to set players as sleeping ignored.
World Exceptions & deactivate_empty_worlds
The world exceptions options are located within the config.yml file. You can either exclude a world by name or by environment (overworld, nether, end). If a world is excluded the plugin will have no effect on it in any way.
deactivate_empty_worlds set to true will cause completely empty worlds to not update their time to save performance.
Finishing Touches
After you did everything explained within this section you are now ready to start your first proper test run. As last step you just have to set configured within the config.yml file to true and restart your server (or reload the plugin).
Advanced Configurations
Now lets get into the more advanced settings of the plugin.
check-delay
This is just the delay between to time updates. The lower the smoother of course but you can decide what suits you best.
minecraft-day-start-tick & minecraft-day-length
The missing part of the attributes table of a world configuration within the Basic Configurations is the following:
| Name | Type | Special Properties | Description |
|---|---|---|---|
| minecraft-day-start-tick | Integer | must be betwenn 0 and 24000 | First MC-tick value of the day |
| minecraft-day-length | Integer | must be betwenn 0 and 24000 | MC-tick length of a day |
As stated those values correspond (unlike day-length or night-length) to the Minecraft ticks of a day and night cycle between 0 and 24000 ticks. By setting those values you are simply telling the plugin
- when it is daytime/nighttime and
- what Minecraft-tick a day should start with.
These settings were added in order to have control over the exact light levels you want to count towards daytime/nighttime. The plugin will enlarge the Minecraft ticks between minecraft-day-start-tick and minecraft-day-length to the amount of ticks you set for day-length. The other intervall of ticks will be enlarged to the amount of ticks set for night-length accordingly.
Message Section
The message section of the config.yml should be self explanatory. Bukkit Color Codes are supported for every message.
A side note: You may not know what the actionBar is. One vanilla action bar message of Minecraft would be "You can only sleep at night and during thunderstorms". This should make it clear. If not just lay in bed and you will see it.