new_trade_s.mcfunction 1.0 KB

1234567891011
  1. execute if score @s temp matches 1 run loot spawn ~ ~ ~ loot mini:trade_s
  2. execute if score @s temp matches 2 run loot spawn ~ ~ ~ loot mini:trade_a
  3. # execute if score @s temp matches 3 run loot spawn ~ ~ ~ loot mini:trade_s
  4. # execute if score @s temp matches 4 run loot spawn ~ ~ ~ loot mini:trade_s
  5. # execute if score @s temp matches 5 run loot spawn ~ ~ ~ loot mini:trade_s
  6. data modify entity @s Offers.Recipes append value {rewardExp:false,xp:20}
  7. data modify entity @s Offers.Recipes[-1].buy set from entity @e[type=item,nbt={Item:{tag:{TradeItem:1b}}},limit=1] Item.tag.buy
  8. data modify entity @s Offers.Recipes[-1].buyB set from entity @e[type=item,nbt={Item:{tag:{TradeItem:1b}}},limit=1] Item.tag.buyB
  9. data modify entity @s Offers.Recipes[-1].maxUses set from entity @e[type=item,nbt={Item:{tag:{TradeItem:1b}}},limit=1] Item.tag.maxUses
  10. data modify entity @s Offers.Recipes[-1].sell set from entity @e[type=item,nbt={Item:{tag:{TradeItem:1b}}},limit=1] Item.tag.sell
  11. kill @e[type=item,nbt={Item:{tag:{TradeItem:1b}}}]