gries/minecraft-commander

PHP Minecraft-Server 客户端

0.0.1 2014-12-14 12:03 UTC

This package is auto-updated.

Last update: 2024-09-16 21:05:51 UTC


README

这是一个用于向 Minecraft 服务器发送命令 (http://minecraft.gamepedia.com/Commands) 并解析其输出的库。

SensioLabsInsight

Build Status

安装

可以通过 Composer 安装 minecraft-commander。

composer require "gries/minecraft-commands"

基本用法

use gries\Minecraft\Commander\CommanderFactory;

require_once __DIR__ . '/../vendor/autoload.php';

// create a Commander
$commander = CommanderFactory::create('example.com', 25575, 'mypass');

// set the server-time
$commander->setTime('12000');

// listPlayers
$players = $commander->listPlayers();

print_r($players);

echo $commander->raw('seed');

目前这些命令对 Commander 可用:

  • say
  • listPlayers
  • locatePlayer
  • teleport
  • give
  • setWeather
  • setTime
  • setBlock
  • raw

运行测试

bin/phpspec run

贡献!

请通过 github issues 给我反馈/功能请求/错误报告。或者直接发送 pull-request :)

作者

许可证

有关完整的版权和许可证信息,请参阅与源代码一起分发的 LICENSE 文件。