Kit from config

Discussion in 'Plugin Development' started by yologamer384, Sep 15, 2017.

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

    yologamer384

    Hi forum, i'm trying to create a kit plugin but i don't know how to create a kit that take items from config like:
    Code:
    kits:
       <name>:
           item: DIAMOND_SWORD
           name: '&6Sword'
           enchant: ALL_DAMAGE:4,DURABILITY:1
           slot: helmet/inventory/chestplace/leggings/boots
             autoequip: true/false
           item: DIAMOND_CHESTPLATE
           name: '&6Ddragon Chestplate'
           enchant: DURABILITY:1,PROTECTION:5
           slot: inventory/helmet/chestplace/leggings/boots
             auto-equip: true/false  
    I know how create an itemstack but not this
     
  2. Offline

    Caderape2

  3. Offline

    yologamer384

    I know how to create a file config like this:
    Show Spoiler

    Code:
    kits:
       <name>:
           item: DIAMOND_SWORD
           name: '&6Sword'
           enchant: ALL_DAMAGE:4,DURABILITY:1
           slot: helmet/inventory/chestplace/leggings/boots
             autoequip: true/false
           item: DIAMOND_CHESTPLATE
           name: '&6Ddragon Chestplate'
           enchant: DURABILITY:1,PROTECTION:5
           slot: inventory/helmet/chestplace/leggings/boots
             auto-equip: true/false  

    But not how to combine and create a class
     
  4. Offline

    CraftCreeper6

    @yologamer384
    The ItemStack class is serializable. So take advantage of this and use config#getItemStack(path) and it should make it quite a bit easier for you.
     
Thread Status:
Not open for further replies.

Share This Page