### Run Setup Wizard Source: https://docs.simplecloud.app/concepts/cli Executes the setup wizard to install a fresh cloud bundle. ```bash simplecloud setup ``` -------------------------------- ### CLI Quick Setup Source: https://docs.simplecloud.app/concepts/cli Installs and sets up the SimpleCloud CLI on Unix-like systems. ```APIDOC ## Quick Setup ### Unix ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/theSimpleCloud/simplecloud-manifest/HEAD/install.sh)" && sc setup ``` ### Windows (Instructions for Windows setup are not provided in the source text.) ``` -------------------------------- ### Full Game Server Configuration Example Source: https://docs.simplecloud.app/manual/plugins/server-connection An example configuration demonstrating connections, network join targets, fallback connections, and navigation commands for a game server setup. ```yaml connections: - name: "lobby" server-name-matcher: operation: "STARTS_WITH" value: "lobby" - name: "bedwars" server-name-matcher: operation: "STARTS_WITH" value: "bw" rules: - type: "PERMISSION" name: "minigame.bedwars" value: "true" network-join-target: enabled: true target-connections: - name: "lobby" priority: 0 fallback-connections: enabled: true target-connections: - name: "lobby" priority: 0 - name: "bedwars" priority: 1 from: - operation: "STARTS_WITH" value: "bw" commands: - name: "lobby" aliases: ["hub", "l"] target-connections: - name: "lobby" priority: 0 - name: "bedwars" aliases: ["bw"] permission: "minigame.bedwars" target-connections: - name: "bedwars" priority: 0 ``` -------------------------------- ### Example Chat Format with Placeholders Source: https://docs.simplecloud.app/manual/plugins/placeholders Demonstrates using server and player placeholders in a chat format configuration. Ensure PlaceholderAPI and the Placeholders plugin are installed. ```yaml chat-format: "&8[&b%simplecloud_server_id%&8] &7%player_name%: &f%message%" ``` -------------------------------- ### Add All Available Plugins via CLI Source: https://docs.simplecloud.app/manual/plugins Installs all plugins that are currently available for your SimpleCloud local installation. This is a convenient way to get all official plugins. ```bash sc local plugins add --all ``` -------------------------------- ### Start Server Instance Source: https://docs.simplecloud.app/concepts/cli Starts a specific server instance by its ID. ```bash simplecloud start server [id] ``` -------------------------------- ### Example Usage Source: https://docs.simplecloud.app/manual/plugins/placeholders Examples of how to use the placeholders in common configurations. ```APIDOC ## Example Usage Here's an example using placeholders in a chat format plugin: ```yaml chat-format: "&8[&b%simplecloud_server_id%&8] &7%player_name%: &f%message%" ``` Or in a scoreboard configuration: ```yaml scoreboard: title: "&bServer Status" lines: - "&7Server: &f%simplecloud_server_id%" - "&7Players: &f%simplecloud_server_player_count%/%simplecloud_server_max_players%" - "&7State: &f%simplecloud_server_state%" - "" - "&7Group: &f%simplecloud_group_name%" - "&7Total Players: &f%simplecloud_group_player_count%" ``` ``` -------------------------------- ### List Installed SimpleCloud Plugins via CLI Source: https://docs.simplecloud.app/manual/plugins Use this command to view all plugins currently installed in your local SimpleCloud setup and their respective file paths. ```bash sc local plugins list ``` -------------------------------- ### Start Cloud Components Source: https://docs.simplecloud.app/concepts/cli Initiates all cloud components. ```bash simplecloud start cloud ``` -------------------------------- ### Install the Controller via CLI Source: https://docs.simplecloud.app/concepts/controller Manually trigger the installation of the controller component using the SimpleCloud CLI. ```bash # Install the controller simplecloud install controller ``` -------------------------------- ### Start a Server Instance Source: https://docs.simplecloud.app/manual/setup/servers Initiates a new server instance for a specified group. ```bash simplecloud start server ``` ```bash simplecloud start server lobby ``` -------------------------------- ### Start Servers via API Source: https://docs.simplecloud.app/developers/controller/servers Initiate new server instances using a group name and optional start cause. ```Kotlin // Start a server with default cause val server = controllerApi.getServers().startServer("lobby") // Start a server with specific cause val server = controllerApi.getServers().startServer( groupName = "lobby", startCause = ServerStartCause.API_START ) ``` -------------------------------- ### Install SimpleCloud CLI Source: https://docs.simplecloud.app/manual/faq Use this bash command to install the SimpleCloud CLI. Ensure you have curl installed. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/theSimpleCloud/SimpleCloud/main/install.sh)" ``` -------------------------------- ### Install Serverhost CLI Source: https://docs.simplecloud.app/concepts/serverhost Use this command to install the Serverhost component on a machine. Ensure the `secrets/auth.secret` file matches the controller's. ```bash # Install the Serverhost simplecloud install serverhost ``` -------------------------------- ### Install SimpleCloud CLI Source: https://docs.simplecloud.app/concepts/cli Use this command to install the SimpleCloud CLI on Unix-based systems. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/theSimpleCloud/simplecloud-manifest/HEAD/install.sh)" && sc setup ``` -------------------------------- ### Mixed Actions and References (YAML) Source: https://docs.simplecloud.app/concepts/serverhost/template-actions A comprehensive example showing a mix of action objects (like 'copy') and references to other actions within a single action definition. This illustrates a complex toolchain setup. ```yaml cache-pull: - from: "%templates%/cache/%group%" to: "%server-dir%" type: "copy" - ref: cache-pull-libs cache-pull-libs: - from: "%libs-dir%" to: "%server-dir%/libraries" type: "copy" cache-push: - ref: cache-push-paper - ref: cache-push-spigot cache-push-paper: - from: "%server-dir%/plugins/.paper-remapped/" to: "%templates%/cache/%group%/plugins/.paper-remapped" type: "copy" cache-push-spigot: - from: "%server-dir%/libraries" to: "%templates%/cache/%group%/libraries" type: "copy" - from: "%server-dir%/versions" to: "%templates%/cache/%group%/versions" type: "copy" ``` -------------------------------- ### Template Directory Structure Example Source: https://docs.simplecloud.app/manual/setup/templates Example of a standard template directory layout for server groups. ```text templates proxy plugins ... lobby plugins lobby-plugin.jar ... server.properties bukkit.yml ``` -------------------------------- ### Example Configurator YML Source: https://docs.simplecloud.app/concepts/serverhost/configurators A sample configuration file defining TOML and TXT file structures for server startup. ```yaml # A list of all configuration files paths: # The path to the configuration file - path: "velocity.toml" # The type of the configuration file (valid are TXT, PROPERTIES, TOML, YML, JSON) type: "TOML" # The data object data: bind: "%ip%:%port%" show-max-players: %max-players% forwarding-secret-file: "forwarding.secret" player-info-forwarding-mode: "MODERN" # The path to the configuration file - path: "forwarding.secret" # The type of the configuration file (valid are TXT, PROPERTIES, TOML, YML, JSON) type: "TXT" # The data object data: "%forwarding-secret%" ``` -------------------------------- ### Controller Endpoint Example Source: https://docs.simplecloud.app/manual/setup/dashboard Example format for the controller endpoint required when connecting via the hosted dashboard. ```text 187.420.69.31:1337 ``` -------------------------------- ### Add Plugins Source: https://docs.simplecloud.app/concepts/cli Adds either a specific plugin or all available plugins to the installation. ```bash # Add a specific plugin simplecloud local plugins add # Add all available plugins simplecloud local plugins add --all ``` -------------------------------- ### Action Reference Example (YAML) Source: https://docs.simplecloud.app/concepts/serverhost/template-actions Demonstrates how to reference another action within an action configuration. This allows for modularity and reuse of action logic. ```yaml my-action: - ref: other/my-other-action ``` -------------------------------- ### Example Scoreboard Configuration with Placeholders Source: https://docs.simplecloud.app/manual/plugins/placeholders Illustrates using server and group placeholders to display dynamic information on a scoreboard. This configuration requires PlaceholderAPI and the Placeholders plugin. ```yaml scoreboard: title: "&bServer Status" lines: - "&7Server: &f%simplecloud_server_id%" - "&7Players: &f%simplecloud_server_player_count%/%simplecloud_server_max_players%" - "&7State: &f%simplecloud_server_state%" - "" - "&7Group: &f%simplecloud_group_name%" - "&7Total Players: &f%simplecloud_group_player_count%" ``` -------------------------------- ### Component Properties Example Source: https://docs.simplecloud.app/concepts/overview This is an example of a properties file used for configuring SimpleCloud components. It includes settings for database URLs, file paths, and network ports. ```properties DATABASE_URL=jdbc:sqlite:database.db GROUPS_PATH=../../groups # GRPC Uncomment and change this if you want to change grpc defintions GRPC_HOST=0.0.0.0 # GRPC_PORT=5816 # PUBSUB Uncomment and change this if you want to run pubsub on another port # PUBSUB_GRPC_PORT=5817 AUTH_SECRET_PATH=../.secrets/auth.secret ``` -------------------------------- ### Action Object Configuration (YAML) Source: https://docs.simplecloud.app/concepts/serverhost/template-actions An example of an action object configuration, specifying the type and required data. This example uses the 'copy' type to copy files. ```yaml cache-pull-libs: - from: "%libs-dir%" to: "%server-dir%/libraries" type: "copy" ``` -------------------------------- ### Global and Software-Specific Template Structure Source: https://docs.simplecloud.app/manual/setup/templates Example of how to organize global and software-specific templates within the templates directory. ```text templates every plugins global-plugin.jar global-config.yml every_paper plugins paper-specific-plugin.jar server.properties lobby plugins lobby-plugin.jar server.properties ``` -------------------------------- ### Manage Droplets via CLI Source: https://docs.simplecloud.app/manual/droplets Commands for installing and listing available droplets using the SimpleCloud CLI. ```bash # Install a droplet sc install # List all available droplets sc info droplets ``` -------------------------------- ### Basic Network Configuration Source: https://docs.simplecloud.app/manual/plugins/notify Provides a simplified example of network-wide notification settings. ```yaml date-format: dd.MM.yyyy HH:mm:ss server-state-filter: - server-state: STARTING permission: "staff.server-state.starting" message: "Server is starting up." - server-state: STOPPING permission: "staff.server-state.stopping" message: "Server is shutting down." ``` -------------------------------- ### Manage Local Plugins Source: https://docs.simplecloud.app/concepts/cli Base command for managing plugins in a local SimpleCloud installation. ```bash simplecloud local plugins [command] ``` -------------------------------- ### Combine Multiple Group Settings Source: https://docs.simplecloud.app/manual/setup/groups/edit-groups Apply several configuration changes to a server group in a single command. This example updates player count, memory, and server count for the 'survival' group. ```bash # Combine multiple settings in one command simplecloud edit group survival \ --max-players 40 \ --maximum-memory 3072 \ --minimum-online-count 2 ``` -------------------------------- ### Add a Specific Plugin via CLI Source: https://docs.simplecloud.app/manual/plugins Installs a particular plugin into your SimpleCloud local installation. Ensure the plugin name is correct. ```bash sc local plugins add proxy-essentials ``` -------------------------------- ### Initialize Controller API in Plugin Source: https://docs.simplecloud.app/developers/getting-started/paper Example of creating a coroutine-based API instance and fetching groups within a JavaPlugin. ```Kotlin import app.simplecloud.controller.api.ControllerApi import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import org.bukkit.plugin.java.JavaPlugin class BungeeCordExamplePlugin : JavaPlugin() { private val controllerApi = ControllerApi.createCoroutineApi() override fun onEnable() { logger.info("Hello from Paper!") CoroutineScope(Dispatchers.IO).launch { val groups = controllerApi.getGroups().getAllGroups() logger.info("Groups: $groups") } } } ``` -------------------------------- ### Initialize Controller API with Secret Token Source: https://docs.simplecloud.app/developers/controller/initialization Connect to the Controller API by providing your secret key directly. Ensure the secret key is kept confidential and is retrieved from the specified installation directory. ```kotlin val controllerApi = ControllerApi.createCoroutineApi("your-secret-key") ``` -------------------------------- ### Server Group Configuration Example Source: https://docs.simplecloud.app/manual/setup/groups Defines a SERVER group named 'lobby' with specific memory, port, player limits, and cloud properties for PaperMC. ```yaml name: lobby type: SERVER min-memory: 1024 max-memory: 1024 start-port: 50000 max-players: 100 min-online-count: 1 max-online-count: 1 cloud-properties: configurator: "paper_velocity" template-id: "lobby" server-url: "https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/463/downloads/paper-1.20.4-463.jar" max-startup-seconds: "120" ``` -------------------------------- ### Configure Server Scaling Source: https://docs.simplecloud.app/manual/setup/groups/edit-groups Control the dynamic scaling of servers within a group. This example sets the 'bedwars' group to scale between 2 and 10 servers, while 'lobby' is fixed at 3 servers. ```bash # Make bedwars scale between 2 and 10 servers simplecloud edit group bedwars --minimum-online-count 2 --maximum-online-count 10 # Make lobby always have exactly 3 servers simplecloud edit group lobby --minimum-online-count 3 --maximum-online-count 3 ``` -------------------------------- ### Servers API Operations Source: https://docs.simplecloud.app/developers/controller/servers Methods for retrieving, starting, stopping, and updating server instances. ```APIDOC ## Servers API Operations ### Description Provides methods to manage server lifecycle and state within the SimpleCloud environment. ### Methods - **getAllServers()**: Retrieves all active servers. - **getServerById(id)**: Retrieves a specific server by its UUID. - **getServersByGroup(groupName)**: Retrieves all servers belonging to a specific group. - **getServerByNumerical(groupName, numericalId)**: Retrieves a specific server by group and numerical ID. - **getServersByType(type)**: Retrieves servers filtered by ServerType. - **startServer(groupName, startCause)**: Starts a new server instance. - **stopServer(id/groupName, numericalId, stopCause)**: Stops a specific server or all servers in a group. - **updateServer(server)**: Updates the entire server object. - **updateServerState(id, state)**: Updates the state of a specific server. - **updateServerProperty(id, key, value)**: Updates a specific property of a server. ``` -------------------------------- ### Get Current Server Information via API Source: https://docs.simplecloud.app/developers/controller/servers Retrieve metadata for the server currently executing the code. ```Kotlin val currentServer = controllerApi.getServers().getCurrentServer() println("Current server group: ${currentServer.group}") println("Current server ID: ${currentServer.uniqueId}") ``` -------------------------------- ### Migrate SimpleCloud to a Specific Version Source: https://docs.simplecloud.app/manual/updates This command is used to manually migrate your SimpleCloud installation to a specific version, typically when breaking changes are introduced. It guides you through necessary manual steps. ```bash simplecloud migrate [version] ``` ```bash simplecloud migrate 3.0.0-beta.1 ``` -------------------------------- ### Remove Plugins Source: https://docs.simplecloud.app/concepts/cli Removes either a specific plugin or all installed plugins from the installation. ```bash # Remove a specific plugin simplecloud local plugins remove # Remove all installed plugins simplecloud local plugins remove --all ``` -------------------------------- ### Create Server Group Source: https://docs.simplecloud.app/concepts/cli Initializes a new server group with specified configuration flags. ```bash simplecloud create group [flags] ``` -------------------------------- ### Remove a Specific Plugin via CLI Source: https://docs.simplecloud.app/manual/plugins Uninstalls a specific plugin from your SimpleCloud local installation. Use this to manage your installed plugins. ```bash sc local plugins remove proxy-essentials ``` -------------------------------- ### Verify SimpleCloud Status Source: https://docs.simplecloud.app/manual/setup Displays the operational status of all installed SimpleCloud components. ```bash simplecloud status ``` -------------------------------- ### Connect to Controller Source: https://docs.simplecloud.app/concepts/cli Establishes a connection to the SimpleCloud controller. ```bash simplecloud connect [flags] ``` -------------------------------- ### Initialize Player API with Default Configuration Source: https://docs.simplecloud.app/developers/droplets/player/initialization Initializes the API using the PLAYER_SECRET environment variable for authentication. ```Kotlin val playerApi = PlayerApi.createCoroutineApi() ``` -------------------------------- ### Accessing the API Source: https://docs.simplecloud.app/manual/plugins/prefixes How to retrieve the PrefixesApi instance within a Bukkit/Paper environment. ```APIDOC ## Accessing the API ### Description Use the Bukkit ServicesManager to obtain the registered PrefixesApi provider. ### Code Example ```kotlin val prefixesApiProvider = Bukkit.getServicesManager() .getRegistration(PrefixesApi::class.java) val api: PrefixesApi = prefixesApiProvider.provider // Use API api.setPrefix(player.uniqueId, Component.text("[VIP] ")) ``` ``` -------------------------------- ### Get Groups Source: https://docs.simplecloud.app/developers/controller/groups Retrieves group information by name, type, or fetches all existing groups. ```APIDOC ## GET getGroups ### Description Retrieves group data using various filters. ### Method GET ### Parameters #### Query Parameters - **name** (String) - Optional - Filter by group name - **type** (ServerType) - Optional - Filter by server type ### Response Example val lobbyGroup = controllerApi.getGroups().getGroupByName("lobby") val allGroups = controllerApi.getGroups().getAllGroups() val serverGroups = controllerApi.getGroups().getGroupsByType(ServerType.SERVER) ``` -------------------------------- ### Update SimpleCloud CLI Source: https://docs.simplecloud.app/manual/updates Use this command to check for, download, and install the latest version of the SimpleCloud CLI. ```bash simplecloud upgrade cli ``` -------------------------------- ### List Server Groups Source: https://docs.simplecloud.app/concepts/cli Displays all configured server groups and their basic information. ```bash simplecloud info groups ``` -------------------------------- ### Configure Server Selection Inventory Source: https://docs.simplecloud.app/manual/plugins/npcs Sets up the inventory layout and pagination for server selection. Uses placeholders to dynamically display server status and player counts. ```yaml version: "1.0" id: quickjoin.bedwars title: <#ffffff>Bedwars rows: 6 pagination: listed-group-name: bedwars server-name-pattern: - state-items: PREPARING: starting_pagination_item STARTING: starting_pagination_item AVAILABLE: available_pagination_item INGAME: ingame_pagination_item items: - id: available_pagination_item material: LIME_BANNER display-name: lores: - "Players: <#38bdf8>/<#38bdf8>" - "" - "Version: <#a3a3a3> " - "Template: <#a3a3a3>" ``` -------------------------------- ### Basic SimpleCloud Controller API Usage in Kotlin Source: https://docs.simplecloud.app/developers/getting-started/other Demonstrates how to create a CoroutineApi instance and fetch all groups from the SimpleCloud controller. Ensure you have the necessary dependencies added. ```kotlin import app.simplecloud.controller.api.ControllerApi suspend fun main() { val controllerApi = ControllerApi.createCoroutineApi() val groups = controllerApi.getGroups().getAllGroups() println(groups) } ``` -------------------------------- ### Create a Proxy or Server Group Source: https://docs.simplecloud.app/manual/setup/groups/create-groups Use this command to initiate the creation of a new group via the interactive wizard. ```bash simplecloud create group ``` -------------------------------- ### Template Trigger Actions (YAML) Source: https://docs.simplecloud.app/concepts/serverhost/template-actions Defines actions to be executed on server start and stop triggers within a template. Actions are listed in order of execution. ```yaml when: start: - default/setup # references the default/setup action - ... stop: - default/delete # references the default/delete action - ... ``` -------------------------------- ### List Servers Source: https://docs.simplecloud.app/concepts/cli Shows all running and stopped servers in the cloud system. ```bash simplecloud info servers ``` -------------------------------- ### List Connections Source: https://docs.simplecloud.app/concepts/cli Retrieves a list of all configured cloud connections. ```bash simplecloud info connections ``` -------------------------------- ### Info Connections Command Source: https://docs.simplecloud.app/concepts/cli Lists all configured cloud connections. ```APIDOC ## Info Connections Command ### Description List all configured cloud connections. ### Endpoint ``` simplecloud info connections ``` ``` -------------------------------- ### Configure Network Join Targets Source: https://docs.simplecloud.app/manual/plugins/server-connection Enables and configures the initial server connections for players joining the network. Includes a message for when no targets are found. ```yaml network-join-targets: enabled: true no-target-connections-found-message: "No target servers available." target-connections: - name: "lobby" priority: 0 ``` -------------------------------- ### Serverhost Configuration - default.yml Source: https://docs.simplecloud.app/concepts/serverhost Configure JVM settings, server runtime options, and ignore flags for a server group. Placeholders like %MIN_MEMORY% can be used. ```yaml # start arguments jvm: executable: C:\Program Files\Java\jdk-17.0.5\bin\java options: [-Xms%MIN_MEMORY%M, -Xmx%MAX_MEMORY%M, -Dcom.mojang.eula.agree=true, -jar] arguments: [nogui] # whether the group is ignored by the Serverhost ignore: false # path to a custom running/temp directory for this group parentDir: null ``` -------------------------------- ### Configure Server Info (MOTD) Layouts Source: https://docs.simplecloud.app/manual/plugins/proxy-essentials Define multiple MOTD layouts in the `layout/` folder for dynamic server information. Actual player slots are displayed during local testing due to controller health checks. ```yaml first-lines: - A simplecloud.app network second-lines: - " " player-info: [] version-name: "" max-player-display-type: REAL # or DYNAMIC dynamic-player-range: 1 # Only enabled if max-player-display-type is DYNAMIC ``` -------------------------------- ### Configure Join Connections Source: https://docs.simplecloud.app/manual/setup/groups/configure-lobby Enable and configure the join connection logic to route players to the lobby. ```yaml join-connections: enabled: true no-target-connections-found-message: "Couldn't connect you to the network because no target servers are available." target-connections: - name: "lobby" # The name of the connection target you configured above priority: 0 ``` -------------------------------- ### Configure plugin.yml Source: https://docs.simplecloud.app/developers/getting-started/paper Add the simplecloud-api dependency to your plugin.yml to ensure the plugin loads after the SimpleCloud API. ```YAML name: simplecloud-example-paper version: 1.0.0 main: app.simplecloud.examples.plugin.paper.PaperExamplePlugin depend: [simplecloud-api] ``` -------------------------------- ### Server Registration Plugin Configuration Source: https://docs.simplecloud.app/manual/plugins/server-registration Configure server naming patterns and ignored groups for the server registration plugin. Use placeholders like %GROUP% and %ID% for dynamic naming. Specify server groups to exclude from registration. ```yaml server-name-pattern: "%GROUP%-%NUMERICAL_ID%" # Available placeholders: # %GROUP% - Group name # %ID% - Unique server ID # %NUMERICAL_ID% - Numerical server ID # Ignored server groups ignore-server-groups: - "bedwars" - "skywars" # Additional non-cloud servers additional-servers: - name: "build" address: "127.0.0.1" port: 25565 ``` -------------------------------- ### Connect Player API with Secret Token Source: https://docs.simplecloud.app/developers/droplets/player/initialization Initializes the API by providing a specific secret key string. ```Kotlin val playerApi = PlayerApi.createCoroutineApi("your-secret-key") ``` -------------------------------- ### Define Connection Targets Source: https://docs.simplecloud.app/manual/plugins/server-connection Configure how servers are matched and accessed. Supports name matching and access rules like permissions or environment variables. ```yaml connections: # Match servers starting with "lobby" - name: "lobby" server-name-matcher: operation: "STARTS_WITH" value: "lobby" # Match specific server with access rules - name: "skyblock-spawn" server-name-matcher: operation: "EQUALS" value: "sb-spawn" rules: # Permission rule - type: "PERMISSION" name: "network.join.skyblock" value: "true" # Environment variable rule - type: "ENV" name: "SKYBLOCK_JOIN_STATE" value: "maintenance" operation: "EQUALS" negate: true bypassPermission: "rank.admin" ``` -------------------------------- ### Add Dependencies to build.gradle Source: https://docs.simplecloud.app/developers/getting-started/paper Include the SimpleCloud and Paper repositories and dependencies in your build configuration. ```Groovy repositories { maven("https://repo.simplecloud.app/snapshots") maven("https://buf.build/gen/maven") maven("https://repo.papermc.io/repository/maven-public/") } dependencies { compileOnly("app.simplecloud.api.platform:spigot:latest") compileOnly("io.papermc.paper:paper-api:1.21.5-R0.1-SNAPSHOT") } ``` -------------------------------- ### Info Servers Command Source: https://docs.simplecloud.app/concepts/cli Shows all running and stopped servers in the cloud system. ```APIDOC ## Info Servers Command ### Description Show all running and stopped servers in the cloud system. ### Endpoint ``` simplecloud info servers ``` ``` -------------------------------- ### Create Group Source: https://docs.simplecloud.app/manual/setup/groups/create-groups This section covers the creation of both proxy and server groups using the SimpleCloud CLI. The same command is used for both, with flags determining the group type and configuration. ```APIDOC ## Create Group ### Description Creates a new group for managing servers or proxies within SimpleCloud. This command can be used interactively or with flags for direct configuration. ### Method CLI Command ### Endpoint `simplecloud create group` ### Parameters #### Flags - **`--configurator`** (string) - Server configurator - **`--max-memory`** (string) - Maximum memory allocation for each server - **`--max-online`** (string) - Maximum number of servers that can be online - **`--max-players`** (string) - Maximum players per server - **`--min-memory`** (string) - Minimum memory allocation for each server - **`--min-online`** (string) - Minimum number of servers that must be online - **`--name`** (string) - Group name - **`--port`** (string) - Starting port number for servers - **`--server-url`** (string) - Server software download URL (optional) - **`--software`** (string) - Server software type - **`--template`** (string) - Template type (`dynamic` or `static`) - **`--type`** (string) - Server type (`PROXY` or `SERVER`) - **`--minecraft-version`** (string) - Minecraft version - **`--software-version`** (string) - Server Software version ### Request Example ```bash simplecloud create group --name MyProxyGroup --type PROXY --software Velocity --max-players 100 simplecloud create group --name MyServerGroup --type SERVER --software Paper --minecraft-version 1.19.4 --template dynamic ``` ### Response (CLI command output indicating success or failure) ``` -------------------------------- ### Create Group Command Source: https://docs.simplecloud.app/concepts/cli Creates a new server group with specified configuration. ```APIDOC ## Create Group Command ### Description Create a new server group with specified configuration. ### Endpoint ``` simplecloud create group [flags] ``` ### Parameters #### Flags - `--configurator` (string): Server configurator - `--max-memory` (string): Maximum memory allocation for each server - `--max-online` (string): Maximum number of servers that can be online - `--max-players` (string): Maximum players per server - `--min-memory` (string): Minimum memory allocation for each server - `--min-online` (string): Minimum number of servers that must be online - `--name` (string): Group name - `--port` (string): Starting port number for servers - `--server-url` (string): Server software download URL (optional) - `--software` (string): Server software type - `--template` (string): Template type (`dynamic` or `static`) - `--type` (string): Server type (`PROXY` or `SERVER`) - `--minecraft-version` (string): Minecraft version - `--software-version` (string): Server Software version **Note:** When all flags are set (except `--server-url`), the interactive setup wizard will be skipped. The server URL will be automatically set to the default URL for the selected software and software version. ``` -------------------------------- ### Implement SimpleCloud API in BungeeCord Plugin Source: https://docs.simplecloud.app/developers/getting-started/bungeecord Initialize the ControllerApi and perform asynchronous operations within the plugin lifecycle. ```Kotlin import app.simplecloud.controller.api.ControllerApi import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import net.md_5.bungee.api.plugin.Plugin class BungeeCordExamplePlugin : Plugin() { private val controllerApi = ControllerApi.createCoroutineApi() override fun onEnable() { logger.info("Hello from BungeeCord!") CoroutineScope(Dispatchers.IO).launch { val groups = controllerApi.getGroups().getAllGroups() logger.info("Groups: $groups") } } } ``` -------------------------------- ### Retrieve Servers via API Source: https://docs.simplecloud.app/developers/controller/servers Methods for fetching server instances by ID, group, numerical ID, or type. ```Kotlin // Get all servers val allServers = controllerApi.getServers().getAllServers() // Get server by ID val server = controllerApi.getServers().getServerById("server-uuid") // Get servers by group name val lobbyServers = controllerApi.getServers().getServersByGroup("lobby") // Get server by group name and numerical ID val specificServer = controllerApi.getServers().getServersByNumerical("lobby", 1) // Get servers by type val proxyServers = controllerApi.getServers().getServersByType(ServerType.PROXY) ``` -------------------------------- ### Configure Build Dependencies for BungeeCord Source: https://docs.simplecloud.app/developers/getting-started/bungeecord Add the required repositories and dependencies to your build configuration. Use compileOnly to ensure the API is not bundled into your plugin. ```Kotlin repositories { maven("https://repo.simplecloud.app/snapshots") maven("https://buf.build/gen/maven") maven("https://oss.sonatype.org/content/repositories/snapshots/") } dependencies { compileOnly("app.simplecloud.api.platform:bungeecord:latest") compileOnly("net.md-5:bungeecord-api:1.20-R0.1-SNAPSHOT") } ``` -------------------------------- ### Configure Commands Source: https://docs.simplecloud.app/manual/setup/groups/configure-lobby Define custom commands to allow players to manually connect to the lobby. ```yaml commands: - name: "lobby" # The name of the command aliases: - "l" - "hub" - "quit" - "leave" target-connections: - name: "lobby" # The name of the above configured connection target priority: 0 already-connected-message: "§cYou are already connected to the lobby!" no-target-connections-found-message: "There are no lobby servers available at the moment." permission: "" # No permission required ``` -------------------------------- ### Connection Command Source: https://docs.simplecloud.app/concepts/cli Shows the current connection details. ```APIDOC ## Connection Command ### Description Shows the current connection. ### Endpoint ``` simplecloud connection ``` ``` -------------------------------- ### Create a Group Source: https://docs.simplecloud.app/developers/controller/groups Instantiate a Group object with configuration parameters and register it using the createGroup method. ```Kotlin val group = Group( name = "lobby", type = ServerType.SERVER, minMemory = 512, maxMemory = 1024, startPort = 25565, minOnlineCount = 1, maxOnlineCount = 5, maxPlayers = 100, newServerPlayerRatio = 50, properties = mapOf("gamemode" to "LOBBY") ) val createdGroup = controllerApi.getGroups().createGroup(group) ``` -------------------------------- ### Action: infer Source: https://docs.simplecloud.app/concepts/serverhost/template-actions Infers data from the current server into placeholders. ```APIDOC ## infer ### Description This infers data from the current server into placeholders. ### Parameters #### Request Body - **field** (string) - Required - Field of server object to infer the value from (if starts with $. the servers properties are targeted instead of the server itself) - **key** (string) - Required - Placeholder key to override - **lowercase** (boolean) - Optional - Whether to lowercase the value or not (default false) ``` -------------------------------- ### Define Navigation Commands Source: https://docs.simplecloud.app/manual/plugins/server-connection Create custom commands for players to navigate between servers. Supports aliases, priority-based target connections, and custom messages. ```yaml commands: - name: "lobby" aliases: ["hub"] target-connections: - name: "lobby" priority: 0 already-connected-message: "Already in lobby!" no-target-connections-found-message: "No lobby servers available." permission: "command.lobby" # Optional ``` -------------------------------- ### Query Players using Player API Source: https://docs.simplecloud.app/developers/droplets/player/player-management Use these methods to retrieve player information. Ensure the Player API is initialized before use. ```kotlin // Get an offline player val player = playerApi.getOfflinePlayer("Steve") println("Player ${player.name} first joined at ${player.firstLogin}") // Get an online player val onlinePlayer = playerApi.getOnlinePlayer("Steve") println("Player ${onlinePlayer.name} is on server ${onlinePlayer.connectedServerName}") // Get all online players val players = playerApi.getOnlinePlayers() players.forEach { player -> println("${player.name} on ${player.connectedServerName}") } // Get online player count val count = playerApi.getOnlinePlayerCount() println("Online players: $count") // Check if player is online val isOnline = playerApi.isOnline(uniqueId) println("Player online: $isOnline") ``` -------------------------------- ### Configure Fallback Connections Source: https://docs.simplecloud.app/manual/setup/groups/configure-lobby Set up fallback behavior to ensure players are redirected to the lobby if kicked or disconnected. ```yaml fallback-connections: enabled: true no-target-connections-found-message: "You have been disconnected from the network since you have been kicked and no fallback server are available." target-connections: - name: "lobby" # The name of the connection target you configured above priority: 0 ``` -------------------------------- ### Initialize Controller API with Default Configuration Source: https://docs.simplecloud.app/developers/controller/initialization Use this method when the CONTROLLER_SECRET environment variable is set. It automatically configures the API with the default secret token. ```kotlin val controllerApi = ControllerApi.createCoroutineApi() ``` -------------------------------- ### Info Groups Command Source: https://docs.simplecloud.app/concepts/cli Displays all configured server groups and their basic information. ```APIDOC ## Info Groups Command ### Description Display all configured server groups and their basic information. ### Endpoint ``` simplecloud info groups ``` ``` -------------------------------- ### Access Default Environment Variables Source: https://docs.simplecloud.app/developers/controller/servers Retrieve standard server metadata directly from system environment variables without API initialization. ```Kotlin val group = System.getenv("SIMPLECLOUD_GROUP") val uniqueId = System.getenv("SIMPLECLOUD_UNIQUE_ID") val numericalId = System.getenv("SIMPLECLOUD_NUMERICAL_ID") val host = System.getenv("SIMPLECLOUD_HOST") val ip = System.getenv("SIMPLECLOUD_IP") val port = System.getenv("SIMPLECLOUD_PORT") val type = System.getenv("SIMPLECLOUD_TYPE") val maxPlayers = System.getenv("SIMPLECLOUD_MAX_PLAYERS") val maxMemory = System.getenv("SIMPLECLOUD_MAX_MEMORY") val minMemory = System.getenv("SIMPLECLOUD_MIN_MEMORY") val createdAt = System.getenv("SIMPLECLOUD_CREATED_AT") ``` -------------------------------- ### Create Group Source: https://docs.simplecloud.app/developers/controller/groups Creates a new server group with specified configuration parameters. ```APIDOC ## POST createGroup ### Description Creates a new server group instance. ### Method POST ### Request Body - **name** (String) - Required - Name of the group - **type** (ServerType) - Required - Type of the server - **minMemory** (Int) - Required - Minimum memory allocation - **maxMemory** (Int) - Required - Maximum memory allocation - **startPort** (Int) - Required - Starting port number - **minOnlineCount** (Int) - Required - Minimum online servers - **maxOnlineCount** (Int) - Required - Maximum online servers - **maxPlayers** (Int) - Required - Maximum player capacity - **newServerPlayerRatio** (Int) - Required - Player ratio for new servers - **properties** (Map) - Optional - Additional group properties ### Request Example val group = Group(name = "lobby", type = ServerType.SERVER, minMemory = 512, maxMemory = 1024, startPort = 25565, minOnlineCount = 1, maxOnlineCount = 5, maxPlayers = 100, newServerPlayerRatio = 50, properties = mapOf("gamemode" to "LOBBY")) ```