InventoryCreativeEvent, count items taken out of the inventory

Discussion in 'Spigot Plugin Development' started by Freakey, May 14, 2016.

  1. Hi Guys,
    today I tried to create a counter for the amount of items the player takes out of the creative inventory.

    Example:
    Freakey is in Creative Mode. He wants to know how many items he has taken out of the creative inventory already (f.E. how many diamonds he has given himself in the creative mode.)

    How would I use the InventoryCreativeEvent to count the items taken out, I don't want to count the clicks in his normal inventory, I only want to know how many items the player has taken out of the creative inventory.

    I tried the InventoryCreativeEvent but it only triggers when the player clicks in HIS Inventory, not in the creative tab.
     
  2. I would suggest using InventoryClickEvent, as it sounds to me like InventoryCreativeEvent is meant for slightly different purposes. You can assess ClickType to see whether the click action takes place with the creative inventory open, and InventoryAction to see how many (if any) items were removed from the creative inventory.