Cursor item loss

Discussion in 'Plugin Development' started by madtomic, Nov 5, 2017.

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

    madtomic

    The setup

    Player can't drop items from any inventory, including Q.

    Player inventory is full of LOGs.

    Player opens a chest and take out a sapling but there is no room to put it in player inventory.

    Upon on closing the chest inventory the item (sapling) is loss from the cursor.

    Is there a way to prevent this or restore the item back into the chest it was taken from or add back onto the cursor?

    Since, drop event is cancel, the item on cursor is removed. This is the part I need help fixing.

    Regards,
    madtomic
     
  2. Offline

    ipodtouch0218

    So the player can't toss items, and the item is getting destroyed because it's in the player's cursor as it closes?

    This has a ton of edge-cases to program around. What if the slot the item was taken out of was filled by another player? What about a hopper? What if the item taken out was a glitched stacked item (stack of diamond swords, you can remove some but not add more to the stack)?

    In all of those edge cases, the item must be destroyed, it has nowhere else to go.
     
Thread Status:
Not open for further replies.

Share This Page