Enchantment id?

Discussion in 'Plugin Development' started by immensebuttpain, May 27, 2015.

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

    immensebuttpain

    My plugin StarCache has different kits, well to put an item into a kit you do [item id]%[amount]
    So for one diamond chestplate it's: 311%1
    How can i add an enchantment to that line of code?
    Code:
    caches:
    DiamondArmor:
    - 310%1
    - 311%1
    - 312%1
    - 313%1
    This is my code for diamond armor kit, how can i add prot 4 to the armor?
     
  2. Offline

    Zombie_Striker

    @immensebuttpain
    It seems you can't. If you can only input the ID and an amount, then you can't add anything besides those two values.

    [Edit] If it's your own plugin, the create a new String/char that you can split by (e.g. * or [Ench] )
    Since you're using % as the split, make args[0] the ID, [1] the Amount, [2 ] Ench, [3] ect.
    and create a value to each enchantment (sharpness == 1; Fireasp == 2)
     
  3. Offline

    immensebuttpain

    maybe i should try a different format, what other format should i use?
     
  4. Offline

    Zombie_Striker

  5. Offline

    immensebuttpain

    Won't this work:
    - ==: org.bukkit.inventory.ItemStack
    type: DIAMOND_SWORD
    meta:
    ==: ItemMeta
    meta-type: UNSPECIFIC
    enchants: KNOCKBACK: 1
     
  6. Offline

    Zombie_Striker

    @immensebuttpain
    It can, and that is the way it should be done, but if you want to keep the ID/Amount/Ench idea of saving you would use my method. The way you just said is the way to do it if you cant though.
     
Thread Status:
Not open for further replies.

Share This Page