Players
Base: /api/players
Manage online players, retrieve information, kick, teleport
Handler: PlayersHandler
Endpoints
GET
/api/players
List Players
List of all currently online players with details.
Response Example
[{"name":"Steve","uuid":"550e8400-e29b-41d4-a716-446655440000","health":20,"position":{"x":100.5,"y":64.0,"z":-200.3},"world":"overworld","gamemode":"survival","ping":45}]
cURL
curl http://localhost:5550/api/players
Internal Behavior
Iterates over all online player objects of the server.
GET
/api/players/{name}
Player Details
Detailed information about a specific player.
Parameter
| Name | Type | Required | Description |
|---|---|---|---|
name
|
string | Yes | Player name |
Response Example
{"name":"Steve","uuid":"550e8400-e29b-41d4-a716-446655440000","health":20,"max_health":20,"food":18,"level":15,"exp":0.5,"position":{"x":100.5,"y":64.0,"z":-200.3},"world":"overworld","gamemode":"survival","ping":45,"ip":"192.168.1.10","is_op":false}
cURL
curl http://localhost:5550/api/players/Steve
POST
/api/players/{name}/kick
Kick Player
Removes a player from the server.
Parameter
| Name | Type | Required | Description |
|---|---|---|---|
name
|
string | Yes | Player name |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
reason
|
string | No | Kick reason (shown to the player) |
Response Example
{"success":true,"message":"Player Steve has been kicked"}
cURL
curl -X POST http://localhost:5550/api/players/Steve/kick \
-H 'Content-Type: application/json' \
-d '{"reason":"Regelverstoß"}'
Internal Behavior
Calls player.kick(reason) on the server thread.
The player sees the reason on the disconnect screen.
The player sees the reason on the disconnect screen.
POST
/api/players/{name}/teleport
Teleport Player
Teleports a player to specific coordinates.
Parameter
| Name | Type | Required | Description |
|---|---|---|---|
name
|
string | Yes | Player name |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
x
|
number | Yes | X coordinate |
y
|
number | Yes | Y coordinate |
z
|
number | Yes | Z coordinate |
world
|
string | No | Target world (default: current world) |
Response Example
{"success":true,"message":"Player Steve teleported to 100.0, 64.0, -200.0"}
cURL
curl -X POST http://localhost:5550/api/players/Steve/teleport \
-H 'Content-Type: application/json' \
-d '{"x":100,"y":64,"z":-200}'
Internal Behavior
Teleportation is executed on the server main thread (thread-safe).
POST
/api/players/{name}/gamemode
Change Game Mode
Changes the game mode of a player.
Parameter
| Name | Type | Required | Description |
|---|---|---|---|
name
|
string | Yes | Player name |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
mode
|
string | Yes | Game mode: survival, creative, adventure, spectator |
Response Example
{"success":true,"message":"Gamemode of Steve set to creative"}
cURL
curl -X POST http://localhost:5550/api/players/Steve/gamemode \
-H 'Content-Type: application/json' \
-d '{"mode":"creative"}'