-
Notifications
You must be signed in to change notification settings - Fork 50
Creating a kit
- To create a new kit, fill your inventory exactly as you would like it to appear when selecting the kit. The following pieces of information are saved when creating a kit:
- Item data
- Name
- Lore
- Material
- Amount
- Enchantments
- Durability
- Dye
- Potions (normal, splash, lingering)
- Skulls or Heads
- Potion effects
- Max Health
- Armor
- Item data
- When ready, type
/kp create <kitname>
, or/kp create Test
for example
After the kit is successfully created, there will be a new .yml file with the matching kit name under ~/plugins/KitPvP/kits
. This is where you would modify anything about your kit data if you so desire.
At the moment, the only recommended way to "edit" a kit is to delete the kit using /kp delete <kitname>
, and recreate it using /kp create <kitname>
. However, you can also modify the actual kit file which is a bit more tedious. Kit files by default should be very easy to read and understand, but please note that any syntax mistakes (such as pressing tab in the file instead of using spaces) could and most likely will result in that kit breaking.
At the top of every kit file, there is a Kit
section. This section includes three different options which are only customizable via the kit file, and not in-game:
-
Permission
is the permission required to select the kit. By default, the permission is generated to follow the format ofkp.kit.<kitname>
, orkp.kit.example
as an example -
Level
is the level required to select a kit. By default, it is set to 0 so all players can access it, but can be modified if desired -
Cooldown
is the kit cooldown. By default, it is set to 0, or no cooldown at all. If you choose to customize the cooldown of a kit, it uses four different time units:-
D
days -
H
hours -
M
minutes -
S
seconds - The format can be entered numerous different ways so long as time units are separated with a
:
, here are a few examples:Cooldown: 1D:12H:10M:30S
Cooldown: 10H:15S
Cooldown: 7D
Cooldown: 10S
-
-
Health
is the amount of max health the player will have upon kit selection. By default, this is set to 20 (full health). 1 = half a heart. To disable changing the player's health upon kit selection, simply remove remove this line altogether
Commands can optionally be executed when the kit is selected. Simply include a Commands
section at the bottom of your kit file following the standard plugin command format. An example of this feature is included at the bottom of the Example.yml example kit file.
With the default configuration, KitPvP will automatically add a placeholder item to the menu upon kit creation. The generated section will appear as the following:
'0': # slot in the menu
Name: '&a<est Kit' # name of the item in the menu
Material: BEDROCK # material of the item in the menu
Lore: # lore of the item in the menu
- '&7This information can be modified in the'
- '&7menu.yml file. To disable automatic adding to the'
- '&7menu, disable AutomaticallyAddKitToMenu in the'
- '&7config.yml.'
- ' '
- '&e&eLeft-click to select.'
- '&eRight-click to preview.'
Commands: # commands associated with this menu item
Left-Click: # commands run when left clicking this menu item
- 'player: kp kit test'
Right-Click: # commands run when right clicking this menu item
- 'player: kp preview test'
The above information should be easy to modify to your liking. To disable automatic adding to the menu.yml, disable AutomaticallyAddKitToMenu. However, if this option is disabled, you must manually add new kits to the menu.yml.
Kits can easily be deleted from the kits system by using /kp delete <kitname>
. Alternatively, the actual kit file can also be removed from the kits
folder, and upon /kp reload
, the kit will no longer exist in the kits system. /kp delete <kitname>
is the more recommended approach.
After deleting the kit from the kits system, it may also need to be removed from the kit menu (if an item is present for it in the menu, that is). Inside the menu.yml, remove the entire item section pertaining to that kit. An example of a full item section can be found above. Be sure to use caution when removing the item section, as any accidental syntax errors may cause the menu to stop working. It is always recommended to use .yml syntax checker after changing a configuration file to avoid breaking any aspect of the plugin.