Skip to content

Instantly share code, notes, and snippets.

@dadencukillia
Last active May 28, 2024 15:59
Show Gist options
  • Save dadencukillia/a76b778e1e2e874e54b4841df17a115f to your computer and use it in GitHub Desktop.
Save dadencukillia/a76b778e1e2e874e54b4841df17a115f to your computer and use it in GitHub Desktop.
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