Hytale mod that automates the heavy task of having to walk around the world turning on/off all those lights during dusk and dawn. https://www.curseforge.com/hytale/mods/lightautomation
  • Java 94.6%
  • Shell 3%
  • Python 2.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Troed Sångberg ace41d8644 Update to Hytale 0.8.0-pre.5 compatibility
Build against the Update 8 Part 4 pre-release server (0.8.0-pre.5) and
declare the matching compatibility range.

- useVersion 0.8.0-pre.5 (pre-release patchline)
- ServerVersion lower bound moved to 0.8.0-pre.5, keeping the 0.9.0
  upper bound so the range stays inside the 0.8 line
- mod Version 1.8.5

No source changes were needed: the pre.5 plugin-facing changes (the new
TaskRegistry scheduler replacing World.scheduleAfter, the
BlockMapMarkersResource getMarkersCopy()/get() renames, and the netty
stream priority deprecation) do not touch code this mod uses. The mod
keeps its own executor and builds and enables cleanly against pre.5.
2026-11-12 17:49:10 +00:00
bin/main feat: update to Hytale 0.6.0-pre.7 with BlockOperations migration 2026-07-12 13:09:24 +02:00
docs docs: add the paste-ready CurseForge description 2026-11-12 17:27:13 +00:00
gradle/wrapper Initial commit: LightAutomation mod with transition detection and light tracking 2026-04-05 22:29:36 +02:00
src/main Update to Hytale 0.8.0-pre.5 compatibility 2026-11-12 17:49:10 +00:00
tools test: derive the trackable-count expectation from the config 2026-11-12 12:08:41 +00:00
.gitignore fix: log why a config file was moved aside; skip no-op config rewrites 2026-11-12 11:02:02 +00:00
build.gradle.kts Change JAR name to lightautomation.jar 2026-04-06 20:27:13 +02:00
extract_light_sources.sh chore(hygiene): replace internal hostnames and paths with placeholders 2026-09-06 11:36:28 +02:00
gradle.properties Update for new Hytale server release (0.5.1) 2026-05-27 11:06:43 +02:00
gradlew Initial commit: LightAutomation mod with transition detection and light tracking 2026-04-05 22:29:36 +02:00
gradlew.bat Initial commit: LightAutomation mod with transition detection and light tracking 2026-04-05 22:29:36 +02:00
README.md docs: document the subcommand surface and the deprecated flags 2026-11-12 11:19:08 +00:00
settings.gradle.kts Update to Hytale 0.8.0-pre.5 compatibility 2026-11-12 17:49:10 +00:00
thumbnail.png feat: update to Hytale 0.6.0-pre.7 with BlockOperations migration 2026-07-12 13:09:24 +02:00

LightAutomation

A Hytale mod for automating lighting systems. We've all been there, having to go around the whole world at dawn and dusk just to turn lights on and off.

Features

  • Automatic Street Lights: Lights turn on at dusk and off at dawn
  • Smart Time Detection: Uses sunlight factor to detect precise dawn/dusk transitions
  • Player Light Tracking: Automatically tracks player-placed light sources
  • Persistence: Saves tracked lights across server restarts
  • Configurable Timing: Adjust when lights activate/deactivate
  • Your config is yours: an existing configuration file is never rewritten; your edits survive restarts
  • Outdoor lights only: Lights placed indoors/in caves etc will not be automated

Installation

  1. Place the LightAutomation.jar file in your Hytale server's mods/ directory
  2. Start your server
  3. A configuration file is created on first run (LightAutomationConfig.json in the plugin's data directory, next to the jar's mod folder)
  4. Edit the configuration as needed

The mod creates that file on first run and never rewrites it on startup or shutdown, so your edits stay exactly as you left them across restarts. The lights types commands below are the exception: they rewrite the file from the settings the mod knows about. If the file cannot be read (for example a duplicated entry), it is moved aside to LightAutomationConfig.invalid-<timestamp>.json, the log says why, and the mod runs on defaults

  • the server still boots.

Player usage

Depending on the DefaultLogic configuration option all lights placed outdoors will either be automated by default, or not. A player can choose to interact with the light (turn it on, or off, depending on its state) once during the first 10 seconds it has been placed to either opt out of automation, or opt-in, again depending on what the default value is.

(This might seem complicated, but I found no way of detecting when a player changes the state of just any light in the current Hytale API)

Why are torches not automated by default?

Most players probably assume torches won't go on and off, even if they're outdoors, so every torch is in StaticLightTypes in the shipped defaults. That is only the default: move any ID to the other list in your own config (or with /lightautomation lights types add <id>), and the mod will automate it.

Configuration Options

The mod supports the following configuration options:

  • EnableLightAutomation: Enable/disable light automation functionality (true/false)
  • DefaultLogic: Whether placed lights are automated by default, or vice versa (on/off)
  • LoggingLevel: Level of logging detail (off, processing, debug)
  • DawnThreshold: Percentage of sunlight required to turn off lights (>0.000 and <1.000)
  • DuskThreshold: Percentage of sunlight required to turn on lights (>0.000 and <1.000)
  • ToggleableLightTypes: Array containing lights the mod should automate
  • StaticLightTypes: Array containing lights the mod should not automate

Notes:

  • Block type IDs are matched case-insensitively, so deco_lantern and Deco_Lantern are the same entry.
  • Unknown top-level keys are ignored and reported in the server log; restarts leave the file alone. $Comment keys are accepted as metadata while reading. A lights types write command rewrites the file from the known settings only, so anything else in it (including $Comment) is dropped at that point - keep long-lived notes outside the file.
  • An ID in both lists is reported in the log and by lights types check.
  • The arrays are authoritative: an empty array means "automate nothing", not "use the built-in defaults".

Caveat regarding dusk: Currently the Hytale API reports 0 sunlight well before the sun actually sets. I assume this to be a bug, but until it's fixed you'll likely want this to be 0.004 or something in that range.

Commands

Every action is a subcommand:

  • /lightautomation - displays available commands
  • /lightautomation version - displays version
  • /lightautomation reload - reloads and applies updated configuration
  • /lightautomation config - displays current configuration settings
  • /lightautomation save - manually saves tracked lights
  • /lightautomation clear - clears all tracked lights
  • /lightautomation info - shows persistence information
  • /lightautomation lights - shows the tracked lights summary
  • /lightautomation lights list [<type>] [--all] - lists tracked lights grouped by type; give a type to drill into it, --all lifts the 20-row cap
  • /lightautomation lights types list - lists both configured lists (unknown IDs are marked *)
  • /lightautomation lights types check - checks configured IDs against the game and the shipped defaults
  • /lightautomation lights types add <blockTypeId> [--static] - add an ID to the toggleable (default) or static list
  • /lightautomation lights types remove <blockTypeId> - remove an ID from both lists and stop tracking existing lights of that type
  • /lightautomation lights types defaults - add shipped defaults that are missing from your config

reload, save, clear and the lights types write commands require the permission defxor.lightautomation.config (admin-only in practice). Their changes are saved to the config file and apply to lights placed from now on; already placed lights are not rescanned. remove does stop tracking the lights of that type that are already tracked.

Deprecated flags

The old flag spellings still work in this release and are removed in the next one:

Flag Use instead
--version version
--reload reload
--config config
--save save
--clear clear
--info info
--lights lights

Older READMEs also listed /lightautomation --lights list, --lights count and --lights types. Those were never implemented - the flags are booleans, so the extra word only produced a usage error. Their real equivalents are lights list, lights and lights types list.

Upgrade notes

  • Existing configs are left as they are. Restarts never rewrite the file. The shipped defaults only apply to new installs (or to a key you deleted). lights types check shows which shipped defaults your config is missing, and lights types defaults adds them on request. It only adds: it never moves an ID between lists and never removes one, so a deliberate deletion stays deleted.
  • An emptied list now means empty. Earlier versions silently fell back to the built-in lists when an array was empty; now an empty ToggleableLightTypes really does disable automation for every type.
  • A broken config no longer takes the server down. Duplicate entries used to crash the server at boot; the file is now moved aside and the mod runs on defaults.
  • Classification changes are reported, not applied. If an ID you keep in one list is shipped in the other (for example a torch you kept toggleable), check says so and leaves your choice alone.

Updating the defaults after a game update

The default lists are generated from the game assets. With a local Assets.zip (the script defaults to ~/hytale/Assets.zip, override with ASSETS_ZIP):

python3 tools/scan_light_types.py            # print the two lists
python3 tools/scan_light_types.py --check src/main/java/dev/defxor/lightautomation/config/LightAutomationConfig.java

Paste the printed lists into LightAutomationConfig and run --check to confirm. A server admin does not need this: lights types check and lights types defaults cover the upgrade without touching source.

License

Creative Commons Zero