Create your own Kit (KitPvP)

Discussion in 'Plugin Requests' started by Xp10d3, Jun 19, 2020.

  1. Offline

    Xp10d3

    Plugin category: PvP

    Minecraft version: 1.8.8

    Suggested name: I have no clue :p

    What I want: This is pretty simple. So my KitPvP server will have voting, which we want to allow players to add to their own custom kits. How this will work is that players will be able to access the default kits but then also be able to use the command /addkit <kit_name> to add the item to their own custom kit. Then, upon doing /customkit <kit_name>, their inventory will be cleared and items they have added to the kit will be given. Players can also create kits using the command /createkit <kit_name>. If they try to create a kit with the same name an error will be sent. The amount of kits players can create should be configurable. By default 3 is a good number, but if players buy a rank they will be able to create more kits (permission based like pvp.createkit.<number>). There also should be a GUI to configure kits. For example, doing the command /kitgui will show a GUI with the kits they have as well as shared kits (explanation later). Clicking on a kit will open a GUI that shows an option to change the icon for the kit, the name of the kit, the items in the kit (so some can be removed), an option to delete the kit, and whether to make the kit sharable. If you turn on the option to share the kit, a message will be sent through chat to type the user's IGN. Upon doing so, IF the player is online a message will be shown on the other player's side asking whether to allow the kit to be shared. If you click [AGREE] you will be able to configure the shared kits in the /kitgui under "shared kits". In the GUI will show all the shared kits you have. Upon clicking one of the shared kits, you can either remove the kit and "unshare" it, or copy it to your own kits to configure later IF you have obtained the items beforehand. You can see the kits through /sharedkit <kit_name>. There also is an option to disable sharing kits so no one can share kits with you. You can do this using the command /sharekit <on/off>. There also should be a command (/kitblacklist) to blacklist certain items. For example, if you have the permission pvp.blacklist, and you do the command /kitblacklist, whatever item is in your hand will not be allowed to be added to a kit.

    Ideas for commands:
    /addkit <kit_name>: Adds item in hand to kit based on name.
    /customkit <kit_name>: Clears inventory and gives all items in the kit.
    /createkit <kit_name>: Creates a kit based on the name.
    /kitgui: Shows the kit GUI.
    /sharedkit <kit_name>: Clears inventory and gives all items in the shared kit.
    /sharekit <on/off>: Toggles sharing kits.
    /kitblacklist: Blacklists the item you are holding in your hand.

    Ideas for permissions:
    pvp.createkit.<number>: How many kits a player can create. By default it should be 3. Default: everyone
    pvp.addkit: Allows whether players can add items to a kit. Default: everyone
    pvp.createkit.allow: Allows whether players can create a kit. Default: everyone
    pvp.kitgui: Allows whether players can access the kit GUI. Default: everyone
    pvp.sharekit.kit: Allows whether players can share kits. Default: everyone
    pvp.sharekit.toggle: Allows whether players can toggle sharing kits. Default: OP (for ranks)
    pvp.blacklist: Allows blacklisting items. Default: OP

    When I'd like it by: As soon as possible (need to set up voting).
     
  2. Offline

    Zxoir

    Hey, I would love to do this. I read through everything but I still don't have a deep understanding on how u want the GUI to look and work. If you can, please provide some more explanation and possibly a screenshot on how you want it to look. Also, how would you like to save this data? Do you have a MySQL database? If not I'll be using a flat file (config file). Last question, can you give me the maximum number of kits to create.

    Edit: Will the kits also save the armour contents?
     
    Last edited: Jun 20, 2020
  3. Offline

    Xp10d3

    @Zxoir Alright. So for the GUI, there is one that contains all the kits you yourself have created. You can access this through /kitgui. In that GUI, all kits you have created through /createkit will be shown there with their names. Clicking on a kit will show all the items used in that kit as well as when it was created, whether it has been shared with any other players, and if it has been shared with other players how many players it has been shared with. The item that displays whether it has been shared with other players can be clicked on to open another GUI with all players it has been shared with. You can unshare the kit by clicking on their name to remove them from the kit. There is another part of the GUI that is called "Shared Kits". Shared Kits are kits players have shared with you. Clicking on the Shared Kits area, you can view kits based on their names but you cannot access the kit itself without obtaining the item beforehand. For example, if there was a kit that contained a Diamond Sword with Sharpness II, you can't use that kit unless you have obtained a Diamond Sword before (enchantments don't matter). Clicking on a Shared Kit, you can see the items that are in there as well as who made it, the date it was made, and how many people it has been shared with. There should also be an item that allows you to use the kit if you have obtained all items previously.
    And yes, the kits will save armor contents.
    Sorry if this is confusing. If you have any more questions let me know :)
     
  4. Offline

    Xp10d3

    Ey @Zxoir . You doing this plugin? If so any progress?
     
  5. Offline

    Zxoir

    Hey! Sorry, been inactive for a while. Yea I am working on this. I haven't done much yet.


    I understand how the GUI works, but I'm confused on how you want the shared kits to work. Can you rephrase it please.
     
    Xp10d3 likes this.
  6. Offline

    Xp10d3

    Alright; thanks for letting me know :) Sure. Basically, let's say that Player1 created a kit containing a diamond sword with fire aspect 1, leather armor with thorns 5, an enchanted golden apple, and a golden apple. He can then share a kit with Player2. After creating a kit, Player1 will have to use the command /kitgui. In the GUI, his created kit will be shown there along with any kits that have been shared with him. Let's say he clicks on the kit containing the fire aspect sword. There will be multiple options to change the kit that I described already, but let's say Player1 clicks on the "Share Kit" option. It will close the GUI and ask Player1 to type the player's IGN in chat in order to share the kit with another player. A confirmation will appear in chat on Player2's side asking whether they want to accept the kit from Player1's side. The message will look something like this:

    Player1 wants to share kit "Kit Name".
    [Agree] [Ignore]

    Clicking on [Agree] will add the kit to Player2's kits. Clicking on [Ignore] will cancel sharing the kit. Let's say Player2 clicks [Agree]. Player2 can now see the kit by doing /kitgui. It will appear under "Shared Kits" in the GUI and Player2 can now click on it. Doing so will show a few options including the option to remove the kit entirely (it won't show in the GUI anymore), view the kit's contents (not edit it. Note that an user can also see the contents of the kit using /sharedkit <kit_name>), or copy the kit to Player2's personal kits to configure it later. However, if Player2 hasn't obtained a diamond sword (as that is part of the shared kit), he cannot copy the kit. He also won't be able to use the kit if he hasn't obtained any of the contents in the kit. For example, there is leather pants, an enchanted golden apple, and an enchanted diamond sword. If Player2 hasn't obtained all of the contents (leather pants, enchanted golden apples, or a diamond sword) then they can't use the kit or copy it. Anyways, that's the main concept of sharing kits. There are a few more features including the ability to turn off sharing kits entirely using the command /sharekit off. This means that no one can share kits with you.

    Hope this helps :)
     
  7. Offline

    Xp10d3

    Hey any updates so far @Zxoir ?
     
  8. Offline

    Xp10d3

  9. Offline

    Xp10d3

  10. Offline

    Xp10d3

    Bumppety bump. If anyone wants to take over this feel free to. Don't know whether @Zxoir is interested in this anymore...
     
  11. Offline

    Xp10d3

  12. Offline

    Eltik

  13. Offline

    Xp10d3

  14. Offline

    Xp10d3

  15. Offline

    Xp10d3

    Bump -__-
     
  16. Offline

    Spyromain

    Hey, I'll take over this. @Zxoir, do not hesitate to reply even if I start coding stuff. ;)

    I think I understood almost everything thanks to your explanations.

    I just need more clarification about what /customkit <kit_name> and /sharedkit <kit_name> have to do.
    (1) Do you want them to directly wipe out the player inventory and replace everything by all items in the kit.
    That's what I understood when you stated: "Clears inventory and gives all items in the kit".
    (2) Or do you want them to open a GUI listing every items of the kit with either a button to do (1) or simply picking up each item you want from the GUI?
    You said "You can see the kits through /sharedkit <kit_name>", it puzzled me. [pig]

    One last thing I want to point out: you talked about "items that you have obtained". Minecraft already gets track of mined/crafted/used blocks and items. I can also make the plugin listen to events like picking up items and clicking an item in an inventory. Then, if you obtain an item by any fancy way, it may not be tracked. Unless the plugin checks every player inventory every tick which can have a performance impact.
     
  17. Offline

    Xp10d3

    Bump
    EDIT: Ahhhh I didn't see your post Spyromain sorry.
     
    Last edited: Jul 23, 2020
  18. Offline

    Xp10d3

    Hey, thanks for doing this @Spyromain !
    1. Yes, I'd like /customkit to replace everything except for the items in that kit.
    2. I'd like a GUI listing every item of the kit with a button.
    And by, "You can see the kits through /sharedkit <kit_name>" was a typo. What I meant was "You can see the kits through /kitgui." What I mean by this is when you do the command /kitgui there should be two options: one item saying, "Created Kits" and the other item saying, "Shared Kits". Clicking "Created Kits" should show all the kits they have created, while "Shared Kits" should show all the kits that they have shared. I accidentally said, "You can see the kits through /sharedkit <kit_name>" while I meant "You can see the kits through /kitgui." /sharedkit <kit_name> gives you the shared kit. Hope that makes sense :) If not let me know. Sorry for the confusion.
     
  19. Offline

    Xp10d3

  20. Offline

    Spyromain

    No problem, you didn't see my post because it was not visible (waiting for approval). :p
    And your extra explanation does make sense, thank you!
    Yeah I've started. I will send you a first version soon.
    One more thing: you said you wanted armour contents to be saved. But how?
    When someone does /customkit or /sharedkit, I put the first armour items that I find in the slots?
    So if there are two helmets, it will be the first one added in the kit that will be in the slot.
    Or do you want a /addarmorkit command to specify when you want it to be in the slot?
    If so, for the GUI I think four slots could be reserved for armour items.
     
    Xp10d3 likes this.
  21. Offline

    Xp10d3

    Sorry when saving kits, I want the armor they have on to be saved along with any items they currently have in their inventory. And yes, if it's easier put the first armor items that the plugin finds in the slots. Or do this:
    Player has armor currently on and saves the kit. They do /customkit or /sharedkit and the armor they had on when they saved the kit gets put on.
    Either way works fine. Whichever is easiest :)
     
  22. Offline

    Xp10d3

Share This Page