interface server { use player.{player}; /// Represents the difficulty setting of a Minecraft server. enum difficulty { /// Hostile mobs do not spawn. Players regain health automatically. peaceful, /// Hostile mobs deal less damage. easy, /// Standard Minecraft difficulty. normal, /// Hostile mobs deal more damage. hard, } /// Represents the global server instance. resource server { /// Returns the current difficulty level of the server. get-difficulty: func() -> difficulty; /// Returns the total number of players currently connected to the server. get-player-count: func() -> u32; /// Returns the rolling average Milliseconds Per Tick (MSPT). /// A value below 50.0 is required for a stable 20 TPS. get-mspt: func() -> f64; /// Returns the effective Ticks Per Second (TPS). /// Ideal value is 20.0. get-tps: func() -> f64; /// Returns a list of all online players across all worlds. get-all-players: func() -> list; /// Searches for a player by their exact name. get-player-by-name: func(name: string) -> option; /// Searches for a player by their UUID string. get-player-by-uuid: func(id: string) -> option; } }