
<?php
echo "PocketMine-MP plugin RandomPotion v1
This file has been generated using DevTools v1.13.0 at Wed, 17 Oct 2018 13:44:13 +1030
----------------
";

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:9:{s:4:"name";s:12:"RandomPotion";s:7:"version";d:1;s:4:"main";s:17:"RandomPotion\Main";s:3:"api";a:2:{i:0;s:5:"3.0.0";i:1;s:5:"4.0.0";}s:6:"depend";s:0:"";s:11:"description";s:24:"プラグインの説明";s:7:"authors";s:0:"";s:7:"website";s:0:"";s:12:"creationDate";i:1539746053;}
   plugin.yml   [   |         src/RandomPotion/Main.php  [  ƶ      name: RandomPotion
main: RandomPotion\Main
version: 1.0
api: [3.0.0, 4.0.0]
load: POSTWORLD
author: Noi
description: プラグインの説明<?php

namespace RandomPotion;

use pocketmine\Player;
use pocketmine\entity\{Effect, EffectInstance};
use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerItemConsumeEvent;
use pocketmine\inventory\ShapedRecipe;
use pocketmine\item\Item;


class Main extends PluginBase implements Listener {


	public function onEnable() {

		$this->getServer()->getPluginManager()->registerEvents($this, $this);
		$plugin = "RandomPotion";
		$this->getLogger()->info("§a".$plugin." §eis loaded. §f何かあれば§bTwitter §e@Noi_noel2647 §fまで");

		$this->addRecipe();

	}


	public function onDrink(PlayerItemConsumeEvent $event) {

		$player = $event->getPlayer();
		$item = $player->getInventory()->getItemInHand();

		$id = $item->getId();
		$meta = $item->getDamage();
		$name = $item->getCustomName();

		if($id == 373 && $name == "§b§l不思議なポーション") {
			$this->addEffect($player);
		}
	}



	public function addRecipe() {

		$shape = 	[
					"AAA",
				];

		$input = 	[
					"A" => Item::get(373, 0, 1),
				];


		$output = 	[
					Item::get(373, 0, 1)->setCustomName("§b§l不思議なポーション"),
				];

		$this->getServer()->getCraftingManager()->registerRecipe(new ShapedRecipe($shape, $input, $output));

	}


	public function addEffect(Player $player) {


		$id = rand(1, 26);
		$duration = rand(1, 180);
		$amplifiler = rand(1, 5);

		$count = rand(1, 3);

		for ($num = 0; $num <= $count; $num++) {

			$effect = new EffectInstance(Effect::getEffect($id));
			$effect->setDuration($duration * 20);
			$effect->setAmplifier($amplifiler);
			$effect->setVisible(true);

			$player->addEffect($effect);

		}
	}

}"=ި3H%_   GBMB