Methods
Connection (Main)
| Method | Parameters | Returns | Meaning |
|---|---|---|---|
ConnectAsync |
CancellationToken ct = default |
Task |
Connect to the server. |
DisconnectAsync |
— | Task |
Disconnect from the server. |
Discover
| Method | Parameters | Returns | Meaning |
|---|---|---|---|
GetDiscoverAsync |
CancellationToken stopToken |
Task<string> |
Raw discovery JSON/description from the management API. |
Allowlist
| Method | Parameters | Returns | Meaning |
|---|---|---|---|
GetAllowlistAsync |
CancellationToken ct = default |
Task<List<Player>> |
Current allowlisted players. |
SetAllowlistAsync |
IEnumerable<Player> players, CancellationToken ct = default |
Task<List<Player>> |
Replace allowlist with players; returns resulting allowlist. |
AddToAllowlistAsync |
IEnumerable<Player> add, CancellationToken ct = default |
Task<List<Player>> |
Add multiple players; returns resulting allowlist. |
AddToAllowlistAsync |
Player add, CancellationToken ct = default |
Task<List<Player>> |
Add one player; returns resulting allowlist. |
RemoveFromAllowlistAsync |
IEnumerable<Player> remove, CancellationToken ct = default |
Task<List<Player>> |
Remove multiple; returns resulting allowlist. |
RemoveFromAllowlistAsync |
Player remove, CancellationToken ct = default |
Task<List<Player>> |
Remove one; returns resulting allowlist. |
ClearAllowlistAsync |
CancellationToken ct = default |
Task<List<Player>> |
Clear all; returns resulting (empty) allowlist. |
Bans (User)
| Method | Parameters | Returns | Meaning |
|---|---|---|---|
GetBansAsync |
CancellationToken ct = default |
Task<List<UserBan>> |
Current user bans. |
SetBansAsync |
IEnumerable<UserBan> bans, CancellationToken ct = default |
Task<List<UserBan>> |
Replace ban list; returns resulting bans. |
AddBansAsync |
IEnumerable<UserBan> add, CancellationToken ct = default |
Task<List<UserBan>> |
Add multiple bans; returns resulting bans. |
AddBanAsync |
UserBan add, CancellationToken ct = default |
Task<List<UserBan>> |
Add one ban; returns resulting bans. |
RemoveBansAsync |
IEnumerable<Player> remove, CancellationToken ct = default |
Task<List<UserBan>> |
Remove bans for multiple players; returns resulting bans. |
RemoveBanAsync |
Player remove, CancellationToken ct = default |
Task<List<UserBan>> |
Remove ban for one player; returns resulting bans. |
ClearBansAsync |
CancellationToken ct = default |
Task<List<UserBan>> |
Clear all user bans; returns resulting (empty) list. |
Bans (IP)
| Method | Parameters | Returns | Meaning |
|---|---|---|---|
GetIpBansAsync |
CancellationToken ct = default |
Task<List<IpBan>> |
Current IP bans. |
SetIpBansAsync |
IEnumerable<IpBan> banlist, CancellationToken ct = default |
Task<List<IpBan>> |
Replace IP ban list; returns resulting bans. |
AddIpBansAsync |
IEnumerable<IncomingIpBan> add, CancellationToken ct = default |
Task<List<IpBan>> |
Add multiple IP bans; returns resulting bans. |
AddIpBanAsync |
IncomingIpBan add, CancellationToken ct = default |
Task<List<IpBan>> |
Add one IP ban; returns resulting bans. |
RemoveIpBansAsync |
IEnumerable<string> ip, CancellationToken ct = default |
Task<List<IpBan>> |
Unban multiple IPs; returns resulting bans. |
RemoveIpBansAsync |
string ip, CancellationToken ct = default |
Task<List<IpBan>> |
Unban single IP; returns resulting bans. |
ClearIpBansAsync |
CancellationToken ct = default |
Task<List<IpBan>> |
Clear all IP bans; returns resulting (empty) list. |
Players
| Method | Parameters | Returns | Meaning |
|---|---|---|---|
GetPlayersAsync |
CancellationToken ct = default |
Task<List<Player>> |
Current online players. |
KickPlayersAsync |
IEnumerable<KickPlayer> kick, CancellationToken ct = default |
Task<List<Player>> |
Kick multiple players; returns current players after kicks. |
KickPlayerAsync |
KickPlayer kick, CancellationToken ct = default |
Task<List<Player>> |
Kick one player; returns current players after kick. |
Operators (OPs)
| Method | Parameters | Returns | Meaning |
|---|---|---|---|
GetOperatorsAsync |
CancellationToken ct = default |
Task<List<Operator>> |
Current operators. |
SetOperatorsAsync |
IEnumerable<Operator> operators, CancellationToken ct = default |
Task<List<Operator>> |
Replace OP list; returns resulting operators. |
AddOperatorsAsync |
IEnumerable<Operator> add, CancellationToken ct = default |
Task<List<Operator>> |
OP multiple players; returns resulting operators. |
AddOperatorAsync |
Operator add, CancellationToken ct = default |
Task<List<Operator>> |
OP one player; returns resulting operators. |
RemoveOperatorsAsync |
IEnumerable<Player> remove, CancellationToken ct = default |
Task<List<Operator>> |
De-OP multiple players; returns resulting operators. |
RemoveOperatorAsync |
Player remove, CancellationToken ct = default |
Task<List<Operator>> |
De-OP one player; returns resulting operators. |
ClearOperatorsAsync |
CancellationToken ct = default |
Task<List<Operator>> |
Clear all operators; returns resulting (empty) list. |
Server Management
| Method | Parameters | Returns | Meaning |
|---|---|---|---|
GetServerStatusAsync |
CancellationToken ct = default |
Task<ServerState> |
Current server status (players, version, etc.). |
SaveServerAsync |
bool flush, CancellationToken ct = default |
Task<bool> |
Trigger a save; true if success. |
StopServerAsync |
CancellationToken ct = default |
Task<bool> |
Gracefully stop server; true if accepted. |
SendSystemMessageAsync |
SystemMessage message, CancellationToken ct = default |
Task<bool> |
Broadcast a system/chat message; true if sent. |
Server Settings
| Method | Parameters | Returns | Meaning |
|---|---|---|---|
GetAutosaveAsync |
CancellationToken ct = default |
Task<bool> |
Whether autosave is enabled. |
SetAutosaveAsync |
bool enable, CancellationToken ct = default |
Task<bool> |
Enable/disable autosave; returns current value. |
GetDifficultyAsync |
CancellationToken ct = default |
Task<Difficulty> |
Current difficulty. |
SetDifficultyAsync |
Difficulty difficulty, CancellationToken ct = default |
Task<Difficulty> |
Set difficulty; returns resulting value. |
GetEnforceAllowlistAsync |
CancellationToken ct = default |
Task<bool> |
Whether allowlist is enforced. |
SetEnforceAllowlistAsync |
bool enforce, CancellationToken ct = default |
Task<bool> |
Set enforcement; returns resulting value. |
GetUseAllowlistAsync |
CancellationToken ct = default |
Task<bool> |
Whether allowlist is used. |
SetUseAllowlistAsync |
bool use, CancellationToken ct = default |
Task<bool> |
Set usage; returns resulting value. |
GetMaxPlayersAsync |
CancellationToken ct = default |
Task<int> |
Max players. |
SetMaxPlayersAsync |
int max, CancellationToken ct = default |
Task<int> |
Set max players; returns resulting value. |
GetPauseWhenEmptySecondsAsync |
CancellationToken ct = default |
Task<int> |
Seconds before server pauses when empty. |
SetPauseWhenEmptySecondsAsync |
int seconds, CancellationToken ct = default |
Task<int> |
Set value; returns resulting seconds. |
GetPlayerIdleTimeoutAsync |
CancellationToken ct = default |
Task<int> |
Idle timeout (seconds); 0 = no timeout. |
SetPlayerIdleTimeoutAsync |
int seconds, CancellationToken ct = default |
Task<int> |
Set value; returns resulting seconds. |
GetAllowFlightAsync |
CancellationToken ct = default |
Task<bool> |
Whether flight is allowed. |
SetAllowFlightAsync |
bool allow, CancellationToken ct = default |
Task<bool> |
Set value; returns resulting value. |
GetMotdAsync |
CancellationToken ct = default |
Task<string> |
Current MOTD. |
SetMotdAsync |
string message, CancellationToken ct = default |
Task<string> |
Set MOTD; returns resulting MOTD. |
GetSpawnProtectionRadiusAsync |
CancellationToken ct = default |
Task<int> |
Spawn protection radius. |
SetSpawnProtectionRadiusAsync |
int radius, CancellationToken ct = default |
Task<int> |
Set radius; returns resulting value. |
GetForceGameModeAsync |
CancellationToken ct = default |
Task<bool> |
Whether default game mode is forced. |
SetForceGameModeAsync |
bool force, CancellationToken ct = default |
Task<bool> |
Set value; returns resulting value. |
GetGameModeAsync |
CancellationToken ct = default |
Task<GameMode> |
Default game mode. |
SetGameModeAsync |
GameMode gameMode, CancellationToken ct = default |
Task<GameMode> |
Set default; returns resulting value. |
GetViewDistanceAsync |
CancellationToken ct = default |
Task<int> |
View distance (chunks). |
SetViewDistanceAsync |
int distance, CancellationToken ct = default |
Task<int> |
Set distance; returns resulting value. |
GetSimulationDistanceAsync |
CancellationToken ct = default |
Task<int> |
Simulation distance (chunks). |
SetSimulationDistanceAsync |
int distance, CancellationToken ct = default |
Task<int> |
Set distance; returns resulting value. |
GetAcceptTransfersAsync |
CancellationToken ct = default |
Task<bool> |
Whether server accepts transfer requests. |
SetAcceptTransfersAsync |
bool accept, CancellationToken ct = default |
Task<bool> |
Set value; returns resulting value. |
GetStatusHeartbeatIntervalAsync |
CancellationToken ct = default |
Task<int> |
Status heartbeat interval (seconds). |
SetStatusHeartbeatIntervalAsync |
int seconds, CancellationToken ct = default |
Task<int> |
Set interval; returns resulting value. |
GetOperatorUserPermissionLevelAsync |
CancellationToken ct = default |
Task<int> |
Required OP permission level. |
SetOperatorUserPermissionLevelAsync |
int level, CancellationToken ct = default |
Task<int> |
Set level; returns resulting value. |
GetHideOnlinePlayersAsync |
CancellationToken ct = default |
Task<bool> |
Whether player count is hidden on server list. |
SetHideOnlinePlayersAsync |
bool hide, CancellationToken ct = default |
Task<bool> |
Set value; returns resulting value. |
GetStatusRepliesAsync |
CancellationToken ct = default |
Task<bool> |
Whether server replies to status pings. |
SetStatusRepliesAsync |
bool enable, CancellationToken ct = default |
Task<bool> |
Set value; returns resulting value. |
GetEntityBroadcastRangeAsync |
CancellationToken ct = default |
Task<int> |
Entity broadcast range (%) |
SetEntityBroadcastRangeAsync |
int percentagePoints, CancellationToken ct = default |
Task<int> |
Set range; returns resulting value. |
Notifications Subscriptions
| Method | Parameters | Returns | Meaning |
|---|---|---|---|
SubscribeServerStartedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to server started events. |
SubscribeServerStoppingAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to server stopping events. |
SubscribeServerSavingAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to server saving events. |
SubscribeServerSavedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to server saved events. |
SubscribePlayerJoinedAsync |
Player[]? players = null, CancellationToken ct = default |
Task<bool> |
Subscribe to player joined (optionally filtered to specific players). |
SubscribePlayerLeftAsync |
Player[]? players = null, CancellationToken ct = default |
Task<bool> |
Subscribe to player left (optionally filtered). |
SubscribeOperatorsAddedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to OP added. |
SubscribeOperatorsRemovedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to OP removed. |
SubscribeAllowlistAddedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to allowlist added. |
SubscribeAllowlistRemovedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to allowlist removed. |
SubscribeIpBansAddedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to IP ban added. |
SubscribeIpBansRemovedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to IP ban removed. |
SubscribeBansAddedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to user ban added. |
SubscribeBansRemovedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to user ban removed. |
SubscribeGamerulesUpdatedAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to gamerule updated. |
SubscribeServerStatusAsync |
CancellationToken ct = default |
Task<bool> |
Subscribe to server status/heartbeat. |