Server selector help!

Discussion in 'Plugin Development' started by HarutCraft, May 20, 2015.

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


    im coding a server selector plugin and i don't know how to make it execute a command on the click of a item in a GUI right now my code is : can someone help me?
  2. Offline


    Just sayin', if you want to have a more "automated" GUI system, you could use the InventoryGUI and IAction classes from EnviousAPI, link in signature.
  3. Offline


    sooo right now i have how do i choose what command it will execute when i click on golden apple
  4. Offline


    1) Create a new InventoryGUI
    2) Add an item with an IClickEvent that runs a command when they click it
    3) Open the inventory for a Player
  5. Offline


    Just for future reference, the way to execute a command as console is:
    Bukkit.executeCommand(Bukkit.getConsoleSender(), COMMAND_HERE); 
    The way to make a player do a command
    Player p;
  6. Offline


    here is my code right now im getting a error on line 78 that plugin is not variable
  7. @Nateb1121 Also, executeCommand() isn't just for the console - it's for any CommandSender. So you can always just replace Bukkit.getConsoleSender() with the player and it'd also work.

    @HarutCraft It's clear from your code that you are fairly new to Java. Please learn the basics of Java, before trying to make a plugin. Bukkit is written in Java, so learning it is compulsory. Otherwise you will just run into problems such as this, and have no idea how to solve them. I'd recommend the Oracle tutorials or a Java book.
    nverdier and Nateb1121 like this.
Thread Status:
Not open for further replies.

Share This Page