1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How to check if player is clicking item in inventory

Discussion in 'Development' started by WhoAreMe, May 9, 2020.

  1. WhoAreMe

    WhoAreMe Witch

    Messages:
    55
    I know there is function that can check whether player is holding an item. But i wanna know if there is an event to check if player is selecting item in inventory that maybe has custom name.
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
  3. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    He never said it can't be a function from a library. He can look at the virion's code if he hates virions.
     
  5. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    no
     
  6. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    If I was developing a plugin like this I wouldn't use a virion just to make an if statement, I'd rather having a few steps on how to do it with my own code.

    What do you mean by select? Does it mean holding or picking it up from the inventory?
     
  7. WhoAreMe

    WhoAreMe Witch

    Messages:
    55
  8. WhoAreMe

    WhoAreMe Witch

    Messages:
    55
    I've checked that api but from what i read it creates a fake inventory. I also saw about this callback that check if the item is clicked just what im looking for. I just dont know how to integrate it or if it will replace the normal inventory class.
    Can you show me a good example how can i use it.
    bool|void callback(Player $player, Item $itemClicked, Item $itemClickedWith, SlotChangeAction $action);.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.