Initialization
Before you can use the Servers API, you need to initialize the Controller API. Please refer to the Initialization guide for more information. After initializing the Controller API, you can usecontrollerApi.getServers() to access the Servers API.
Get Servers
There are multiple ways to get servers from the API:- Kotlin
- Java
Start Servers
You can start a new server by specifying the group name and optionally a start cause:- Kotlin
- Java
Stop Servers
There are multiple ways to stop servers:- Kotlin
- Java
Update Servers
There are several ways to update server properties:- Kotlin
- Java
Current Server Information
There are two ways to get information about the current server your code is running on:Using the API
You can use thegetCurrentServer() method to get information about the current server:
- Kotlin
- Java
Using Environment Variables
SimpleCloud automatically provides environment variables that you can access without initializing the API. These variables are available in two categories:Default Variables
The following environment variables are always available for every server:- Kotlin
- Java
Custom Properties
Any custom properties defined in your group configuration are automatically available as environment variables. The property names are:- Prefixed with
SIMPLECLOUD_ - Converted to uppercase
- Have dashes (
-) replaced with underscores (_)
- Kotlin
- Java