TheRedCraft Posted September 5, 2017 Share Posted September 5, 2017 hallo ich will ein player inv in einer datei abspeichern,und das geht ja auch aber das auslesen bereitet probleme public void loadinv(Player p) { String uuid = p.getUniqueId().toString(); File file = new File("plugins/System/XXX/" + uuid + ".yml"); FileConfiguration conf = YamlConfiguration.loadConfiguration(file); ItemStack[] items = null; for(int i = 0; i<36;i++) { if(conf.contains("inv.Slot." + 1)) { items[i] = conf.getItemStack("inv.Slot." + i); }else { items[i] = new ItemStack(Material.AIR); } } p.getInventory().clear(); p.getInventory().setContents(items); } ich spichere die item so ab wie ich sie auslese und kann den Fehler einfach nicht finden vielleicht aber ihr? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now