Last active
May 28, 2024 15:59
-
-
Save dadencukillia/a76b778e1e2e874e54b4841df17a115f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type nickname = string; | |
type uuid = string; | |
type identifier = string; | |
// For GET /users | |
type UsersResponse = nickname[]; | |
// For GET /user/{nickname} | |
type UserResponse = { | |
nickname: nickname, | |
UUID: uuid, | |
isInWorld: boolean, | |
world?: World, | |
players: Player[], | |
entities: Entity[] | |
}; | |
type World = { | |
difficulty: "easy"|"hard"|"normal"|"peaceful", | |
worldName: string[], | |
isDay: boolean, | |
weather: "rain"|"thunder"|"clear", | |
timeOfDay: number, | |
time: number, | |
type: "overworld"|"theNether"|"theEnd"|"custom", | |
isServer: boolean, | |
server?: Server | |
}; | |
type Player = { | |
skinUrl: string, | |
isSkinSlim: boolean, | |
nickname: nickname, | |
UUID: uuid, | |
position: [number, number, number], | |
gamemode: "spectator"|"creative"|"survival", // adventure mode is considered as survival mode | |
lightLevelAtPlayer: number, | |
luminaceAtPlayer: number, | |
blockUnder: identifier, | |
holdingItem: identifier | |
}; | |
type Entity = { | |
id: number, | |
typeName: identifier, | |
position: [number, number, number] | |
}; | |
type Server = { | |
isLocal: boolean, | |
isRealm: boolean, | |
address: string, | |
currentPing: number, | |
name: string, | |
motd: string | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment