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

InventoryTransactionEvent

Discussion in 'Development' started by Aviv, Feb 7, 2017.

  1. Aviv

    Aviv Baby Zombie

    Messages:
    156
    im trying to run a code when the player took an item from the inventory using InventoryTransactionEvent but the code runs only after the item is in the player's inventory.
    any idea?
     
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    That's how the event is supposed to work. You can cancel the event though, and that will keep the player from keeping the item, if that is your goal. If this doesn't solve your problem, please provide some more information about your goal and a snippet of your code.
     
  3. Aviv

    Aviv Baby Zombie

    Messages:
    156
    The event runs twice.
    1. it runs when the item is in the chest inventory and gets moved.
    2. it runs when the item got to the player's inventory
    I'm trying to get to check if the first line was called.
     
  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.