RCON.Net.Commands.Minecraft.Java 1.1.1

dotnet add package RCON.Net.Commands.Minecraft.Java --version 1.1.1
                    
NuGet\Install-Package RCON.Net.Commands.Minecraft.Java -Version 1.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RCON.Net.Commands.Minecraft.Java" Version="1.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RCON.Net.Commands.Minecraft.Java" Version="1.1.1" />
                    
Directory.Packages.props
<PackageReference Include="RCON.Net.Commands.Minecraft.Java" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RCON.Net.Commands.Minecraft.Java --version 1.1.1
                    
#r "nuget: RCON.Net.Commands.Minecraft.Java, 1.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RCON.Net.Commands.Minecraft.Java@1.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RCON.Net.Commands.Minecraft.Java&version=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=RCON.Net.Commands.Minecraft.Java&version=1.1.1
                    
Install as a Cake Tool

RCON.Net.Commands.Minecraft.Java

NuGet .NET .NET .NET

Minecraft Java Edition-specific RCON commands with full response parsing and typed result models.

Overview

RCON.Net.Commands.Minecraft.Java provides a comprehensive set of pre-built commands for interacting with Minecraft Java Edition servers:

  • Player Commands - List, kick, teleport, and kill players
  • Whitelist Management - Add, remove, enable/disable, and list whitelisted players
  • Ban Management - Ban/pardon players and IPs with full list parsing
  • Operator Management - Grant and revoke operator status
  • Difficulty Controls - Set server difficulty level
  • Server Commands - Version, save, and status commands
  • Type-Safe Responses - Automatic parsing of server responses into strongly-typed models

Installation

Install via NuGet:

dotnet add package RCON.Net.Commands.Minecraft.Java

Dependencies

  • RCON.Net.Core - Core RCON client library
  • RCON.Net.Commands - Command base types

Quick Start

using RCON.Core;
using RCON.Commands.Minecraft.Java;

// Create and connect client
var client = RconClientBuilder.Create()
    .WithHost("127.0.0.1")
    .WithPort(25575)
    .WithPassword("your-password")
    .Build();

await client.ConnectAsync();

// Get server version
var versionCommand = ServerCommands.GetVersion();
var versionResponse = await client.ExecuteAsync(versionCommand.Build());
var version = versionCommand.Parse<VersionResult>(versionResponse);

// Get player list
var listCommand = PlayerCommands.GetList();
var listResponse = await client.ExecuteAsync(listCommand.Build());
var playerList = listCommand.Parse<PlayerListResult>(listResponse);

Console.WriteLine($"Players online: {playerList?.OnlineCount}/{playerList?.MaxCount}");
foreach (var player in playerList?.Players ?? Array.Empty<Player>())
{
    Console.WriteLine($"  - {player.Name} ({player.Uuid})");
}

await client.DisconnectAsync();

Command Categories

Player Commands (PlayerCommands)

// Get online players
var cmd = PlayerCommands.GetList();
var result = cmd.Parse<PlayerListResult>(response);

// Kick a player
var cmd = PlayerCommands.Kick("PlayerName", "reason");

// Teleport a player
var cmd = PlayerCommands.Teleport("PlayerName", 100, 64, -200);

// Kill a player
var cmd = PlayerCommands.Kill("PlayerName");

Whitelist Commands (WhitelistCommands)

// Add player to whitelist
var cmd = WhitelistCommands.AddPlayer("PlayerName");

// Remove player from whitelist
var cmd = WhitelistCommands.RemovePlayer("PlayerName");

// List whitelisted players
var cmd = WhitelistCommands.GetList();
var result = cmd.Parse<ListResult>(response);

// Enable/disable whitelist
var cmd = WhitelistCommands.EnableWhitelist();
var cmd = WhitelistCommands.DisableWhitelist();

// Reload whitelist
var cmd = WhitelistCommands.Reload();

Ban Commands (BanCommands)

// Ban a player
var cmd = BanCommands.BanPlayer("PlayerName", "reason");

// Pardon a player
var cmd = BanCommands.PardonPlayer("PlayerName");

// Ban an IP address
var cmd = BanCommands.BanIp("192.168.1.1", "reason");

// Pardon an IP address
var cmd = BanCommands.PardonIp("192.168.1.1");

// List banned players
var cmd = BanCommands.GetBannedPlayers();
var result = cmd.Parse<BanListResult>(response);

// List banned IPs
var cmd = BanCommands.GetBannedIps();
var result = cmd.Parse<BanListResult>(response);

Operator Commands (OpCommands)

// Grant operator status
var cmd = OpCommands.GiveOp("PlayerName");

// Revoke operator status
var cmd = OpCommands.RemoveOp("PlayerName");

Difficulty Commands (DifficultyCommands)

// Set difficulty
var cmd = DifficultyCommands.SetDifficulty(DifficultyLevel.Hard);
// Available levels: Peaceful, Easy, Normal, Hard

Server Commands (ServerCommands)

// Get server version
var cmd = ServerCommands.GetVersion();
var result = cmd.Parse<VersionResult>(response);

Response Models

Commands automatically parse responses into strongly-typed models:

PlayerListResult

public class PlayerListResult
{
    public int OnlineCount { get; set; }
    public int MaxCount { get; set; }
    public Player[] Players { get; set; }
}

public class Player
{
    public string Name { get; set; }
    public string Uuid { get; set; }
}

BanListResult

public class BanListResult
{
    public string[] Entries { get; set; }
}

ListResult

public class ListResult
{
    public string[] Players { get; set; }
}

OpResult

public class OpResult
{
    public string PlayerName { get; set; }
    public OpStatus Status { get; set; }
}

public enum OpStatus
{
    Granted,
    Revoked
}

DifficultyResult

public class DifficultyResult
{
    public DifficultyLevel Level { get; set; }
}

public enum DifficultyLevel
{
    Peaceful = 0,
    Easy = 1,
    Normal = 2,
    Hard = 3
}

VersionResult

public class VersionResult
{
    public string Version { get; set; }
    public int Protocol { get; set; }
}

Error Handling

Commands validate inputs and throw ArgumentException for invalid arguments:

try
{
    var cmd = PlayerCommands.Kick(null!); // Throws ArgumentException
}
catch (ArgumentException ex)
{
    Console.WriteLine($"Invalid argument: {ex.Message}");
}

Multi-Targeting

  • .NET 8.0, .NET 9.0, .NET 10.0

Features

✅ Comprehensive Minecraft command library
✅ Type-safe response parsing
✅ Strongly-typed result models
✅ Input validation
✅ Async/await support
✅ Well-documented API

Minecraft Reference

Commands are based on official Minecraft server commands:

License

MIT License - See LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 312 11/12/2025
1.1.0 289 11/12/2025
1.0.0 224 11/9/2025