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

DeadBack Plugin error

Comments in 'Plugin Development' started by Edgar_SM, Jan 15, 2015.

  1. Edgar_SM
    Offline

    Edgar_SM New Member

    Joined:
    Oct 11, 2014
    Posts:
    20
    Minecraft User:
    evermine
    Hi, I'm new to developing plugins. I made a plugin but I skip this error, I reviewed the code and have found none. Please, could you help me, thanks

    Plugin.YML
    Code:
    name: DeadBack
    main: DeadBack\BackToDeathPoint
    version: 1.0.0
    api: [1.9.0]
    load: POSTWORLD
    author: evermine
    
    commands:
        deadback:
            permission: deadback.deadback
            description: Return in the last location
    permissions:
        deadback:
            default: true
            description: Permission
            children:
                deadback.deadback:
                    default: true
                    description: Return player to last death location.
    BackToDeathPoint.php
    Code:
    <?php
    
    //Define namespace
    namespace DeadBack;
    
    //Import plugin base
    //PluginBase
    
    use pocketmine\command\Command;
    use pocketmine\command\CommandSender;
    use pocketmine\plugin\PluginBase;
    use pocketmine\utils\TextFormat;
    use pocketmine\Player;
    use pocketmine\Server;
    use pocketmine\event\player\PlayerDeathEvent;
    use pocketmine\event\Listener;
    use pocketmine\level\Position;
    use pocketmine\level\Level;
    
    
    class BackToDeathPoint extends PluginBase implements Listener {
         
        public $lastdeath = array();
        //Enable plugin :D
          public function onEnable() {
                
             $this->getLogger()->info("onEnable() has been called!");  
            }
               
          public function onDisable() {
             $this->getLogger()->info("onDisable() has been called!");
          }
         
         public function onCommand(CommandSender $sender, Command $command, $label, array $args){
             switch($command->getName()){
                 case "deadback":
                     if($this->lastdeath[$sender->getName()] instanceof Position){
                         $sender->teleport($this->lastdeath[$sender->getName()]);
                         $sender->sendMessage("[DeadBack] You teleported to the last location.");
                         unset($this->lastdeath[$sender->getName()]);
                     }else{
                            $sender->sendMessage("[DeadBack] You only need this command when you die in survival.");
                     }
                     break;
                     }
             }
             public function onPlayerDeath(PlayerDeathEvent $event){   
            $player = $event->getEntity();
            $this->lastdeath[$player->getName()] = new Position(
                round($player->getX()),
                round($player->getY()),
                round($player->getZ()),
                $player->getLevel()
                 );
         }
    }
    
    
    
    /*
    * To change this license header, choose License Headers in Project Properties.
    * To change this template file, choose Tools | Templates
    * and open the template in the editor.
    */
    
  2. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
    You should put the description of the permission nodes and commands inside "Quotes" :p
  3. Edgar_SM
    Offline

    Edgar_SM New Member

    Joined:
    Oct 11, 2014
    Posts:
    20
    Minecraft User:
    evermine
    Pocketmine error:
    16:02:50 [INFO] Starting Minecraft: PE server version v0.10.4 alpha
    16:02:50 [INFO] Loading pocketmine.yml...
    16:02:50 [INFO] Loading server properties...
    16:02:50 [INFO] Starting remote control listener
    16:02:51 [INFO] RCON running on 0.0.0.0:19132
    16:02:51 [INFO] Starting Minecraft PE server on 0.0.0.0:19132
    16:02:51 [INFO] This server is running PocketMine-MP version 1.4.1dev-945 "絶好(Zekkou)ケーキ(Cake)" (API 1.11.0)
    16:02:51 [INFO] PocketMine-MP is distributed under the LGPL License
    16:02:51 [INFO] Loading CustomChat v1.2.2
    16:02:51 [INFO] Loading DevTools v1.9.0
    16:02:51 [INFO] Loading ReportRTS v1.1.0
    16:02:52 [INFO] ----- PocketMine-MP Auto Updater -----
    16:02:52 [INFO] It appears you're running a Beta build, when you've specified that you prefer to run Stable builds.
    16:02:52 [INFO] If you would like to be kept informed about new Beta or Development builds, it is recommended that you change 'preferred-channel' in your pocketmine.yml to 'beta' or 'development'.
    16:02:52 [INFO] ----- -------------------------- -----
    16:02:52 [INFO] Enabling DevTools v1.9.0
    16:02:52 [INFO] Loading source plugin DeadBack v1.0.0
    16:02:52 [INFO] [DevTools] Registered folder plugin loader
    16:02:52 [INFO] Preparing level "world"
    16:02:52 [INFO] Enabling CustomChat v1.2.2
    16:02:52 [INFO] [CustomChat] - CustomChat - Enabled!
    16:02:52 [INFO] Enabling ReportRTS v1.1.0
    16:02:52 [INFO] Enabling DeadBack v1.0.0
    16:02:52 [INFO] [DeadBack] onEnable() has been called!
    16:02:53 [INFO] Starting GS4 status listener
    16:02:53 [INFO] Setting query port to 19132
    16:02:53 [INFO] Query running on 0.0.0.0:19132
    16:02:53 [INFO] Default game type: SURVIVAL
    16:02:53 [INFO] Done (2.462s)! For help, type "help" or "?"




    command: /deadback

    Me va mejor hablar en español
  4. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
    Yo no veo ningun problema alli .-.
  5. Edgar_SM
    Offline

    Edgar_SM New Member

    Joined:
    Oct 11, 2014
    Posts:
    20
    Minecraft User:
    evermine
    Uy perdon, se me ha oblidado ejecutar el comando para que salga el problema
  6. Edgar_SM
    Offline

    Edgar_SM New Member

    Joined:
    Oct 11, 2014
    Posts:
    20
    Minecraft User:
    evermine
    16:14:07 [CRITICAL] Unhandled exception executing command 'deadback' in deadback: Undefined index: evermine
    16:14:07 [NOTICE] ArrayOutOfBoundsException: "Undefined index: evermine" (E_NOTICE) in "/DeadBack/src/DeadBack/BackToDeathPoint" at line 37
  7. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
    Okey... Dejame checar eso....
  8. Edgar_SM
    Offline

    Edgar_SM New Member

    Joined:
    Oct 11, 2014
    Posts:
    20
    Minecraft User:
    evermine
    Ok, gracias
  9. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
    No tienes alguna cuenta de github? Es mas facil que te ayuden de esa manera ;)
  10. Edgar_SM
    Offline

    Edgar_SM New Member

    Joined:
    Oct 11, 2014
    Posts:
    20
    Minecraft User:
    evermine
    si, espera
  11. Edgar_SM
    Offline

    Edgar_SM New Member

    Joined:
    Oct 11, 2014
    Posts:
    20
    Minecraft User:
    evermine
    un momento que suvo el código
  12. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    stop ripping off others plugins! thats the result of being such a pirate. learn php and make ur own! im getting pissed to see people like you.
  13. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
    Take it easy... He is just learning xD if he tries to make something more, I'm sure that everyone will act against him :p
  14. Edgar_SM
    Offline

    Edgar_SM New Member

    Joined:
    Oct 11, 2014
    Posts:
    20
    Minecraft User:
    evermine
    Joshua, I have 14 years and try to learn from tutorials php programming plugins. I'm not going to throw, but if I jump mistakes, ask to learn from those mistakes
  15. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    kill the fire while its still small.
  16. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
    I started like you xD but I already had 15 and I learned directly from PocketMine's new API (At that time, the API was still taking form :p)
  17. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
    That sounds like @PEMapModder xD
  18. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,132
    Plugins:
    4
    Minecraft User:
    iksaku
  19. Edgar_SM
    Offline

    Edgar_SM New Member

    Joined:
    Oct 11, 2014
    Posts:
    20
    Minecraft User:
    evermine
    iJoshuaHD, sorry for having published an error in your plugin. But I'm not a pirate, and do not want to be a pirate
  20. Edgar_SM
    Offline

    Edgar_SM New Member

    Joined:
    Oct 11, 2014
    Posts:
    20
    Minecraft User:
    evermine
    yasta iksaku

Share This Page

Advertisement