Solved Get slot of Any item?

Discussion in 'Plugin Development' started by VortexGmer, May 24, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    VortexGmer

    How to get the slot of any given item in the inventory such as
    ItemStack i = something from before;
    i.getSlot?????
    How would I do this even if it isntin the hotbar?
     
  2. Offline

    I Al Istannen

    @VortexGmer I would check if the inventory contains the ItemStack, then loop through #getContents() and, after checking if it isn't null, check if it equals the itemStack. If yes, return the counter, otherwise return sth else, like -1 or such.
     
  3. Offline

    Zombie_Striker

    @VortexGmer
    There is no .igetSlot() for ItemStacks.
     
  4. Offline

    VortexGmer

    I know that is not an option but I was saying anything that would somehow do this, Anyways, I found a works around so I guess it is solved?
     
Thread Status:
Not open for further replies.

Share This Page