Hey, my plugin gives me an error... I dont know what is wrong in here... Code: CRITICAL]: ParseError: "syntax error, unexpected ';'" (EXCEPTION) in "myzip:///DropByLorak9904.zip#DropByLorak9904/src/drop/Main" at line 34 PHP: public function onBreak(BlockBreakEvent $e){ $player = $e->getPlayer(); $block = $e->getBlock(); $gracz = $e->getPlayer()->getName(); $blockhold = $player->getInventory()->getItemInHand(); if($e->getBlock()->getId() == 1){ if($blockhold->getItem(Item::get(278, 0, 1)){ switch(mt_rand(1,400)){ case 1:
So do I... Here... Spoiler PHP: <?phpnamespace drop;use pocketmine\plugin\PluginBase as P;use pocketmine\event\Listener as L;use pocketmine\utils\TextFormat;use pocketmine\utils\MainLogger;use pocketmine\block\Air;use pocketmine\entity\Effect;use pocketmine\event\block\BlockBreakEvent;use pocketmine\level\sound\PopSound as Pop;use pocketmine\level\particle\LavaParticle as Lava;use pocketmine\block\Block;use pocketmine\math\Vector3;use pocketmine\item\Item;class Main extends P implements L{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this,$this); $this->saveDefaultConfig(); $this->getServer()->getLogger()->info(TextFormat::GREEN."[db] Włączony!"); } public function onBreak(BlockBreakEvent $e){ $player = $e->getPlayer(); $block = $e->getBlock(); $gracz = $e->getPlayer()->getName(); $blockhold = $player->getInventory()->getItemInHand(); if($e->getBlock()->getId() == 1){ if($blockhold->getItem(Item::get(278, 0, 1)){ switch(mt_rand(1,400)){ case 1: $player->sendMessage("§7• Znalazłeś §4(2) Oko Pająka •"); $player->getInventory()->addItem(Item::get(376, 0, 2)); break; case 2: $player->sendMessage("§7• Znalazłeś §4(2) Lapisu Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 2)); break; case 3: $player->sendMessage("§7• Znalazłeś §4(1) Drewna •"); $player->getInventory()->addItem(Item::get(17, 0, 1)); break; case 4: $player->sendMessage("§7• Znalazłeś §4(2) TNT •"); $player->getInventory()->addItem(Item::get(46, 4, 2)); break; case 5: $player->sendMessage("§7• Znalazłeś §4(1) Emeraldy •"); $player->getInventory()->addItem(Item::get(388, 0, 1)); break; case 6: $player->sendMessage("§7• Znalazłeś §4(1) Lapisu Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 1)); break; case 7: $player->sendMessage("§7• Znalazłeś §4(1) Diament •"); $player->getInventory()->addItem(Item::get(264, 0, 1)); break; case 8: $player->sendMessage("§7• Znalazłeś §4(1) Drewna •"); $player->getInventory()->addItem(Item::get(17, 0, 1)); break; case 9: $player->sendMessage("§7• Znalazłeś §4(1) Złota •"); $player->getInventory()->addItem(Item::get(266, 0, 1)); break; case 10: $player->sendMessage("§7• Znalazłeś §4(1) Pióro •"); $player->getInventory()->addItem(Item::get(288, 0, 1)); break; case 11: $player->sendMessage("§7• Znalazłeś §4(3) RedStona •"); $player->getInventory()->addItem(Item::get(331, 0, 3)); break; case 12: $player->sendMessage("§7• Znalazłeś §4(1) Żelaza •"); $player->getInventory()->addItem(Item::get(265, 0, 1)); break; case 13: $player->sendMessage("§7• Znalazłeś §4(1) Jabłko •"); $player->getInventory()->addItem(Item::get(260, 0, 1)); break; case 14: $player->sendMessage("§7• Znalazłeś §4(1) Żelaza •"); $player->getInventory()->addItem(Item::get(265, 0, 1)); break; case 15: $player->sendMessage("§7• Znalazłeś §4(1) Kość •"); $player->getInventory()->addItem(Item::get(352, 0, 1)); break; case 16: $player->sendMessage("§7• Znalazłeś §4(1) Żelaza •"); $player->getInventory()->addItem(Item::get(265, 0, 1)); break; case 17: $player->sendMessage("§7• Znalazłeś §4(1) Węgla •"); $player->getInventory()->addItem(Item::get(263, 0, 1)); break; case 18: $player->sendMessage("§7• Znalazłeś §4(2) Węgla •"); $player->getInventory()->addItem(Item::get(263, 0, 2)); break; case 19: $player->sendMessage("§7• Znalazłeś §4(1) Obsydian •"); $player->getInventory()->addItem(Item::get(49, 0, 1)); break; case 20: $player->sendMessage("§7• Znalazłeś §4(2) Węgla •"); $player->getInventory()->addItem(Item::get(263, 0, 2)); break; case 21: $player->sendMessage("§7• Znalazłeś §4(5) Obsydian •"); $player->getInventory()->addItem(Item::get(49, 0, 5)); break; case 22: $player->sendMessage("§7• Znalazłeś §4(2) Obsydian •"); $player->getInventory()->addItem(Item::get(49, 0, 2)); break; case 23: $player->sendMessage("§7• Znalazłeś §6(1) Złote jabłko! •"); $player->getInventory()->addItem(Item::get(322, 0, 1)); break; case 24: $player->sendMessage("§7• Znalazłeś §4(3) Lapis Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 3)); break; case 25: $player->sendMessage("§7• Znalazłeś §4(1) Emeraldy •"); $player->getInventory()->addItem(Item::get(388, 0, 1)); break; case 26: $player->sendMessage("§7• Znalazłeś §4(2) Lapis Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 2)); break; case 27: $player->sendMessage("§7• Znalazłeś §4(2) Pióra •"); $player->getInventory()->addItem(Item::get(288, 0, 2)); break; case 28: $player->sendMessage("§7• Znalazłeś §4(2) BlazePowder •"); $player->getInventory()->addItem(Item::get(377, 0, 2)); break; case 29: $player->sendMessage("§7• Znalazłeś §4(1) Diamenty •"); $player->getInventory()->addItem(Item::get(264, 0, 1)); break; case 30: $player->sendMessage("§7• Znalazłeś §4(1) Diamenty •"); $player->getInventory()->addItem(Item::get(264, 0, 1)); break; case 31: $player->sendMessage("§7• Znalazłeś §4(1) RedStona •"); $player->getInventory()->addItem(Item::get(331, 0, 1)); break; case 32: $player->sendMessage("§7• Znalazłeś §4(2) RedStona •"); $player->getInventory()->addItem(Item::get(331, 0, 2)); break; case 33: $player->sendMessage("§7• Znalazłeś §4(3) Złoto •"); $player->getInventory()->addItem(Item::get(266, 0, 3)); break; case 34: $player->sendMessage("§7• Znalazłeś §4(5) Brodawek •"); $player->getInventory()->addItem(Item::get(372, 0, 5)); break; case 35: $player->sendMessage("§7• Znalazłeś §4(4) Łze Ghasta •"); $player->getInventory()->addItem(Item::get(370, 0, 4)); break; case 36: $player->sendMessage("§7• Trafiłeś na: §6Szybsze kopanie §6•"); $effect = Effect::getEffect(3); $effect->setDuration(600); $player->addEffect($effect); $player->addExperience(1); break; case 37: $player->sendMessage("§7• Znalazłeś §4(3) Diamenty •"); $player->getInventory()->addItem(Item::get(264, 0, 3)); break;}}} } }}
PHP: <?phpnamespace drop;use pocketmine\plugin\PluginBase as P;use pocketmine\event\Listener as L;use pocketmine\utils\TextFormat;use pocketmine\utils\MainLogger;use pocketmine\block\Air;use pocketmine\entity\Effect;use pocketmine\event\block\BlockBreakEvent;use pocketmine\level\sound\PopSound as Pop;use pocketmine\level\particle\LavaParticle as Lava;use pocketmine\block\Block;use pocketmine\math\Vector3;use pocketmine\item\Item;class Main extends P implements L{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this,$this); $this->saveDefaultConfig(); $this->getServer()->getLogger()->info(TextFormat::GREEN."[db] Włączony!"); } public function onBreak(BlockBreakEvent $e){ $player = $e->getPlayer(); $block = $e->getBlock(); $gracz = $e->getPlayer()->getName(); $blockhold = $player->getInventory()->getItemInHand(); if($e->getBlock()->getId() == 1){ if($blockhold->getItem(Item::get(278, 0, 1))){ switch(mt_rand(1,400)){ case 1: $player->sendMessage("§7• Znalazłeś §4(2) Oko Pająka •"); $player->getInventory()->addItem(Item::get(376, 0, 2)); break; case 2: $player->sendMessage("§7• Znalazłeś §4(2) Lapisu Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 2)); break; case 3: $player->sendMessage("§7• Znalazłeś §4(1) Drewna •"); $player->getInventory()->addItem(Item::get(17, 0, 1)); break; case 4: $player->sendMessage("§7• Znalazłeś §4(2) TNT •"); $player->getInventory()->addItem(Item::get(46, 4, 2)); break; case 5: $player->sendMessage("§7• Znalazłeś §4(1) Emeraldy •"); $player->getInventory()->addItem(Item::get(388, 0, 1)); break; case 6: $player->sendMessage("§7• Znalazłeś §4(1) Lapisu Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 1)); break; case 7: $player->sendMessage("§7• Znalazłeś §4(1) Diament •"); $player->getInventory()->addItem(Item::get(264, 0, 1)); break; case 8: $player->sendMessage("§7• Znalazłeś §4(1) Drewna •"); $player->getInventory()->addItem(Item::get(17, 0, 1)); break; case 9: $player->sendMessage("§7• Znalazłeś §4(1) Złota •"); $player->getInventory()->addItem(Item::get(266, 0, 1)); break; case 10: $player->sendMessage("§7• Znalazłeś §4(1) Pióro •"); $player->getInventory()->addItem(Item::get(288, 0, 1)); break; case 11: $player->sendMessage("§7• Znalazłeś §4(3) RedStona •"); $player->getInventory()->addItem(Item::get(331, 0, 3)); break; case 12: $player->sendMessage("§7• Znalazłeś §4(1) Żelaza •"); $player->getInventory()->addItem(Item::get(265, 0, 1)); break; case 13: $player->sendMessage("§7• Znalazłeś §4(1) Jabłko •"); $player->getInventory()->addItem(Item::get(260, 0, 1)); break; case 14: $player->sendMessage("§7• Znalazłeś §4(1) Żelaza •"); $player->getInventory()->addItem(Item::get(265, 0, 1)); break; case 15: $player->sendMessage("§7• Znalazłeś §4(1) Kość •"); $player->getInventory()->addItem(Item::get(352, 0, 1)); break; case 16: $player->sendMessage("§7• Znalazłeś §4(1) Żelaza •"); $player->getInventory()->addItem(Item::get(265, 0, 1)); break; case 17: $player->sendMessage("§7• Znalazłeś §4(1) Węgla •"); $player->getInventory()->addItem(Item::get(263, 0, 1)); break; case 18: $player->sendMessage("§7• Znalazłeś §4(2) Węgla •"); $player->getInventory()->addItem(Item::get(263, 0, 2)); break; case 19: $player->sendMessage("§7• Znalazłeś §4(1) Obsydian •"); $player->getInventory()->addItem(Item::get(49, 0, 1)); break; case 20: $player->sendMessage("§7• Znalazłeś §4(2) Węgla •"); $player->getInventory()->addItem(Item::get(263, 0, 2)); break; case 21: $player->sendMessage("§7• Znalazłeś §4(5) Obsydian •"); $player->getInventory()->addItem(Item::get(49, 0, 5)); break; case 22: $player->sendMessage("§7• Znalazłeś §4(2) Obsydian •"); $player->getInventory()->addItem(Item::get(49, 0, 2)); break; case 23: $player->sendMessage("§7• Znalazłeś §6(1) Złote jabłko! •"); $player->getInventory()->addItem(Item::get(322, 0, 1)); break; case 24: $player->sendMessage("§7• Znalazłeś §4(3) Lapis Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 3)); break; case 25: $player->sendMessage("§7• Znalazłeś §4(1) Emeraldy •"); $player->getInventory()->addItem(Item::get(388, 0, 1)); break; case 26: $player->sendMessage("§7• Znalazłeś §4(2) Lapis Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 2)); break; case 27: $player->sendMessage("§7• Znalazłeś §4(2) Pióra •"); $player->getInventory()->addItem(Item::get(288, 0, 2)); break; case 28: $player->sendMessage("§7• Znalazłeś §4(2) BlazePowder •"); $player->getInventory()->addItem(Item::get(377, 0, 2)); break; case 29: $player->sendMessage("§7• Znalazłeś §4(1) Diamenty •"); $player->getInventory()->addItem(Item::get(264, 0, 1)); break; case 30: $player->sendMessage("§7• Znalazłeś §4(1) Diamenty •"); $player->getInventory()->addItem(Item::get(264, 0, 1)); break; case 31: $player->sendMessage("§7• Znalazłeś §4(1) RedStona •"); $player->getInventory()->addItem(Item::get(331, 0, 1)); break; case 32: $player->sendMessage("§7• Znalazłeś §4(2) RedStona •"); $player->getInventory()->addItem(Item::get(331, 0, 2)); break; case 33: $player->sendMessage("§7• Znalazłeś §4(3) Złoto •"); $player->getInventory()->addItem(Item::get(266, 0, 3)); break; case 34: $player->sendMessage("§7• Znalazłeś §4(5) Brodawek •"); $player->getInventory()->addItem(Item::get(372, 0, 5)); break; case 35: $player->sendMessage("§7• Znalazłeś §4(4) Łze Ghasta •"); $player->getInventory()->addItem(Item::get(370, 0, 4)); break; case 36: $player->sendMessage("§7• Trafiłeś na: §6Szybsze kopanie §6•"); $effect = Effect::getEffect(3); $effect->setDuration(600); $player->addEffect($effect); $player->addExperience(1); break; case 37: $player->sendMessage("§7• Znalazłeś §4(3) Diamenty •"); $player->getInventory()->addItem(Item::get(264, 0, 3)); break;}}} } } Use this ^ code!
Code: ParseError: "syntax error, unexpected 'switch' (T_SWITCH)" (EXCEPTION) in "myzip:///DropByLorak9904.zip#DropByLorak9904/src/drop/Main" at line 34
That code was yours! Here: Spoiler PHP: <?phpnamespace drop;use pocketmine\plugin\PluginBase as P;use pocketmine\event\Listener as L;use pocketmine\utils\TextFormat;use pocketmine\utils\MainLogger;use pocketmine\block\Air;use pocketmine\entity\Effect;use pocketmine\event\block\BlockBreakEvent;use pocketmine\level\sound\PopSound as Pop;use pocketmine\level\particle\LavaParticle as Lava;use pocketmine\block\Block;use pocketmine\math\Vector3;use pocketmine\item\Item;class Main extends P implements L{ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this,$this); $this->saveDefaultConfig(); $this->getServer()->getLogger()->info(TextFormat::GREEN."[db] Włączony!"); } public function onBreak(BlockBreakEvent $e){ $player = $e->getPlayer(); $block = $e->getBlock(); $gracz = $e->getPlayer()->getName(); $blockhold = $player->getInventory()->getItemInHand(); if($e->getBlock()->getId() == 1){ if($blockhold->getItem(Item::get(278, 0, 1))){ switch(mt_rand(1,400)){ case 1: $player->sendMessage("§7• Znalazłeś §4(2) Oko Pająka •"); $player->getInventory()->addItem(Item::get(376, 0, 2)); break; case 2: $player->sendMessage("§7• Znalazłeś §4(2) Lapisu Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 2)); break; case 3: $player->sendMessage("§7• Znalazłeś §4(1) Drewna •"); $player->getInventory()->addItem(Item::get(17, 0, 1)); break; case 4: $player->sendMessage("§7• Znalazłeś §4(2) TNT •"); $player->getInventory()->addItem(Item::get(46, 4, 2)); break; case 5: $player->sendMessage("§7• Znalazłeś §4(1) Emeraldy •"); $player->getInventory()->addItem(Item::get(388, 0, 1)); break; case 6: $player->sendMessage("§7• Znalazłeś §4(1) Lapisu Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 1)); break; case 7: $player->sendMessage("§7• Znalazłeś §4(1) Diament •"); $player->getInventory()->addItem(Item::get(264, 0, 1)); break; case 8: $player->sendMessage("§7• Znalazłeś §4(1) Drewna •"); $player->getInventory()->addItem(Item::get(17, 0, 1)); break; case 9: $player->sendMessage("§7• Znalazłeś §4(1) Złota •"); $player->getInventory()->addItem(Item::get(266, 0, 1)); break; case 10: $player->sendMessage("§7• Znalazłeś §4(1) Pióro •"); $player->getInventory()->addItem(Item::get(288, 0, 1)); break; case 11: $player->sendMessage("§7• Znalazłeś §4(3) RedStona •"); $player->getInventory()->addItem(Item::get(331, 0, 3)); break; case 12: $player->sendMessage("§7• Znalazłeś §4(1) Żelaza •"); $player->getInventory()->addItem(Item::get(265, 0, 1)); break; case 13: $player->sendMessage("§7• Znalazłeś §4(1) Jabłko •"); $player->getInventory()->addItem(Item::get(260, 0, 1)); break; case 14: $player->sendMessage("§7• Znalazłeś §4(1) Żelaza •"); $player->getInventory()->addItem(Item::get(265, 0, 1)); break; case 15: $player->sendMessage("§7• Znalazłeś §4(1) Kość •"); $player->getInventory()->addItem(Item::get(352, 0, 1)); break; case 16: $player->sendMessage("§7• Znalazłeś §4(1) Żelaza •"); $player->getInventory()->addItem(Item::get(265, 0, 1)); break; case 17: $player->sendMessage("§7• Znalazłeś §4(1) Węgla •"); $player->getInventory()->addItem(Item::get(263, 0, 1)); break; case 18: $player->sendMessage("§7• Znalazłeś §4(2) Węgla •"); $player->getInventory()->addItem(Item::get(263, 0, 2)); break; case 19: $player->sendMessage("§7• Znalazłeś §4(1) Obsydian •"); $player->getInventory()->addItem(Item::get(49, 0, 1)); break; case 20: $player->sendMessage("§7• Znalazłeś §4(2) Węgla •"); $player->getInventory()->addItem(Item::get(263, 0, 2)); break; case 21: $player->sendMessage("§7• Znalazłeś §4(5) Obsydian •"); $player->getInventory()->addItem(Item::get(49, 0, 5)); break; case 22: $player->sendMessage("§7• Znalazłeś §4(2) Obsydian •"); $player->getInventory()->addItem(Item::get(49, 0, 2)); break; case 23: $player->sendMessage("§7• Znalazłeś §6(1) Złote jabłko! •"); $player->getInventory()->addItem(Item::get(322, 0, 1)); break; case 24: $player->sendMessage("§7• Znalazłeś §4(3) Lapis Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 3)); break; case 25: $player->sendMessage("§7• Znalazłeś §4(1) Emeraldy •"); $player->getInventory()->addItem(Item::get(388, 0, 1)); break; case 26: $player->sendMessage("§7• Znalazłeś §4(2) Lapis Lazuli •"); $player->getInventory()->addItem(Item::get(351, 4, 2)); break; case 27: $player->sendMessage("§7• Znalazłeś §4(2) Pióra •"); $player->getInventory()->addItem(Item::get(288, 0, 2)); break; case 28: $player->sendMessage("§7• Znalazłeś §4(2) BlazePowder •"); $player->getInventory()->addItem(Item::get(377, 0, 2)); break; case 29: $player->sendMessage("§7• Znalazłeś §4(1) Diamenty •"); $player->getInventory()->addItem(Item::get(264, 0, 1)); break; case 30: $player->sendMessage("§7• Znalazłeś §4(1) Diamenty •"); $player->getInventory()->addItem(Item::get(264, 0, 1)); break; case 31: $player->sendMessage("§7• Znalazłeś §4(1) RedStona •"); $player->getInventory()->addItem(Item::get(331, 0, 1)); break; case 32: $player->sendMessage("§7• Znalazłeś §4(2) RedStona •"); $player->getInventory()->addItem(Item::get(331, 0, 2)); break; case 33: $player->sendMessage("§7• Znalazłeś §4(3) Złoto •"); $player->getInventory()->addItem(Item::get(266, 0, 3)); break; case 34: $player->sendMessage("§7• Znalazłeś §4(5) Brodawek •"); $player->getInventory()->addItem(Item::get(372, 0, 5)); break; case 35: $player->sendMessage("§7• Znalazłeś §4(4) Łze Ghasta •"); $player->getInventory()->addItem(Item::get(370, 0, 4)); break; case 36: $player->sendMessage("§7• Trafiłeś na: §6Szybsze kopanie §6•"); $effect = Effect::getEffect(3); $effect->setDuration(600); $player->addEffect($effect); $player->addExperience(1); break; case 37: $player->sendMessage("§7• Znalazłeś §4(3) Diamenty •"); $player->getInventory()->addItem(Item::get(264, 0, 3)); break;}}} } }
Code: /CRITICAL]: ParseError: "syntax error, unexpected '{'" (EXCEPTION) in "myzip:///DropByLorak9904.zip#DropByLorak9904/src/drop/Main" at line 16