InputGui - Use the cmd block gui to read strings!

Discussion in 'Resources' started by Cybermaxke, Jul 18, 2013.

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


    I have found a way to use the command block gui to read strings and using them, I made a small plugin with api for this so multiple plugin should be able to use it and making it a lot easier to use. :) The other text on the gui can be removed by using a modified resource pack. It already uses ProtocolLib to read incomming packets but doesn't use any nms.
    I hope this will be usefull. ;)

    Download: Build Server, or if it's unavailable get it from my Repo.
    Source: Github

    You can also import the dependency using maven:
    Here is a example how to use it:
    This is how you should be able to get the api:
    InputGuiAPI api = (InputGuiAPI) Bukkit.getPluginManager().getPlugin("InputGui");
    Now, once you can acces the api, you can make the player opening a gui:
    Player player = ...;
    InputPlayer iplayer = api.getPlayer(player);
    iplayer.openGui(new InputGui() {
        public String getDefaultText() {
            return "This is a example!";
        public void onConfirm(InputPlayer player, String input) {
            player.getPlayer().sendMessage(this.getDefaultText() + " -> " + input);
        public void onCancel(InputPlayer player) {
    That is everything you need to do!
    Please post issues below or on github.

    A small video:
    Goblom, ampayne2, jyhsu and 16 others like this.
  2. Offline


    No way.
    Edit: Pics?
  3. Offline


    It'll be awesome when servers can suggest these.
    jtjj222 likes this.
  4. Offline


    I will post a small vid ;) and I will also need to improve the close checks.

    hawkfalcon I posted a video as proof. ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Apr 9, 2016
  5. Offline


    :eek: I was going to make this a while ago.. then forgot about it.

    Good work!
  6. Cybermaxke
    Suggestion: Add support for the anvil gui too (Yes thats possible done that already).
  7. Offline


    I will look into it how I can do it. ;)

    Should I make a custom event to do this? Because its still a part of a inventory.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Apr 9, 2016
    Ultimate_n00b likes this.
  8. If you use the inventory solely for the String input and disable all of the other slots you could just do it like you did with the commandblock, couldn't you?
  9. Offline


    I will try it, but I will also make a optional event.
    EDIT: I don't think that you can use the rename box without a item in the first slot.
  10. Offline


    • Added a command block edit event.
    • Added a item rename event.
    Some examples:
    public void onCommandBlockEdit(CommandBlockEditEvent e) {
        if (e.getNewCommand().equalsIgnoreCase("Apple")) {
            e.setNewCommand("Awesome Apple!");
        } else {
    public void onItemRename(ItemRenameEvent e) {
        if (e.getInventory().contains(Material.APPLE)) {
            e.setNewName("Awesome Apple!");
        } else {
    DoggyCodeâ„¢ and mncat77 like this.
  11. Offline


    Cybermaxke You are amazing. 'Nuf said. Fantastic work!
  12. Offline


    • Fixed that color chars are filtered.
  13. Offline


    Cybermaxke I got so many great ideas with this, but is it possible to change the text via packets or something?
  14. Offline


    Yes, the same way when you will open the gui.
    What do you want to try?
  15. Offline


    By text I mean like Command Block, etc. Also my ideas a secreet :3
  16. Offline


    Will this API be submitted to the DBO any time soon ?
  17. Offline


    Theres no need for it to be submitted? Just include the classes in your project
  18. Offline


    bobacadodl I would rather use the Jar provided from the maven repo which is actually a bukkit plugin. It makes less conflicts with other plugins.

    But, if project will never be submitted i guess i will have to to add the classes to my project
  19. Offline


    Mhm, can't get this to work on 1.5.2, any ideas, doesn't throw up a error, just no gui opens
  20. Offline


    This isn't working with 1.5.2 because the packets were added in version 1.6.2 ;)
  21. Offline


  22. Offline


    Oh, sorry, sure :)
  23. Cybermaxke So I do have to import protocolLib as an external jar, not?
  24. Offline


    Please make it undependable to other plugins, and to one or couple classes, that we could put inside our plugins.
  25. Offline


    Would it be possible to put custom text in the other box (for the command block) ?
  26. Offline


    Hey Guys ! When I try to run the InputGUI Plugin I got multiple ProtocolLib errors, Does anyone know why ?
  27. Offline


    This is great but would be better if it was just a couple of classes rather than a whole plugin that each project has to depend on :)
    T3h Cr33p3r likes this.
  28. Offline


    So is there a way to use this without making them need to get this plugin, mainly because this is made for 1.6.x and because it would be nice to have everything in one plugin.
  29. Offline


    Wondering if this is going to be / is updated for 1.7.2 and 1.7.2 ProtocolLib? I'd love to use this :)
  30. Offline


    Excellent plugin ! Toni This actually work with 1.7.5
Thread Status:
Not open for further replies.

Share This Page