PHPackages                             d3lph1/minecraft-rcon-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. d3lph1/minecraft-rcon-manager

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

d3lph1/minecraft-rcon-manager
=============================

Library for easy interaction with the minecraft server using rcon.

1.3(7y ago)53.1kMITPHPPHP &gt;=5.4.0CI failing

Since Mar 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/D3lph1/minecraft-rcon-manager)[ Packagist](https://packagist.org/packages/d3lph1/minecraft-rcon-manager)[ RSS](/packages/d3lph1-minecraft-rcon-manager/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

minecraft-rcon-manager
======================

[](#minecraft-rcon-manager)

Library for easy interaction with the minecraft server using rcon.

Installation
------------

[](#installation)

Execute command:

```
composer require d3lph1/minecraft-rcon-manager ~1.0
```

or add line to require section of composer.json

```
"d3lph1/minecraft-rcon-manage": "~1.0",
```

Usage
-----

[](#usage)

### Overview

[](#overview)

```
use \D3lph1\MinecraftRconManager\DefaultConnector;
use \D3lph1\MinecraftRconManager\Exceptions\ConnectSocketException;
use \D3lph1\MinecraftRconManager\Exceptions\AccessDenyException;

$connector = new DefaultConnector();
try {
    // Connect to RCON
    $rcon = $connector->connect('127.0.0.1', 25575, '123456');
}catch(ConnectSocketException $e) {
    // do something...
}catch(AccessDenyException $e) {
    // do something...
}

// Get only response body
$response = $rcon->send('say Yes, it works...');

print_r($response); // §d[Rcon§d] Yes, it works...

// Get response array
$response = $rcon->send('say Yes, it works...', true);

print_r($response);
/**
 *   Array (
 *      [id] => 16
 *      [type] => 0
 *      [body] => §d[Rcon§d] Yes, it works...
 *   )
 *
 */

// Get last response
$last = $rcon->getLast();

// Close RCON connection
$rcon->disconnect();
```

### Connecting

[](#connecting)

First, you need to create an instance of the Connector class. The instance will serve to create a connection to the server, add servers to the pool and remove them from there.

```
use \D3lph1\MinecraftRconManager\DefaultConnector;

$connector = new DefaultConnector();
```

In order to connect directly to the server, use this construction

```
$rcon = $connector->connect($host, $port, $password, $timeout);
```

Where:

- `$host` - Server host (By default, `127.0.0.1`)
- `$port` - Rcon port (By default, `25575`)
- `$password` - Rcon password
- `$timeout` - Connection timeout (By default, `1` second)

You can also add the server to the server pool in order to get the connection instance later:

```
$connector->add($name, $host, $port, $password, $timeout);

// Still as an option...
$connector->add('hi_tech', [
    'host' => '127.0.0.1',
    'port' => 25575,
    'password' => '123456',
    'timeout' => 1
]);

// Since the Connector class implements the ArrayAccess interface,
// the servers can be placed into the pool by accessing the object as an array.
$connector['mmo'] = [
    'host' => '127.0.0.1',
    'port' => 25576,
    'password' => '123456',
    'timeout' => 1
];
```

Ok, now we need the servers in the pool. Now that you need a server in the future, you will pull it out of the pool like this:

```
$rcon = $connector->get('hi_tech');

// Or...
$rcon = $connector['mmo'];
```

Remove server from server pool:

```
$connector->remove('hi_tech');

// or...
unset($connector['hi_tech']);
```

### Sending requests

[](#sending-requests)

Using the constructs described above, we get an instance of the class `D3lph1\MinecraftRconManager\Rcon` with which we can finally send requests to our server:

```
$response = $rcon->send('say Yes, it works...');
```

In return we will get something like this: `§d[Rcon§d] Yes, it works...`

You can get not only the body of the answer but the entire array in which besides the body contains also the service information. Just pass `true` to the second argument to `send()`.

```
$response = $rcon->send('say Yes, it works...', true);
```

This array contains element `type` - the type of request (authorization or command execution) and the request `id` - required to check the integrity of the response.

Get data from last request:

```
$response = $rcon->last();
```

Disconnect from server:

```
$rcon->disconnect();
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~159 days

Total

4

Last Release

2910d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19612725?v=4)[Bogdan](/maintainers/D3lph1)[@D3lph1](https://github.com/D3lph1)

---

Top Contributors

[![D3lph1](https://avatars.githubusercontent.com/u/19612725?v=4)](https://github.com/D3lph1 "D3lph1 (9 commits)")

---

Tags

minecraftrconminecraftrconmc

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/d3lph1-minecraft-rcon-manager/health.svg)

```
[![Health](https://phpackages.com/badges/d3lph1-minecraft-rcon-manager/health.svg)](https://phpackages.com/packages/d3lph1-minecraft-rcon-manager)
```

###  Alternatives

[thedudeguy/rcon

Simple Rcon class for php.

16162.6k1](/packages/thedudeguy-rcon)[xpaw/php-minecraft-query

PHP library to query Minecraft servers

744104.7k3](/packages/xpaw-php-minecraft-query)[spirit55555/php-minecraft

Useful PHP classes for Minecraft

6825.5k](/packages/spirit55555-php-minecraft)[d3strukt0r/votifier-client

Simple Tool to send vote request to a server which has the Votifier plugin.

1624.3k](/packages/d3strukt0r-votifier-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
