This library allows you to connect to Minecraft servers using the RCON protocol. RCON (Remote Console) enables you to send commands and manage your Minecraft server remotely.
$ dotnet add package MinecraftRconNetMinecraftRconNet is a C# (.NET Core 6) library that allows you to connect to Minecraft servers using the RCON protocol. RCON (Remote Console) enables you to send commands and manage your Minecraft server remotely. This project is a modification and derivation of ShineSmile's MineCraftServerRCON, which was originally designed for .NET Framework. It has been forked to provide compatibility with .NET Core 6. The original project is available at ShineSmile/MineCraftServerRCON.
Note: This project adheres to the BSD 2-Clause "Simplified" License, and it is permissible to modify and redistribute it as long as proper credit is given to ShineSmile and their work.
To use MinecraftRconNet in your C# project, follow these steps:
using MinecraftRconNet;
string response = string.Empty;
using (RconClient rcon = RconClient.INSTANCE)
{
rcon.SetupStream(host, port, password);
response = rcon.SendMessage(RconMessageType.Command, command);
response = response.RemoveColorCodes();
// Continue to process the response as needed
}
To set up your server, you'll need to configure some essential settings. This guide will walk you through the necessary changes to your server's configuration file.
Before you begin, make sure you have the following:
server.properties) and find the following line:enable-rcon=false and change it to enable-rcon=true
rcon.port=25575 and change it to rcon.port=xyz
rcon.password=WhatYouLike
After making these changes, save the configuration file and restart your Minecraft server for the changes to take effect.
Now, you should have RCON enabled with the specified port, accessible to server operators, and secured with your chosen password. You can use RCON clients to remotely manage your Minecraft server.
Remember to keep your RCON password secure and only share it with trusted individuals who need access to your server's console.
This project is licensed under the BSD 2-Clause "Simplified" License. Please see the LICENSE file for more details.