how to prohibit putting items in custom inventory, but allowing to take items?

Discussion in 'Plugin Development' started by LIMPIX31, Aug 1, 2021.

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

    LIMPIX31

    P.S. Checking custom inventory by title
     
  2. Offline

    KarimAKL

    @LIMPIX31 Listen to both the InventoryClickEvent and the InventoryDragEvent. Check if the player is taking items using the InventoryClickEvent, but check if they are adding items using both of the events.
     
  3. Offline

    LIMPIX31

    Can I have a code?
     
  4. Offline

    KarimAKL

    No. I am not going to spoon-feed.
     
  5. Offline

    LIMPIX31

    EDIT3: ...
     
    Last edited: Aug 3, 2021
  6. Offline

    KarimAKL

    How does a single person (in this case, me) represent the entirety of the forum's users?

    You did not ask for any methods; you just asked for code.
    Btw, the Javadocs exist, and I already gave you the names of the classes to look for.

    Why should we care whether you think we know our stuff or not? You are the one asking for help. We can simply choose to ignore you, but we choose to help you without getting anything in return.

    You can ask for help, but I will not write the code for you.

    For anyone reading this and thinking about just spoon-feeding the code: I would discourage it, as it leads to people getting what they want this way.
     
  7. Offline

    LIMPIX31

    On other forums, I received a response in the form of a code, because it is easier to explain and understand than in words
     
  8. Offline

    KarimAKL

    This is just me personally; it has nothing to do with this forum, nor any other forums. I do not believe that undocumented code is an "easier" way to learn. It is just a temporary solution. I find it to be similar to the saying: "Give a man a fish, and you will feed him for the night, but teach a man to fish, and you will feed him for a lifetime."

    Anyway, this is going away from the topic.
    If you are still having trouble, we (the forum's user) are here to help you.
     
    Newdel likes this.
Thread Status:
Not open for further replies.

Share This Page