Solved IllegalArgumentException: Invalid inventory size; expected 9 or less

Discussion in 'Spigot Plugin Development' started by Nutowen, Apr 29, 2017.

  1. https://hastebin.com/pezeqecodu.css

    Code (Text):

    List<ItemStack> listitems = new ArrayList<>();

        for (String s : getConfig().getConfigurationSection("Common.Items").getKeys(false)) {
            listitems.add(getConfig().getItemStack("Common.Items." + s + ".item"));
        }
        ItemStack[] array = listitems.toArray(new ItemStack[listitems.size()]);

        InvCLickAdmin.getInstance().invC.setContents(array);
     
     
  2. Looks like you may be trying to put 10+ items into a 1 line inventory
     
  3. Ok there was extra stuff in config which was messing it up!

    When I reload the inventory is just full of glass
     
    #3 Nutowen, Apr 29, 2017
    Last edited: Apr 29, 2017