Solved Spawn a chest with items?

Discussion in 'Spigot Plugin Development' started by CrazyTaco, Jul 16, 2018.

  1. Hey! So, I've been trying to spawn a chest with some items in it. Other thread recommended doing this

    Block block = loc.getBlock();
    Chest chest = (Chest)block.getState();
    Inventory inv = ((InventoryHolder) chest).getInventory();

    ItemStack test = new ItemStack(Material.STONE);


    But I get the error:

    I haven't been able to find anymore information on the subject. Does anyone have any clues?
  2. Soultion: I used the import for a chest material opposed to a chest block (facepalm)
    • Like Like x 1