[SOLVED] one gui appears, but the other wont

Discussion in 'Spigot Plugin Development' started by liwaa, Jul 9, 2015.

  1. solgved
    #1 liwaa, Jul 9, 2015
    Last edited: Jul 9, 2015
  2. I believe the problem is this line:
    if (e.getCurrentItem() == null || !e.getCurrentItem().hasItemMeta() ){

    If the item does not have item meta you are returning. A dragon egg wont have item meta unless you gave it some.
    #2 St3venAU, Jul 9, 2015
    Last edited: Jul 9, 2015
  3. isnt that giving it an item meta
    ItemStack view = new ItemStack (Material.DRAGON_EGG);
    ItemMeta viewmeta = view.getItemMeta();

    EDIT: i tried it and it didnt work
  4. Ah, I see the issue:
    inv3.setItem(9, thunder);

    The inventory you created is of size 9, meaning that its slots are 0-8. Slot 9 is not valid.

    Edit: Same with this line:
    inv2.setItem(9, enchant);
  5. wow thank you :p