Saving items in a config

Discussion in 'Plugin Development' started by kampai, Jul 7, 2016.

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

    kampai

    I have made items that do a "special ability" and I'm saving them in the config, however I dont know how I would actually give them a name that I can call back and forth. I was thinking giving them a fixed Meta Data Value and use that to call back and forth which is what I might try. How would I do this?
     
  2. Offline

    ArsenArsen

    ItemMeta is serializable, so it automatically stores it.
     
  3. Offline

    kampai

    @ArsenArsen
    If I create a enum that refers to all the custom items I have, that would work, or is there a different approach I should take
     
  4. Offline

    ArsenArsen

    What do you mean? If you want to store itemstacks, thats easy with set() and getItemStack(), but if you want to make preset itemstacks youre better off making a class with
    Code:
    public static MyItem = new ItemStack(...
    variables for each item.
     
  5. Offline

    kampai

    @ArsenArsen
    Sorry the title was a bit misleading and I'm pretty sure I worded what I said above wrong, but since some of the "abilities" aren't actually an item and just gives an effect, and I need that to be able to toggle on and off, so I'm trying to get that, but at the same time not refer to it as a Itemstack. Right now have is words for the enum for each ability name, and I'm planning to have a list of classes that the enum will switch through. (switch()) but i double that will work
     
Thread Status:
Not open for further replies.

Share This Page