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

Console-executable command

Comments in 'Plugin Development' started by deot, Dec 8, 2015.

  1. deot
    Offline

    deot Active Member Plugin Developer

    Joined:
    Apr 22, 2015
    Posts:
    219
    Plugins:
    1
    Minecraft User:
    deot
    Hi, I want to make a command that I can execute from console... But idk how... My current code:
    In plugin.yml
    Code:
    commands:
      addclaim:
        description: Claiming
        permission: c.add
    permissions:
      c.add:
        default: op
    In Main.php:
    PHP:
    public function onCommand(CommandSender $senderCommand $cmd$label, array $args){
                switch(
    strtolower($cmd->getName())){
                    case 
    "addclaim":
                        
    //Code
                    
    break;
                }
    }
    Idk why where I did wrong... when I do /addclaim command from console, it always shows me "Please run command in-game" zzz :p
  2. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    have you written
    PHP:
    if(!$sender instanceof Player){
    $sender->sendMessage("Please run command in-game");
    }
    in //code ?
  3. deot
    Offline

    deot Active Member Plugin Developer

    Joined:
    Apr 22, 2015
    Posts:
    219
    Plugins:
    1
    Minecraft User:
    deot
    No... I didn't check if Player in anywhere it.. That's why im feeling strange...
  4. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    then, can you show the code?
  5. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Does any other plugin have this command too?
  6. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    I didn't see any problem on your code... Can you send full code?
  7. deot
    Offline

    deot Active Member Plugin Developer

    Joined:
    Apr 22, 2015
    Posts:
    219
    Plugins:
    1
    Minecraft User:
    deot
    It doesnt matter with full code... zzz I gave all code related to this problem

    I think i found the problem... NetBeans IDE seems to very buggy in Windows10... I just upgraded my Pc to win 10 yesterday and when I save .php file with NetBeans, sometimes it doesnt save... Hmmm, i will check it out later :)

    NetBeans IDE + Windows 10 = Crap :p
  8. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Well, works for me perfectly:) Tho, Windows 10 has got other problems for me._.
  9. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    [OFF-TOPIC] Thank you for posting that, i was going to update to Windows 10 but now i'll NEVER DO THAT
  10. deot
    Offline

    deot Active Member Plugin Developer

    Joined:
    Apr 22, 2015
    Posts:
    219
    Plugins:
    1
    Minecraft User:
    deot
    I doesn't work for me... It's very buggy... Sometimes, it saved, sometimes it's not... zzzzz....
    Yep... Windows 10 is perfectly bugged for now... Microsoft is doing bad in MCPE Updates and Windows 10 Update... I'm pretty annoyed with Microsoft now... xD
  11. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    windows 10 consume alot of network
    MikkiMCPE likes this.
  12. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    At least, don't bump the thread just for this (useless) information...
  13. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    sorry

Share This Page

Advertisement