How to Edit a Server's MidnightLib Config In-Game with Commands
One of MidnightLib's more unusual features is the ability to change a server's configuration while you're connected, using commands instead of editing files by hand. This is useful on a multiplayer server where you have operator permissions and want to adjust a dependent mod's behavior on the fly.
Before You Start
You need to be an operator (or have the relevant permission level) on the server. The server must also be running a mod that uses MidnightLib's config system — otherwise there's nothing for the commands to target.
Using the Commands
MidnightLib registers a command tree for reading and writing config values. The general shape is a command that names the mod, then the config key, then the new value. Tab-completion is your friend here: type the base command and press Tab to see which mods and keys are available, then Tab again to see accepted values for that key.
What Happens to Changes
Changes made this way apply to the running server session. Whether they persist across a restart depends on how the owning mod saves its config — some write through immediately, others only on shutdown. If you're unsure, check the mod's own documentation.
Tips
- Use the read form of the command first to confirm the current value before changing it.
- If a value is rejected, the command will tell you the expected type (boolean, number, enum) via tab-completion.