Carpet

Carpet

2M Downloads

Suggestion: Allow Scarpet to detect exactly which trade a player used (besides just the output item)

James103 opened this issue ยท 2 comments

commented

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 the item_tuple for the item that the villager bought for that trade,
  • buyB is the item_tuple for the other item that the villager bought for that trade, and
  • sell is the item_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, and
  • trade is the index into the villager or wandering trader's list of trades.
commented

Closing as fixed (feature implemented).

commented

umm, currently we are not in 1.4.12. Were in like 1.4.19. But cool idea ngl