Shopkeepers

Shopkeepers

2M Downloads

Add an event for when a trade is completed

blablubbabcDEV opened this issue ยท 2 comments

commented

Migrated from: https://dev.bukkit.org/projects/shopkeepers/issues/276

Originally posted by LeoFSU (Dec 23, 2014):

There should be an event which fires once a trade is done. It would give you the two itemstacks involved and the player. While I could just fork your plugin and add the stuff I need to do in the onPurchaseClick method, I feel that this might be needed by other plugins as well.
Thanks!

commented

Originally commented by blablubbabc (Dec 30, 2014):

Checkout v1.39: I added a ShopkeeperTradeEvent (if you want to cancle a trade because of additional conditions) and a ShopkeeperTradeCompletedEvent (if you want to do something after the trade was actually processed (and not cancelled) by the shopkeeper).

Both events have a reference to the original InventoryClickEvent which should allow you to get the involved items.

        Edited Dec 30, 2014
commented

Originally closed by blablubbabc (Dec 30, 2014)