https://github.com/explodingcamera/minecraft-restadmin
A RESTful API for managing Minecraft servers
https://github.com/explodingcamera/minecraft-restadmin
Last synced: 5 months ago
JSON representation
A RESTful API for managing Minecraft servers
- Host: GitHub
- URL: https://github.com/explodingcamera/minecraft-restadmin
- Owner: explodingcamera
- License: mit
- Created: 2024-09-05T20:05:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-04T17:08:55.000Z (about 1 year ago)
- Last Synced: 2024-11-04T18:21:00.726Z (about 1 year ago)
- Language: Kotlin
- Homepage:
- Size: 58.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RestAdmin
A RESTful API for managing a Minecraft server. Supports Minecraft 1.21.1 with the [Fabric](https://fabricmc.net/) mod loader.
Currently very limited in functionality.
## Authentication
All endpoints require a valid `Authorization` header with the format:
```
Authorization: Bearer
```
The token must be at least 12 characters long and can be set in `./config/restadmin.json`.
```json
{
"port": 7070,
"host": "0.0.0.0",
"token": "your_token_here"
}
```
## Endpoints
### General
#### Get Connected Players
- **GET** `/players`
- **Description**: Retrieves the list of connected players.
- **Response**: JSON array of [Player](#player) objects.
### Whitelist
#### Get Whitelist
- **GET** `/whitelist`
- **Description**: Retrieves the list of whitelisted players.
- **Response**: JSON array of player names.
#### Check Whitelist Status
- **GET** `/whitelist/{username_or_uuid}`
- **Description**: Checks if a player (by username or UUID) is on the whitelist.
- **Response**: [Player](#player) object.
#### Add to Whitelist
- **POST** `/whitelist/{username_or_uuid}`
- **Description**: Adds a player (by username or UUID) to the whitelist.
- **Response**: [Player](#player) object.
#### Remove from Whitelist
- **DELETE** `/whitelist/{username_or_uuid}`
- **Description**: Removes a player (by username or UUID) from the whitelist.
- **Response**: [Player](#player) object.
## Types
### Player
```ts
type Player = {
name: string;
id: string;
};
```