Im making a plugin and for this plugin I need to store ItemStacks. So I created a hashmap <string, itemstack> and used file = new File (path) and then file.createNewFile () to store the data with ObjectOutputStream oos = new ObjectOutputStream (new BufferedOutputStream (new FileOutputStream (path))); Oos.writeObject ((Object) hashmap); Oos.flush (); Oos.close (); But it gives an error, because it (I think) can only store hashmaps with ints strings etc. Not somthing like itemstack. Does anyone know a better way to store itemstacks? In particular written books.