ModpackUtilities Mod
Imagine ModpackUtilities as your universal toolkit for modpack developers. This simple yet powerful mod gradually expands your capabilities to create the perfect modpack by providing file copying features, command execution on world join, and much more!
Features
Copying Files and Folders
This functionality resembles Configured Defaults or Your Options Should Be Respected (YOSBR) but is implemented more simply. Place any files or folders in the copy directory, and they will automatically transfer to the game directory.
Usage Examples:
- To add an
options.txtfile without replacing the existing one, place it at/config/modpackutilities/copy/options.txt. It will end up where it should be — in/options.txt. - If you need to forcibly replace user settings, set the
overwriteOnCopyparameter totruein the configuration. Then simply arrange files and folders in thecopydirectory exactly as they should appear in the final game directory. For example,/config/modpackutilities/copy/config/fancymenuwill move to/config/fancymenu.
There are no restrictions on file types or quantity — everything is copied exactly with the original structure.
Executing Commands on World Join
The executionContext parameter in settings determines from whose perspective commands are executed:
client— commands run as if entered by the player themselves (permissions are considered)server— commands execute with server administrator privileges
Important Nuances:
- With
executionContext: client, commands like/givethat require administrator rights will silently fail if the player doesn't have appropriate permissions. - With
executionContext: server, commands execute with maximum privileges, but standard parameters like@are replaced with the special@playerto specify the player.
Command execution frequency is set by the executionFrequency parameter: once (only on first join) or everytime (every time joining the world).
The commands themselves are specified in the commands array. They are executed from right to left, so order matters. Each command must:
- Start with
/ - Be enclosed in double quotes
- Be placed within square brackets
Example: "commands": ["/give @s minecraft:diamond 64", "/tell @player Hello world!"] — /tell will execute first, then /give. Note the simultaneous use of @s and @player.
Mod Configuration
Main parameters are set in the /config/modpackutilities/modpackutilities.json file:
overwriteOnCopy:trueorfalseexecutionContext:clientorserverexecutionFrequency:onceoreverytimecommands: any valid Minecraft commands; use@playerto specify the player