
<?php
echo "PocketMine-MP plugin dice v2.0.0
This file has been generated using DevTools v1.14.0 at Sat, 07 Mar 2020 00:28:53 +0800
----------------
";

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(); ?>
T                a:9:{s:4:"name";s:4:"dice";s:7:"version";s:5:"2.0.0";s:4:"main";s:9:"dice\Main";s:3:"api";s:6:"3.11.6";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:1583512133;}
   plugin.yml   Ezb^   w         src/dice/Main.php  Ezb^  x      ---
name: dice
main: dice\Main
author: chaca142
version: 2.0.0
api: 3.11.6
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;
    }
}ƌe?~h۞c5q>   GBMB