Solved Console Command

Discussion in 'Plugin Development' started by Jayyy, Sep 17, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Jayyy

    Hey guys I'm making this plugin to upload to my bukkit dev page and I was wondering how I would be able to make the command available to Console and Players :) If possible can you show me a demonstration with a simple instance like kick heal or ban doesnt matter as long as I can see how it would work :) Thanks :)
     
  2. Offline

    oceantheskatr

    Post the code you currently have on http://pastebin.com/ and link the URL here. This will let us provide examples based on your current code, and see what you already have.
     
  3. Offline

    timtower Administrator Administrator Moderator

    Moved to plugin development.
     
  4. Offline

    boomboompower

    Just make the
    Code:
    if (!(sender instanceof Player)) {
    have what you would do regularly if they weren't a player

    e.g
    Code:
    if (cmd.equalsIgnoreCase("test")) {
           if (!(sender instanceof Player)) {
                        Bukkit.getServer().broadcastMessage("It works!");
                  } else {
                      Player p = (Player) sender;
                        Bukkit.getServer().broadcastMessage(It works normally!);
                    }
     
  5. Offline

    Jayyy

    Thought so I was doing ConsoleCommandSender instead lol thanks tho :)
     
Thread Status:
Not open for further replies.

Share This Page