1
0
Fork
You've already forked world_settings
0
An API for managing per-world settings for Luanti games and mods.
  • Lua 100%
2025年08月07日 13:08:40 +10:00
locale Update POT file 2025年07月18日 11:30:14 +10:00
.cdb.json Fix forum topic number 2025年07月23日 12:43:39 +10:00
.luacheckrc Allow server admins to override default world_settings. 2025年03月18日 14:03:55 +10:00
.luaformatrc Finish in game UI. 2025年07月15日 13:31:22 +10:00
.luarc.json No exe 2024年02月05日 11:28:21 +10:00
API.md Fix typo 2025年07月16日 11:22:48 +10:00
CC-BY-SA-4.0.md Add license texts 2025年07月23日 10:33:43 +10:00
GPL.md Add license texts 2025年07月23日 10:33:43 +10:00
init.lua Fix typo 2025年07月16日 09:29:46 +10:00
LICENSE.md Fix license typo 2025年07月27日 08:48:04 +10:00
mod.conf Bump release 2025年07月27日 08:48:48 +10:00
README.md Add contentdb shield 2025年08月07日 13:08:40 +10:00
ss.jpg Add screenshot 2025年07月15日 14:05:07 +10:00

World Settings

ContentDB

This mod adds an API for managing per-world settings for Luanti games and mods.

Settings can be managed in code using the API, and in game by players with the server privilege using the wset chat command or UI.

Settings are saved to the world_settings.conf file in the world's directory.

Settings are updated in the config file immediately on being registered or altered.

Setting names consist of two parts, a domain and a name. The domain should be unique for your game or mod. This allows settings in different mods to use the same name.

Domain and name cannot contain a dot '.' or whitespace, if they do they will be rejected.

Once a setting has been set on the world, which will happen automatically when they are registered, any changes to the default in the code, or in the global settings, will not affect existing world settings.

You can copy a world setting file to a new world after it is created but before it is run to have a standard set of world settings applied to a new world. Alternatively you can create a set of Default World Settings for your server.

You will need to restart a world if you want to change the settings by updating the config files directly.

Screenshot of in game menu

Default World Settings

You can override the default world settings by saving your preferred world settings to $path_to_luanti_data/mod_data/world_settings/world_settings.conf. Once you have done this then all new worlds will use the settings set in this file instead of the game or mod defined defaults.

You may need to create the world_settings directory yourself, but the mod_data directory should already exist.

These settings can be set or updated in game by using the /wset sync <domain> chat command or by clicking the Sync button in the UI.

Chat command

Players with the server privilege can interact with the world settings via the wset chat command.

  • wset with no arguments displays all current settings and their values.
  • /wset help with no argument displays all current settings with their help text.
  • /wset help <domain> with an argument displays settings for the specified domain with their help text.
  • /wset name displays the value of the named setting.
  • /wset name value changes the value of the named setting to the provided value.
  • /wset ui show a form for changing settings. Requires the flow mod.
  • /wset sync <domain> copy the saved values from the given domain to the default world config.

Examples

Query a setting in game

/wset my_mod.can_fu

Change a setting in game

/wset my_mod.can_fu false

Display The in Game UI

/wset ui

Using in A Game or Mod

To find out how to use World Settings in a game or mod read the API documentation.

Dependencies

There are no mandatory mods.

Optional

These mods can expand the experience this mod offers.

  • flow Install from ContentDB. Used for the in game UI.

Source Code License

See LICENSE.md for more details.

The source code in this mod is licensed under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Media License

The images and image sources in this mod are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 (CC BY-SA 4.0).