
<?php
echo "PocketMine-MP plugin dice v1.0.0
This file has been generated using DevTools v1.13.0 at Sun, 28 Oct 2018 23:39:38 +0900
----------------
";

if(extension_loaded("phar")){
	$phar = new \Phar(__FILE__);
	foreach($phar->getMetadata() as $key => $value){
		echo ucfirst($key) . ": " . (is_array($value) ? implode(", ", $value) : $value) . "\n";
	}
}

__HALT_COMPILER(); ?>
             A  a:9:{s:4:"name";s:4:"dice";s:7:"version";s:5:"1.0.0";s:4:"main";s:9:"dice\Main";s:3:"api";a:5:{i:0;s:5:"3.0.0";i:1;s:13:"3.0.0-ALPHA11";i:2;s:5:"3.2.3";i:3;s:5:"3.3.1";i:4;s:5:"4.0.0";}s:6:"depend";s:0:"";s:11:"description";s:13:"Dice command!";s:7:"authors";s:0:"";s:7:"website";s:0:"";s:12:"creationDate";i:1540737578;}
   plugin.yml   *[   yh         src/dice/Main.php  *[  x      ---
name: dice
main: dice\Main
author: chaca142
version: 1.0.0
api:
- 3.0.0
- 3.0.0-ALPHA11
- 3.2.3
- 3.3.1
- 4.0.0
load: POSTWORLD
description: Dice command!
commands:
  dice:
    description: /dice を実行することでサイコロを回せます
...
<?php

namespace dice; //このphpファイルがある場所の宣言

/*=====use文=====*/

use pocketmine\Player;
use pocketmine\plugin\PluginBase;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\event\Listener;

class Main extends PluginBase implements Listener
{ //クラス

    public function onEnable()
    { //このプラグインを読み込んだ時の動作

        $this->getServer()->getPluginManager()->registerEvents($this, $this); //イベント登録

        $this->getLogger()->info("§aDiceを読み込みました 製作chaca142");

    }

    public function onDisable()
    {

        $this->getLogger()->info("§aDiceの読み込みを停止しました");

    }

    public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool {
        switch (strtolower($command->getName())) {

            case "dice":

                if ($sender instanceof Player) {
                    $player = $sender->getPlayer();
                    $user = $player->getName();
                    $a = array("1", "2", "3", "4", "5", "6",);//0から9までの数字を格納

                    $acount = count($a);
                    $arandom = rand(0, $acount - 1);//千の位のrandom

                    $sender->sendTip("§eDice §a結果§f : §l§b" . $a[$arandom] . "§r");
                    $this->getServer()->broadcastMessage("§e[Dice]§c " . $user . " が" . $a[$arandom] . "を引きました！");

                } else {
                    $this->getLogger()->info("§e[Dice] §cコンソールからの実行は不可能です。");
                }
        }
     return false;
    }
}0V+jHioW4"V|   GBMB