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

loader class Sos

Comments in 'Plugin Development' started by rinkuno, Jul 19, 2016.

  1. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Show me the error and your code. I can't magically know what the error is. :rolleyes:
    rinkuno likes this.
  2. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
    Where do I place It the code is

    PHP:
    <?php
    namespace plugin;

    use 
    pocketmine\plugin\PluginBase as base;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\utils\TextFormat as §;

    class 
    MainBase extends base{
         public function 
    onEnable(){
            
    $this->getLogger()->info("onEnable() has been called!");
        }

        public function 
    onDisable(){
            
    $this->getLogger()->info("onDisable() has been called!");
        }
       
       
        public function 
    onCommand(CommandSender $senderCommand $command$label, array $args){
        if(
    strtolower($command->getName()) === "cmd"){
            
    $sender->sendMessage(§::RED "WIP");
            return 
    true;
        }

        return 
    false;
    }
    }
  3. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Change return false to return true if you dont want players to get usage messages
  4. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
  5. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
    What about plugin.yml what can I fix

    ===== Plugin.yml =====


    name: PluginCustom
    version: 1.0.0
    api: [2.0.0]
    main: plugin\MainBase
    author: WBT_EmeraldLord

    commands:
    cmd:
    description: "This is a test command"
    usage:
  6. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    usage: "/cmd [args]"
  7. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
    I don't want args jeez
  8. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Was just an example... usage: "/cmd"
  9. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
    No same error JEEZ
  10. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    You can remove the last return true; it's not really required OKAY
  11. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
    Nope still not trying to make u mad or such but it won't work
    Survingo likes this.
  12. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Then give us the error.
  13. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    Avoid using non-alphanumeric/non-underscore as class name aliases! Class aliases are just a way to somehow rename the class within the usage in your file, but it should still conform to the rules of naming a class! Maybe it may work, but it is definitely bad! This is especially true when there are people viewing your code in another encoding. Source code should always try to work with all kinds of encoding! (Yes, so if you want to have non-ASCII string literals, you should actually try to use hex escapes like \x?? rather than typing them out literally)
  14. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
    No it's the usage how can I avoid it from the usage to the actual usage that is

    $sender->sendMessage(TextFormat::Aqua . "W.I.P");
  15. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
  16. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    That isn't the usage message
  17. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
    Ik. I want that message to happen
  18. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
  19. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Then set the usage to that in the plugin.yml.
  20. rinkuno
    Offline

    rinkuno Active Member

    Joined:
    Oct 8, 2014
    Posts:
    59
    Minecraft User:
    rinku
    I nead help on multicraft i nead a configuration for

    Code:
    ServersCanada | Test ServerConsole
    Server Console
    
    
    
    25.07 18:51:49 [Multicraft] Received start command
    25.07 18:51:49 [Multicraft] Loading server properties
    25.07 18:51:49 [Multicraft] Starting server!
    25.07 18:51:49 [Multicraft] Loaded config for "Other: PocketMine-MP"
    25.07 18:51:49 [Multicraft] Server executable "../jar/bin/php.exe" not found, server startup might fail!
    25.07 18:51:49 [Multicraft] Updating eula.txt file
    25.07 18:51:49 [Multicraft] Failed to start server: [Error 2] The system cannot find the file specified
    25.07 18:51:49 [Multicraft] Is Java installed and in the PATH environment variable?
    25.07 18:51:49 [Multicraft] Restarting crashed server in 5 seconds
    25.07 18:51:49 [Multicraft] Server stopped
    25.07 18:51:54 [Multicraft] Loading server properties
    25.07 18:51:54 [Multicraft] Starting server!
    25.07 18:51:54 [Multicraft] Loaded config for "Other: PocketMine-MP"
    25.07 18:51:54 [Multicraft] Server executable "../jar/bin/php.exe" not found, server startup might fail!
    25.07 18:51:54 [Multicraft] Updating eula.txt file
    25.07 18:51:54 [Multicraft] Failed to start server: [Error 2] The system cannot find the file specified
    25.07 18:51:54 [Multicraft] Is Java installed and in the PATH environment variable?
    25.07 18:51:54 [Multicraft] Restarting crashed server in 5 seconds
    25.07 18:51:54 [Multicraft] Server stopped
    25.07 18:51:55 [Multicraft] Received stop command
    25.07 18:51:55 [Multicraft] Server stopped
    25.07 18:51:56 [Multicraft] Received stop command
    25.07 18:51:56 [Multicraft] Server stopped
    25.07 18:51:56 [Multicraft] Received stop command
    25.07 18:51:56 [Multicraft] Server stopped
    25.07 18:51:56 [Multicraft] Received stop command
    25.07 18:51:56 [Multicraft] Server stopped
    

Share This Page

Advertisement