This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function setDirection($username, $rotation) { | |
$entity = $this->api->player->get($username)->entity; | |
$entity->yaw = (int) $rotation + 90; | |
$entity->updatePosition(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function init() { | |
$this->api->addHandler("entity.health.change", array($this, "handle")); //entity.health.changeをキャッチしたらhandle()メソッドを実行する | |
} | |
public function handle(&$data, $event) { | |
if ($data["entity"]->class === ENTITY_PLAYER) { //ダメージを受けた奴がプレイヤーの場合 | |
if ($this->api->player->getByEID($data["cause"]) !== false) { //ダメージを与えた奴がプレイヤーの場合 | |
$puncher = $this->api->player->getByEID($data["casuse"]); //ダメージを与えた奴のPlayerオブジェクトを取得 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$username = "Steve"; //対象プレイヤー名 | |
$id = 1; //対象アイテムをIDで指定 | |
$amount = 10; //個数 | |
$player = $this->api->player->get($username); | |
foreach ($player->inventory as $slot => $item) { | |
if ($item->getID() == $id) { | |
while ($item->count >= 1 and $amount >= 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
修正したソースコード | |
*/ | |
class takumi implements Plugin{ | |
private $api; | |
public function __construct(ServerAPI $api, $server = false){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
__PocketMine Plugin__ | |
name=ExamplePlugin | |
version=0.0.1 | |
author=shoghicp | |
class=ExamplePlugin | |
apiversion=10 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
__PocketMine Plugin__ | |
name=ExamplePlugin | |
version=0.0.1 | |
author=shoghicp | |
class=ExamplePlugin | |
apiversion=10 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
__PocketMine Plugin__ | |
name=ExamplePlugin | |
version=0.0.1 | |
author=shoghicp | |
class=ExamplePlugin | |
apiversion=10 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
__PocketMine Plugin__ | |
name=ExamplePlugin | |
version=0.0.1 | |
author=shoghicp | |
class=ExamplePlugin | |
apiversion=10 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
__PocketMine Plugin__ | |
name=GroupPermissions | |
description=Manage permissions between groups | |
version=1.0 | |
author=marksmir | |
class=GroupPermissions | |
apiversion=10 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
__PocketMine Plugin__ | |
name=AdonPlugin | |
description=Udon | |
version=0.1 | |
author=Adon | |
class=AdonPlugin | |
apiversion=6,7,8,9,10 | |
*/ |
NewerOlder