|
Faucet Mod SDK 1.0.0
Modding API for Minecraft Legacy Console Edition
|
Top-level mod API. Wraps singleton access and common operations. More...
Functions | |
| MinecraftServer * | GetServer () |
| Get the MinecraftServer singleton. | |
| Minecraft * | GetClient () |
| Get the Minecraft client singleton. | |
| ServerLevel * | GetServerLevel (int dimension=0) |
| Get the server-side level for a given dimension. | |
| MultiPlayerLevel * | GetClientLevel (int dimension=0) |
| Get the client-side level for a given dimension. | |
| PlayerList * | GetPlayerList () |
| Get the PlayerList (all connected server players). | |
| MultiplayerLocalPlayer * | GetLocalPlayer () |
| Get the primary local player on the client. | |
| MultiplayerLocalPlayer * | GetLocalPlayer (int index) |
| Get a local player by splitscreen index (0–3). | |
| void | Log (const wstring &message) |
| Write a message to mods/modloader.log and OutputDebugString. | |
| void | LogWarn (const wstring &message) |
| Write a warning to the log (prefixed with [WARN]). | |
| void | LogError (const wstring &message) |
| Write an error to the log (prefixed with [ERROR]). | |
| void | BroadcastMessage (const wstring &message) |
| Send a chat message to all connected players. | |
| void | SendMessageToPlayer (const wstring &playerName, const wstring &message) |
| Send a private chat message to a specific player by name. | |
| void | ExecuteCommand (const wstring &command) |
| Execute a server console command. | |
| void | SetTimeOfDay (__int64 time) |
| Set the world time for a dimension. | |
| void | SaveAll (bool force=false) |
| Save all worlds immediately. | |
| bool | IsPvpAllowed () |
| Check whether PvP is currently allowed on the server. | |
| void | SetPvpAllowed (bool enabled) |
| Enable or disable PvP on the server. | |
| bool | IsFlightAllowed () |
| Check whether flight is allowed on the server. | |
| void | SetFlightAllowed (bool enabled) |
| Enable or disable flight on the server. | |
Top-level mod API. Wraps singleton access and common operations.
You can use these helpers, or call the real game classes directly after obtaining them via SDK::GetServer() / SDK::GetClient().
| void SDK::BroadcastMessage | ( | const wstring & | message | ) |
Send a chat message to all connected players.
Internally calls PlayerList::sendMessage for every connected player.
| message | Wide string message to broadcast. |
| void SDK::ExecuteCommand | ( | const wstring & | command | ) |
Execute a server console command.
Equivalent to typing into the server console.
| command | Command string, e.g. L"time set day". |
| Minecraft * SDK::GetClient | ( | ) |
Get the Minecraft client singleton.
Equivalent to Minecraft::GetInstance().
| MultiPlayerLevel * SDK::GetClientLevel | ( | int | dimension = 0 | ) |
Get the client-side level for a given dimension.
| dimension | 0 = Overworld, -1 = Nether, 1 = End. |
| MultiplayerLocalPlayer * SDK::GetLocalPlayer | ( | ) |
Get the primary local player on the client.
Returns the first active local player (splitscreen index 0). Returns nullptr if no level is loaded.
| MultiplayerLocalPlayer * SDK::GetLocalPlayer | ( | int | index | ) |
Get a local player by splitscreen index (0–3).
| index | Splitscreen slot index. |
| PlayerList * SDK::GetPlayerList | ( | ) |
Get the PlayerList (all connected server players).
Use this to iterate all online players, send messages, kick, etc.
| MinecraftServer * SDK::GetServer | ( | ) |
Get the MinecraftServer singleton.
Equivalent to MinecraftServer::getInstance(). Returns nullptr if the server is not running yet (check in OnInit or later).
| ServerLevel * SDK::GetServerLevel | ( | int | dimension = 0 | ) |
Get the server-side level for a given dimension.
| dimension | 0 = Overworld, -1 = Nether, 1 = End. |
| void SDK::Log | ( | const wstring & | message | ) |
| void SDK::LogError | ( | const wstring & | message | ) |
Write an error to the log (prefixed with [ERROR]).
| message | Error text. |
| void SDK::LogWarn | ( | const wstring & | message | ) |
Write a warning to the log (prefixed with [WARN]).
| message | Warning text. |
| void SDK::SaveAll | ( | bool | force = false | ) |
Save all worlds immediately.
| force | If true, saves even if nothing is dirty. |
| void SDK::SendMessageToPlayer | ( | const wstring & | playerName, |
| const wstring & | message ) |
Send a private chat message to a specific player by name.
| playerName | Target player's username. |
| message | Message to send. |
| void SDK::SetFlightAllowed | ( | bool | enabled | ) |
Enable or disable flight on the server.
| enabled | True to allow flight. |
| void SDK::SetPvpAllowed | ( | bool | enabled | ) |
Enable or disable PvP on the server.
| enabled | True to allow PvP. |
| void SDK::SetTimeOfDay | ( | __int64 | time | ) |
Set the world time for a dimension.
Wraps MinecraftServer::SetTimeOfDay().
| time | Ticks (0 = dawn, 6000 = noon, 12000 = dusk, 18000 = midnight). |