How to read config.yml to add inventories, and ItemStacks to those inventories?

Discussion in 'Plugin Development' started by retsaoT, Feb 13, 2019.

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

    retsaoT

    Hello!
    I am looking for a way to have my plugin read off of its corresponding config.yml to create inventories to open, and to add items to those inventories.

    Thanks in Advance,
    retsaoT
     
  2. Offline

    KarimAKL

    @retsaoT You can get something from the config.yml like this:
    Code:Java
    1. //In main class
    2. getConfig().getString("path.to-string");
    3. getConfig().getInt("path.to-integer");
    4. getConfig().getItemStack("path.to-itemstack");
    5. //etc

    If you are doing this from another class then just pass the instance of your main class to that class.

    I'm not sure i understood your question correctly so please let me know if this didn't answer your question.
     
Thread Status:
Not open for further replies.

Share This Page