How could I upload an inventory in a "chest"?

Discussion in 'Spigot Plugin Development' started by Vrsd12, May 4, 2017.

  1. 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));
     
     
  2. READY IS ALREADY :3