Suggestion: Allow Scarpet to detect exactly which trade a player used (besides just the output item)
James103 opened this issue ยท 2 comments
Currently (Carpet mod 1.4.18), there is no event that detects exactly which trade a player used when the player trades with a villager. __on_statistic(...)
can be used to detect when a player trades with a villager, but that only reveals the output item as event == crafted.<item>
.
I would like if there was an event that was triggered every time a player trades with a villager. The event would be something like __on_player_trade(player, entity, buy, buyB, sell)
, where
player
is the player that traded with the villager / triggered the event,entity
is the villager or wandering trader that the player traded with,buy
is theitem_tuple
for the item that the villager bought for that trade,buyB
is theitem_tuple
for the other item that the villager bought for that trade, andsell
is theitem_tuple
for the item that the villager sold for that trade.
If the former is not possible, then an alternative would be __on_player_trade(player, entity, trade)
, where
player
is the player that traded with the villager / triggered the event,entity
is the villager or wandering trader that the player traded with, andtrade
is the index into the villager or wandering trader's list of trades.