Create a persistent server
A persistent server keeps one server configuration and does not scale to multiple instances like a group. The examples use the sharedCloudApi client created in Installation and belong inside your plugin’s methods.
This example creates survival-1 with a new Paper blueprint. Because the persistent server is active, SimpleCloud starts its instance and replaces it after a stop.
createBlueprint(...) with a source:
source or createBlueprint, not both.
CreatePersistentServerRequest fields
CreatePersistentServerRequest fields
string
required
Use up to 100 ASCII letters, digits, underscores, or hyphens (
[A-Za-z0-9_-]). Persistent server names are unique within the network.Name matching is case-insensitive, so Survival-1 and survival-1 identify the same persistent server. Creating or renaming a persistent server to a case-only variation of an existing name returns 409 Conflict.A persistent server and a group may share a name.GroupServerType | null
SERVER or PROXY. Defaults to SERVER.integer | null
Minimum memory in MB.
integer | null
Maximum memory in MB.
integer | null
Player limit. Defaults to
50.CreateBlueprintRequest | null
Blueprint to create for this persistent server.
SourceConfig | null
Existing blueprint or container image to use. Do not set this together with
createBlueprint.boolean | null
Whether SimpleCloud should keep an instance running. Defaults to
true.integer | null
Persistent server priority.
string | null
ID of the assigned serverhost.
WorkflowsConfig | null
Lifecycle and manual workflows.
Map<String, Object> | null
Custom properties.
List<String> | null
Tags used to organize and filter persistent servers.
Find persistent servers
Find one persistent server by name or ID:getAllPersistentServers() without a query to return every persistent server.
Update a persistent server
Only fields set onUpdatePersistentServerRequest are changed:
Manage properties
Use the property methods to change custom properties without updating the rest of the configuration:updatePersistentServerProperties merges the supplied values with the existing properties. You can also update one property or delete multiple properties.
Delete a persistent server
Persistent server model
PersistentServer extends ServerBase and provides the following fields.
string
required
Unique persistent server ID.
string
required
Persistent server name.
GroupServerType
required
SERVER, PROXY, or UNKNOWN_SERVER.integer | null
Minimum memory in MB.
integer | null
Maximum memory in MB.
integer | null
Player limit.
boolean | null
Whether SimpleCloud should keep an instance running.
integer | null
Persistent server priority.
string | null
Assigned serverhost ID.
integer
required
Current player count, or
0 when no instance is running.SourceConfig | null
Blueprint or container image source.
WorkflowsConfig | null
Lifecycle and manual workflows.
Map<String, Object> | null
Custom properties.
List<String> | null
Tags used for filtering and organization.
string
required
Creation timestamp in ISO 8601 format.
string
required
Last update timestamp in ISO 8601 format.
api.server() to work with the running instance. Its getPersistentServerId() method links it back to this configuration.