mirror of
https://github.com/JonasunderscoreJones/wiki.jonasjones.dev.git
synced 2025-10-22 22:09:17 +02:00
Moved References to their own pages
This commit is contained in:
parent
8583dcb8bf
commit
313a919f16
20 changed files with 284 additions and 0 deletions
5
src/routes/McWebserver/Web-API/Advanced-API/+page.md
Normal file
5
src/routes/McWebserver/Web-API/Advanced-API/+page.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Advanced API
|
||||||
|
---
|
||||||
|
This is still WIP and is unreleased.
|
||||||
|
In the future it will be possible to get more information about players, their ingame coordinates, inventory, etc.
|
||||||
|
Stay tuned for updates!
|
7
src/routes/McWebserver/Web-API/Simple-API/+page.md
Normal file
7
src/routes/McWebserver/Web-API/Simple-API/+page.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# Simple API
|
||||||
|
---
|
||||||
|
This API allows you to gather the most surface-level information about your server.
|
||||||
|
|
||||||
|
**All API calls have the prefix `/api/v1/`.**
|
||||||
|
|
||||||
|
The supported API calls are listed in the [Reference List](/McWebserver/Web-API/Simple-API/References).
|
34
src/routes/McWebserver/Web-API/Simple-API/Errors/+page.md
Normal file
34
src/routes/McWebserver/Web-API/Simple-API/Errors/+page.md
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# Errors
|
||||||
|
---
|
||||||
|
When interacting with the API some errors can occur.
|
||||||
|
|
||||||
|
## Bad Request
|
||||||
|
- Occurs when a request doesn't exist
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/getmotd
|
||||||
|
```
|
||||||
|
In this example the request is wrong. `getmotd` isn't a valid request.
|
||||||
|
- Response
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"error": {
|
||||||
|
"status": 400,
|
||||||
|
"message": "Bad Request"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Internal Server Error
|
||||||
|
- Occurs when something unexpected happens internally while handling the request. This most likely has nothing to do with you.
|
||||||
|
|
||||||
|
One possible way of getting the error message is to send the request before the server has fully started, e.g. while it's still loading the world.
|
||||||
|
|
||||||
|
- Response
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"error": {
|
||||||
|
"status": 500,
|
||||||
|
"message": "Internal Server Error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
|
@ -0,0 +1,18 @@
|
||||||
|
# References
|
||||||
|
---
|
||||||
|
- [Current-Player-Names](/McWebserver/Web-API/Simple-API/References/Current-Player-Names)
|
||||||
|
- [Default-Gamemode](/McWebserver/Web-API/Simple-API/References/Default-Gamemode)
|
||||||
|
- [Favicon](/McWebserver/Web-API/Simple-API/References/Favicon)
|
||||||
|
- [Get-All](/McWebserver/Web-API/Simple-API/References/Get-All)
|
||||||
|
- [IP-Address](/McWebserver/Web-API/Simple-API/References/IP-Address)
|
||||||
|
- [Loader-Version](/McWebserver/Web-API/Simple-API/References/Loader-Version)
|
||||||
|
- [MC-Version](/McWebserver/Web-API/Simple-API/References/MC-Version)
|
||||||
|
- [MOTD](/McWebserver/Web-API/Simple-API/References/MOTD)
|
||||||
|
- [Max-Player-Count](/McWebserver/Web-API/Simple-API/References/Max-Player-Count)
|
||||||
|
- [Metadata](/McWebserver/Web-API/Simple-API/References/Metadata)
|
||||||
|
- [Name](/McWebserver/Web-API/Simple-API/References/Name)
|
||||||
|
- [Player-Count](/McWebserver/Web-API/Simple-API/References/Player-Count)
|
||||||
|
- [Port](/McWebserver/Web-API/Simple-API/References/Port)
|
||||||
|
- [Ticks](/McWebserver/Web-API/Simple-API/References/Ticks)
|
||||||
|
- [Ticktime](/McWebserver/Web-API/Simple-API/References/Ticktime)
|
||||||
|
- [Time-Reference](/McWebserver/Web-API/Simple-API/References/Time-Reference)
|
|
@ -0,0 +1,16 @@
|
||||||
|
## Server Current Player Names
|
||||||
|
---
|
||||||
|
- Returns the Server's currently online players
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/playernames
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"ID": "c888eef5-edb7-4ceb-bbf3-987731de9747",
|
||||||
|
"NAME": "Jonas_Jones"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
NOTE: *v0.3.0 returns an additional property* `LEGACY` *for every player that states whether or not the account is a legacy account or not. Since mc 1.20.2 and the mod release 0.3.1 this was removed due to the end of the account migration period, where all legacy accounts were migrated to microsoft accounts. (This property is now always false and thus redundant)*
|
|
@ -0,0 +1,18 @@
|
||||||
|
## Server Default Gamemode
|
||||||
|
---
|
||||||
|
- Returns the Server's default gamemode
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/defaultgamemode
|
||||||
|
```
|
||||||
|
- Responses:
|
||||||
|
```json
|
||||||
|
["SURVIVAL"]
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```json
|
||||||
|
["CREATIVE"]
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```json
|
||||||
|
["SPECTATOR"]
|
||||||
|
```
|
|
@ -0,0 +1,8 @@
|
||||||
|
## Server Favicon
|
||||||
|
---
|
||||||
|
- Returns the server icon image in form of a png
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/favicon
|
||||||
|
```
|
||||||
|
- Response
|
||||||
|
[image/png]
|
|
@ -0,0 +1,39 @@
|
||||||
|
## Server Get All
|
||||||
|
---
|
||||||
|
- Returns the Server's entire data of the Simple API
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/getall
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"SERVER_IP": "",
|
||||||
|
"SERVER_PORT": 25565,
|
||||||
|
"SERVER_NAME": "Server",
|
||||||
|
"DEFAULT_GAME_MODE": "SURVIVAL",
|
||||||
|
"LOADER_VERSION": "0.14.22",
|
||||||
|
"METADATA": {
|
||||||
|
"DESCRIPTION": "A Minecraft Server",
|
||||||
|
"PLAYERS": {
|
||||||
|
"MAX": 20,
|
||||||
|
"ONLINE": 1,
|
||||||
|
"SAMPLE": [
|
||||||
|
{
|
||||||
|
"ID": "00000000-0000-0000-0000-000000000000",
|
||||||
|
"NAME": "Anonymous Player"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"VERSION": {
|
||||||
|
"version": "1.20.1",
|
||||||
|
"protocol": 763
|
||||||
|
},
|
||||||
|
"FAVICON": "/api/v1/servericon",
|
||||||
|
"SECURE_CHAT_EINFORCED": true
|
||||||
|
},
|
||||||
|
"TICKS": 29066,
|
||||||
|
"TICK_TIME": 4.6665154,
|
||||||
|
"TIME_REFERENCE": 29606414
|
||||||
|
}
|
||||||
|
```
|
||||||
|
NOTE: *v0.3.0 returns an additional property* `LEGACY` *for every player that states whether or not the account is a legacy account or not. Since mc 1.20.2 and the mod release 0.3.1 this was removed due to the end of the account migration period, where all legacy accounts were migrated to microsoft accounts. (This property is now always false and thus redundant)*
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server IP Address
|
||||||
|
---
|
||||||
|
- Returns the Server's port
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/serverport
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["25565"]
|
||||||
|
```
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server Loader Version
|
||||||
|
---
|
||||||
|
- Returns the Mod-loader version
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/loaderversion
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["0.14.22"]
|
||||||
|
```
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server MC Version
|
||||||
|
---
|
||||||
|
- Returns the Server's Minecraft Version
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/serverversion
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["1.20.1"]
|
||||||
|
```
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server MOTD
|
||||||
|
---
|
||||||
|
- Returns the Server MOTD
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/motd
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["A Minecraft Server"]
|
||||||
|
```
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server Max Player Count
|
||||||
|
---
|
||||||
|
- Returns the Server's maximum player allowance
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/maxplayercount
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["20"]
|
||||||
|
```
|
|
@ -0,0 +1,29 @@
|
||||||
|
## Server Metadata
|
||||||
|
---
|
||||||
|
- Returns the Server's Metadata. This includes all the information that is also being sent to a Minecraft client when pinging the server.
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/servermetadata
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"DESCRIPTION": "A Minecraft Server",
|
||||||
|
"PLAYERS": {
|
||||||
|
"MAX":20,
|
||||||
|
"ONLINE":1,
|
||||||
|
"SAMPLE": [
|
||||||
|
{
|
||||||
|
"ID": "00000000-0000-0000-0000-000000000000",
|
||||||
|
"NAME": "Anonymous Player"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"VERSION": {
|
||||||
|
"version": "1.20.1",
|
||||||
|
"protocol": 763
|
||||||
|
},
|
||||||
|
"FAVICON": "/api/v1/servericon",
|
||||||
|
"SECURE_CHAT_EINFORCED":true
|
||||||
|
}
|
||||||
|
```
|
||||||
|
NOTE: *v0.3.0 returns an additional property* `LEGACY` *for every player that states whether or not the account is a legacy account or not. Since mc 1.20.2 and the mod release 0.3.1 this was removed due to the end of the account migration period, where all legacy accounts were migrated to microsoft accounts. (This property is now always false and thus redundant)*
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server Name
|
||||||
|
---
|
||||||
|
- Returns the Server's Name, if set in the server's `server.properties` file, or else returns an empty string
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/servername
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["Server"]
|
||||||
|
```
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server Player Count
|
||||||
|
---
|
||||||
|
- Returns the current player count.
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/currentplayercount
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["0"]
|
||||||
|
```
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server Port
|
||||||
|
---
|
||||||
|
- Returns the Server MOTD
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/motd
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["A Minecraft Server"]
|
||||||
|
```
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server Ticks
|
||||||
|
---
|
||||||
|
- Returns the Server's tick count
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/ticks
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["20456"]
|
||||||
|
```
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server Ticktime
|
||||||
|
---
|
||||||
|
- Returns the Server's time it takes to process a single tick in Milliseconds
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/ticktime
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["0.1235235"]
|
||||||
|
```
|
|
@ -0,0 +1,10 @@
|
||||||
|
## Server Time Reference
|
||||||
|
---
|
||||||
|
- Returns the Server's in-game time of the day of the overworld
|
||||||
|
```
|
||||||
|
http://localhost:8080/api/v1/timereference
|
||||||
|
```
|
||||||
|
- Response:
|
||||||
|
```json
|
||||||
|
["20"]
|
||||||
|
```
|
Loading…
Add table
Add a link
Reference in a new issue