Skip to content

Instantly share code, notes, and snippets.

@Omattyao
Created December 28, 2013 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Omattyao/8160224 to your computer and use it in GitHub Desktop.
Save Omattyao/8160224 to your computer and use it in GitHub Desktop.
<?php
/*
__PocketMine Plugin__
name=ExamplePlugin
version=0.0.1
author=shoghicp
class=ExamplePlugin
apiversion=10
*/
class ExamplePlugin implements Plugin{
private $api;
public function __construct(ServerAPI $api, $server = false){
$this->api = $api;
}
public function init(){
$this->api->console->register("pos", "setumei", array($this, "commandH"));
}
public function commandH($cmd, $params, $issuer, $alias) {
if ($issuer instanceof Player) {
$x = $issuer->entity->x;
$y = $issuer->entity->y;
$z = $issuer->entity->z;
$name = $issuer->username;
$issuer->sendChat("$nameの座標は x:$x y:$y z:$z です");
}
}
public function __destruct(){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment