Skip to content
Jack edited this page Jul 23, 2024 · 9 revisions

header image

Installation Instructions

If you need help installing RealTimeWeather or want more information, you're in the right place!

Compatibility

RealTimeWeather uses the 1.13 Bukkit API, which allows it to support servers running versions back to 1.7. It can run on any server that uses the Bukkit API or any of its forks, but I highly recommend using a Paper server for better speed, support, and stability.

Downloading RealTimeWeather

You can download RealTimeWeather from Modrinth, Hangar, or from a GitHub release. Download the latest version of the .jar file. You can use older versions if you want, but I will not provide support for them.

Once you've downloaded the .jar file, put it in your server's plugin directory. If you're using a hosting provider, they should have instructions on how to add plugins to your server. If you're hosting your own server, you should know how to add plugins to it.

Setup

Generating the configuration file

Setting up RealTimeWeather is simple. Once you've followed the previous instructions, run your server. RealTimeWeather will start and generate its configuration file (named config.yml). You can find it in the RealTimeWeather folder in your server's plugin directory. After you see that RealTimeWeather has started successfully, stop your server.

Editing the configuration file

Currently, RealTimeWeather does not support per-world settings. RealTimeWeather will apply these configuration settings to every world on your server. Per-world settings should be added in the future.

By default, all of RealTimeWeather's features are disabled. The configuration file contains comments explaining each option, but I'll provide more detailed explanations below if you need them.

Note: All interval values are in ticks. You can find a tick calculator here.
Note: All values that are surrounded by '' must stay surrounded by them.

RealTimeWeather Settings

  • UpdateCheckInterval (default: 1734000)
    This sets how often RealTimeWeather will check for updates. Set this to 0 to disable update checks.
  • Debug (default: false)
    Setting this to true will provide more messages from RealTimeWeather in the console. This is useful for diagnosing problems.

Time Sync Settings

  • SyncTime (default: false)
    Set this to true to enable time syncing. Make sure that you choose a timezone after enabling this. If this is set to 'false', all settings in the time section will be ignored.
  • TimeSyncAllWorlds (default: true)
    By default, RealTimeWeather will sync the time in every world on your server (except nether and end worlds). Set this to false to specify which worlds you want to sync the time in below.
  • TimeSyncWorlds (default: - world)
    If you set TimeSyncAllWorlds to false, list the worlds that you want to sync the time in here. End and nether worlds will be skipped even if they are listed here.
  • BlockTimeSetCommand (default: true)
    By default, RealTimeWeather will prevent users from using the /time set command if SyncTime is set to true. You can set this to false to re-enable the command (not recommended).
  • DisableBedsAtNight (default: true) By default, RealTimeWeather will prevent players from entering their beds at night if SyncTime is set to true since you can't skip the night. They will still be able to set their spawn point. You can set this to false to allow players to sleep in their beds again (not recommended).
  • DisableBedsAtNightMessage (default: '') If DisableBedsAtNight is set to true, this message will be sent to any player that tries to sleep in a bed at night.
  • TimeSyncInterval (default: 100)
    This configuration option lets you change how often RealTimeWeather updates your server's time. You don't have to change this, but if you do, make sure that you don't set it too low.
  • Timezone (default: 'America/New_York')
    Enter the time zone that you'd like to sync with here (EX: If set to 'Etc/UTC', it will be 8:00 AM in-game when it's 8:00 AM UTC). You can find a list of timezone names here. Try to use the names in the TZ identifier column.
  • SunriseSunset (default: default) This can either be set to default, real, or custom. If set to default, the sun will rise and set at the "vanilla" sunrise/sunset times (always 5:02 AM and 6:36 PM). If set to real, the sunrise/sunset times will be the same as the times at the real-world location set by SunriseSunsetLatitude and SunriseSunsetLongitude (powered by SunriseSunset.io). If set to custom, the sunrise/sunset times will always be the times set by SunriseCustomTime and SunsetCustomTime.
  • SunriseSunsetLatitude (default: '0')
  • SunriseSunsetLongitude (default: '0') If you set SunriseSunset to real, put the longitude and latitude of the location that you want to sync your server's sunrise/sunset with here. If these point to a location with no sunrise/sunset (like the North Pole), RTW will use the default sunrise/sunset times. You can find the latitude and longitude of a location at https://www.latlong.net/.
  • SunriseCustomTime (default: 5:02:27 AM)
  • SunsetCustomTime (default: 6:36:36 PM) If you set SunriseSunset to custom, put the sunrise/sunset times that you want to use here. The times you enter must be in 12-hour time format with AM or PM at the end and include seconds.

Weather Sync Settings

  • SyncWeather (default: false)
    Set this to true to enable weather syncing. Make sure that you set the options below after enabling this. If this is set to 'false', all settings in the time section will be ignored.
  • WeatherSyncAllWorlds (default: true)
    By default, RealTimeWeather will sync the weather in every world on your server (except nether and end worlds). Set this to false to specify which worlds you want to sync the weather in below.
  • WeatherSyncWorlds (default: - world)
    If you set WeatherSyncAllWorlds to false, list the worlds that you want to sync the weather in here. End and nether worlds will be skipped even if they are listed here.
  • BlockWeatherCommand (default: true)
    By default, RealTimeWeather will prevent users from using the /weather command if SyncWeather is set to true. You can set this to false to re-enable the command.
  • DisableBedsDuringThunder (default: true) By default, RealTimeWeather will prevent players from entering their beds during a thunderstorm if SyncWeather is set to true since you can't skip storms. They will still be able to set their spawn point. You can set this to false to allow players to sleep in their beds again (not recommended).
  • DisableBedsDuringThunderMessage (default: '') If DisableBedsDuringThunder is set to true, this message will be sent to any player that tries to sleep in a bed during a thunderstorm.
  • WeatherSyncInterval (default: 6000)
    This configuration option changes how often RealTimeWeather will get weather information from OpenWeather and update your server's weather. Setting this below 2400 will cause problems.
  • APIKey (default: 'API_KEY')
    Put your OpenWeather API key here. There are instructions on how to get an API key below. Keep your API key a secret.
  • WeatherLatitude (default: '0')
  • WeatherLongitude (default: '0')
    Put the latitude and longitude of the location that you want to sync your server's weather with here. You can find the latitude and longitude of a location at https://www.latlong.net/.

Getting an OpenWeather API key

To use the weather sync feature, you need to get an API key from OpenWeatherMap. Each person should have their own API key. Do not share your API key with anyone or use anyone else's API key.

After generating an API key, it may take a bit for it to start working. Please wait an hour before asking for help if RealTimeWeather says that your API key is incorrect.

To get an API key, go to openweathermap.org and create an account by clicking Sign In in the upper right corner and then clicking Create an Account..

Once you've made an account, click on your account name in the upper right corner (where the Sign In button was) and then click on My API keys. Under the Create key section on the right side of the page, type in a name for your API key (it can be anything) and then click Generate. Wait a few seconds, and your API key will appear on the left (it's the long jumble of letters and numbers).

NOTE: OpenWeatherMap has a limit of 60 weather syncs per minute. If you plan on running multiple servers or syncing the weather more often, you might need to increase the value of WeatherSyncInterval or purchase a plan from OpenWeatherMap here.

Troubleshooting

If you're having any issues, try out the troubleshooting steps below before asking for help.

API key incorrect error

This error could be caused by multiple things.

The simplest solution to this problem is that you copied and/or pasted the API key incorrectly. Ensure that you copy your entire API key from OpenWeatherMap and that it's the only thing in between the ' ' in your configuration file.

If you've made sure that the API key in your configuration file was copied correctly and your issue still continues, you may need to wait up to an hour for your API to become active. This process should only take a few minutes at most, but it can take longer. Continue checking your API key for at least an hour.

If you want an easier way to check if your API key is correct, try pasting https://api.openweathermap.org/geo/1.0/zip?zip=34134,DE&appid=[YOUR_API_KEY] into your internet browser (make sure that you replace [YOUR_API_KEY], including the [ ], with your API key. If you get a response like:

{"zip":"34134","name":"Kassel","lat":51.2878,"lon":9.4705,"country":"DE"}

and RealTimeWeather still gives you the same error, open an issue here. If you get a response like:

{"cod":401, "message": "Invalid API key. Please see https://openweathermap.org/faq#error401 for more info."}

then you need to keep waiting. If you've waited for more than an hour and RealTimeWeather still displays an error, try generating another API key or contacting OpenWeatherMap support.