Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I need help

Comments in 'Plugin Development' started by PolskiTHEPLAYER, Dec 1, 2016.

  1. PolskiTHEPLAYER
    Offline

    PolskiTHEPLAYER New Member

    Joined:
    Apr 1, 2015
    Posts:
    55
    Minecraft User:
    Flsmers
    Hi, guys!

    I have new plugin and my plugin crashing!
    Please helo me!

    This code

    PHP:
    <?php

    namespace drop;

    use 
    pocketmine\plugin\PluginBase as P;
    use 
    pocketmine\event\Listener as L;
    use 
    pocketmine\utils\TextFormat;
    use 
    pocketmine\utils\MainLogger;
    use 
    pocketmine\event\block\BlockBreakEvent;
    use 
    pocketmine\block\Block;
    use 
    pocketmine\math\Vector3;
    use 
    pocketmine\item\Item;

    class 
    Main extends implements L{
       
        public function 
    onEnable(){
            
    $this->getServer()->getPluginManager()->registerEvents($this,$this);
            
    $this->saveDefaultConfig();
            
    $this->getServer()->getLogger()->info("Włączono - Drop");
        }

       
        public function 
    onBreak(BlockBreakEvent $e){
            
    $player $e->getPlayer();
            
    $block $e->getBlock();
            
    $gracz $e->getPlayer()->getName();
            if(
    $e->getBlock()->getId() == 1){
                switch(
    mt_rand(1,80)){
             
    $player->sendMessage(" • [DROP] Znalazłeś - (1) Węgiel • ");
             
    $player->getInventory()->addItem(Item::get(38801));
             break;
                }
            }
            else{
            }
            if(
    $e->getBlock()->getId() == 1){
                switch(
    mt_rand(1,80)){
           
    $player $e->getPlayer();
             
    $player->sendMessage(" • [DROP] Znalazłeś - (3) Węgiel • ");
             
    $player->getInventory()->addItem(Item::get(35145));
             break;
                }
            }
            else{
            }
  2. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    Please use the new forums for this http://forums.pmmp.io.
    HimbeersaftLP likes this.
  3. PolskiTHEPLAYER
    Offline

    PolskiTHEPLAYER New Member

    Joined:
    Apr 1, 2015
    Posts:
    55
    Minecraft User:
    Flsmers
  4. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    Please just use those forums.
    HimbeersaftLP likes this.
  5. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    please dont repeat said massages
    "Please use the new forums for this http://forums.pmmp.io."
    HimbeersaftLP likes this.

Share This Page

Advertisement