How to give a player items from a list in the config

Discussion in 'Plugin Development' started by blok601, Dec 19, 2015.

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

    blok601

    Hello, I am working on a plugin and I have run into something that I am pretty inexperienced with. I want to have my config be something like this:

    Code:
    pvp:
      items:
      - IRON_SWORD
      - IRON_BLOCK
    
    and give the player the iron sword and iron block. How would I do that. I had the general idea to loop through the configuration section.

    Help would be much appreciated!

    Thanks!

    ~blok
     
  2. Offline

    Zombie_Striker

  3. Offline

    blok601

  4. Offline

    Zombie_Striker

    @blok601
    Code:
    config.set(path.to.itemstack,Itemstack.deserialize);
    config.save();
    
    Itemstack = ItemStack.serialize(config.get(path.to.itemstack));
     
    blok601 likes this.
  5. Offline

    blok601

    Wow, I apologize, that one kind of passed my mind. Thank you.
     
Thread Status:
Not open for further replies.

Share This Page