Custom Item Pickup

Discussion in 'Plugin Development' started by 567legodude, Mar 15, 2015.

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

    567legodude

    I have created backpacks that players can open and put stuff into, the thing that I want to do is make it so that if their inventory is full, when they pick up an item it will go into the backpack.

    The only thing I need to know is how can I detect that they should pick up an item while their inventory is full. PlayerPickupItemEvent only fires when you actually pick something up so its not useful here. I don't want to have to constantly run a loop on the items around the player to pick them up.
     
  2. Offline

    teej107

    Always leave a single slot in their actual inventory open until their backpack is full.
     
    CodePlaysMinecraft likes this.
  3. @567legodude
    You could check on player move (only if block location changes, otherwise it will be laggy) if the player`s block is the same as the entity`s block, if it`s, remove the entity and add it to the backpack
     
Thread Status:
Not open for further replies.

Share This Page