Templates are directories of files that Universe copies into an instance’s working directory (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ohemilyy/universe/llms.txt
Use this file to discover all available pages before exploring further.
./running/<instance-id>/) before launching the instance process. They let you share common configuration, assets, and startup files across every instance of a configuration without duplicating them manually. After copying, Universe scans the files listed in fileModifications and replaces placeholder variables — like %PORT% and %INSTANCE_ID% — with the actual runtime values for that instance.
Directory structure
Templates live under./templates/<group>/<name>/. The group is a top-level namespace for organizing related templates; the name is the specific template within that group.
templates
global
server
server.properties
plugins
lobby
default
server.properties
world
global/server is a shared base template applied to every server instance, while lobby/default provides lobby-specific files that layer on top.
Template installation
When a new instance is created,TemplateManager resolves and installs templates in the following sequence:
Resolve templates
Universe evaluates the
templateInstallationConfig in the instance’s configuration file to determine which templates to install. The four selection modes — allOf, allInGroups, oneOf, oneInGroups — are each processed and their results combined into a single list.Sort by priority
The resolved template list is sorted by the
priority field on each Template entry. Sort order depends on onTemplatePasteOverridePresentFiles:false(default): Higher-priority templates are pasted first. Lower-priority templates skip files that already exist.true: Lower-priority templates are pasted first. Higher-priority templates are pasted last and overwrite existing files.
Copy files
Each template directory is recursively copied to
./running/<instance-id>/. Files from storage-backed templates (e.g., S3) are downloaded first if not already present locally.Apply variable replacement
Universe reads each file listed in
Configuration.fileModifications and replaces all recognized placeholder strings with their runtime values. See built-in variables below.Selection modes
| Mode | Behavior |
|---|---|
allOf | Every template explicitly listed is installed. |
allInGroups | Every template found inside each named group directory is installed. Includes templates from registered remote storage providers. |
oneOf | Exactly one template is selected at random from the provided list and installed. |
oneInGroups | For each named group, exactly one template from that group is selected at random and installed. |
allOf to always install a shared base template and oneInGroups to add a randomly-selected map or variant on top of it.
Built-in variables
Variables are replaced in files listed in thefileModifications field of the instance configuration. The replacement applies to the full text content of each listed file.
| Placeholder | Resolved value | Source |
|---|---|---|
%PORT% | The port allocated to this instance | Determined at deploy time from availablePorts range |
%INSTANCE_ID% | The unique 6-character instance ID | Generated from UUID.randomUUID() at deploy time |
%MASTER_IP% | Master node IP address | masterAddress in config.json |
%MASTER_ADDRESS% | Master node IP address | Same as %MASTER_IP% — alias for compatibility |
%MASTER_PORT% | Master Hazelcast port | masterPort in config.json |
%MASTER_API_PORT% | Master REST API port | masterApiPort in config.json |
%NODE_ID% | ID of the wrapper node running this instance | nodeId in config.json on the executing node |
%HOST_ADDRESS% | Address instances advertise to clients | hostAddress in the instance configuration file |
%CONFIGURATION_NAME% | Name of the instance configuration | name field in the instance configuration file |
%MASTER_IP% and %MASTER_ADDRESS% resolve to the same value. Both are provided for backwards compatibility; prefer %MASTER_ADDRESS% in new templates.The fileModifications field
Variable replacement only runs on files you explicitly opt into viafileModifications in the instance configuration. This is intentional: scanning every file in a large template for replacements would be expensive and could corrupt binary files.
./configuration/default.json (excerpt)
Example: server.properties with variable replacement
Aserver.properties file in a template can reference placeholders that Universe fills in at deploy time:
templates/global/server/server.properties
./running/<instance-id>/server.properties will contain the actual port and host address for that specific instance:
./running/abc123/server.properties (after replacement)
Template sync between nodes
Templates stored locally on one node can be pushed to other cluster nodes using thetemplate sync command:
Custom variables
Extensions can contribute additional placeholder variables by implementingTemplateVariableProvider and registering with the TemplateVariableRegistry. Custom variables take precedence over built-in ones if they share the same placeholder name.
For details on building extensions that add custom template variables, see the building extensions guide.