GUI Plugin

Discussion in 'Plugin Requests' started by Invenstory, Jan 16, 2020.

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

    Invenstory

    Hello.

    I want to ask you guys if you know any plugins that don't quit from the GUI directly when you press E or ESC
    Example: There is a GUI to select kits, You choose "Default Kits" and then you get on a new GUI with the default kits. If you try to quit from the gui by pressing E or ESC, the gui doesn't close directly, it goes you back to "Default Kits"
     
    Last edited by a moderator: Jan 18, 2020
  2. Offline

    Xp10d3

    Don't worry; you're in the correct forum. I get what you mean. I have a KitPvP plugin that has kits and a GUI with already-made kits. It's not customizable (lol it was my first plugin) and you can still press E or ESC to exit out of it, but I don't know if it's possible to make what you're asking for. I'm no pro by any means; just trying to help :) But there are other plugins out there that do direct you back to the main page of the kits upon clicking them. I'll add some links here.

    My plugin: https://dev.bukkit.org/projects/xpvp

    Other plugins:
    https://dev.bukkit.org/projects/hero-kits-pvp
    CMI
    https://dev.bukkit.org/projects/battlekits
    https://dev.bukkit.org/projects/lmckits-pvp-kits-plugin
    https://dev.bukkit.org/projects/elitekits
    https://dev.bukkit.org/projects/prepare-for-pvp
    https://dev.bukkit.org/projects/kit-pvp

    Hope some of those help! If you want I can try and modify my plugin to do something similar to that.
     
  3. Offline

    Cervisial

    You'd probably have to get in contact with a developer to make this for you. I'm not entirely sure what you want to be a part of the plugin, so I can't help you at the moment. I'd be happy to make this for you, but you have to give me more information about what you want the plugin to contain.
     
  4. Offline

    Invenstory

    Thanks but i don't need a kit plugin, the kits in my thread was just an example. I want for every kind of gui

    Hmm because im bad at english i can't explain it more but i will try.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 20, 2020
  5. Offline

    Xp10d3

    Oh I see. So you're looking for something that disables closing the GUI? This seems quite simple, so I think their should be some plugins out there. You just check if the player's inventory is open, then cancel the event. If you want I can give a crack at it.

    EDIT: Never mind; not simple xD I just tried it; apparently InventoryCloseEvent is client side, so you can't cancel the event that easily. Sorry about that. Anyone else want to try?
    Code:
    package disable.gui.xp10d3;
    
    import org.bukkit.configuration.file.FileConfiguration;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.inventory.InventoryCloseEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Core extends JavaPlugin implements Listener {
       
        FileConfiguration config = getConfig();
       
        public void onEnable() {
            loadConfig();
            this.getServer().getPluginManager().registerEvents(this, this);
        }
       
        public void loadConfig(){
            getConfig().options().copyDefaults(true);
            saveConfig();
        }
       
        //String check = this.getConfig().getString("world.check.");
       
        @EventHandler
        public void checkInv(InventoryCloseEvent event) {
           
        }
       
    }
    
     
    Last edited: Jan 21, 2020
  6. Offline

    KarimAKL

    @Xp10d3 Try using Player#openInventory(event#getInventory()) instead of cancelling the event. You might have to run this 1 tick later.
     
  7. Offline

    Xp10d3

    Alright. Thanks. This is a noob question but how do I get the player inside InventoryOpenEvent? I can't do Player player = event.getPlayer(); or event.getWhoClicked().
     
  8. Offline

    KarimAKL

    @Xp10d3 InventoryCloseEvent & InventoryOpenEvent both have a getPlayer() method, though it returns a HumanEntity, so you need to cast it to a player.
     
  9. Offline

    Xp10d3

    Attached Files:

  10. Offline

    Invenstory

    Hello,
    thanks you so much i will try this right now

    ehm what version you made the plugin?
     
  11. Offline

    Xp10d3

    1.15. Should work for every version above 1.12 though I think.
     
  12. Offline

    Invenstory

    im using 1.8...
     
  13. Offline

    Xp10d3

    Oh heck. I think it should still work. I don't know how GUI's work, but above 1.12 is just an estimate. I'm sure 1.7+ could work as well. Sorry, I don't know; try it and see.
     
  14. Offline

    Invenstory

    im asking cuz the plugin is not working :3
     
  15. Offline

    timtower Administrator Administrator Moderator

    Then please post a version number when requesting a plugin. Or use the entire suggested format.
    Do you have errors? If so: please post them.
     
    Xp10d3 likes this.
  16. Offline

    Invenstory

    I didn't ask to make a plugin, i just asked if there are any available.
    I appreciate it @Xp10d3 for making the plugin but still i don't know what's wrong, i don't even get any errors on console
    Sorry for my late reply
     
  17. Offline

    Xp10d3

    All good. And I don't think there are any available. So is there anything wrong with the plugin? I don't exactly know what you mean by:
    Is something wrong with the plugin? Did you check at the very very top of your console? If the plugin is outdated or if there is something wrong with the version, plugin.yml, etc. it's at the top.
     
  18. Offline

    Invenstory

    I Checked, There is nothing for this plugin..
     
  19. Offline

    Xp10d3

    Ok so does it work?? If not why; does it cancel closing out the event? I need to know what you mean by it's not working please.
     
    Last edited: Jan 30, 2020
  20. Offline

    Invenstory

    I've added the plugin to my plugins list but it in game when i do /pl it won't show it
     
  21. Offline

    timtower Administrator Administrator Moderator

    Please post your full server log using https://pastebin.com
     
  22. Offline

    Invenstory

    Ehm don't blame me... i just found the error in latest.log file :( i was trying to find it from console.. Sorry for wasting your time guys

    https://pastebin.com/d81jP6rZ
     
  23. Offline

    timtower Administrator Administrator Moderator

    Console does not always go back far enough ;)
    Open up the jar with a zip program, open the plugin.yml
    Change this line:
    Code:
    main: disable.gui.xp10d3
    into
    Code:
    main: disable.gui.xp10d3.Core
    @Xp10d3
     
  24. Offline

    Xp10d3

    Attached Files:

  25. Offline

    Invenstory

    Hey, lol I don't want a plugin that disables to quit from a GUI
    Here an example of what i want.
    You open a kit gui, In this gui there are 2 selections, default kits and donator kits, you click on default kits and you go in a new gui, if you press E or ESC the gui will not close, you will be moved back to Selection Kit gui
    THIS IS AN EXAMPLE, i want this for every kind of guis

    With this plugin i can't even close the gui
     
  26. Offline

    timtower Administrator Administrator Moderator

    @Invenstory Then provide all information in full detail.
    How it works, commands, permissions, configuration.
    The information that you have provided is very minimal.
     
    Xp10d3 likes this.
  27. Offline

    Xp10d3

    Like tim said I'm super confused on what you want. I thought you wanted something that disables quitting a GUI. And also the thing tim sent doesn't necessarily mean thats what the plugin is; usually my packages are along the lines o xp10d3.corelia.online or whatever. Anyway, what exactly are you talking about? Do you want something that moves you to a different GUI or what? Cause what I'm getting is that you want me to create something that moves you from one GUI to another which isn't necessarily possible since I don't have the code for what plugin you're using and therefore cannot change something that isn't from the same plugin.
     
  28. Offline

    Xp10d3

Thread Status:
Not open for further replies.

Share This Page