How to save Metadata to a config then read it from the config

Discussion in 'Plugin Development' started by william9518, Dec 29, 2012.

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

    william9518

    Title! I got this plugin, http://dev.bukkit.org/server-mods/nbttagger/, that I am planning to add a new save feature where you would be able to save this item with Metadata and then give the item to anyone by pulling it from the config. I need to know how I can save Metadata into a config and reading it after. I know there is a toString() method in like every class but I have no clue how to read it fromString().
     
  2. Offline

    fireblast709

    If you mean ItemMeta, it implements ConfigurationSerializable. This means ItemMeta (and ItemStacks, as they implement it as well) should be able to be saved to the config by simple setting (someconfig.set("Path", someItemStack); ) and getting (ItemStack i = someconfig.getItemStack("Path"); )
     
Thread Status:
Not open for further replies.

Share This Page