How could I upload an inventory in a "chest"? This would be to load the inventory Code (Text): final File file = new File("plugins//Cinematic-Death//Kits//" + args[0] + ".yml"); final YamlConfiguration inv2 = YamlConfiguration.loadConfiguration(file); final List<?> list = (List<?>)inv2.getList("inventory"); And with this charge the chest Code (Text): Location block2 = new Location(world, loc.getX(),loc.getY(),loc.getZ()); block2.getBlock().setType(Material.CHEST); Chest chest = (Chest) block2.getBlock().getState(); Inventory inv = chest.getInventory(); inv.addItem(new ItemStack(Material.WOOD,1));
Get an Array of the contents from the file and then use #setContents(org.bukkit.inventory.ItemStack[]) to replace the contents of the chest with your loaded Array.