aboutsummaryrefslogblamecommitdiff
path: root/data/bktsb/functions/tradertrades.mcfunction
blob: a4b413203cb4acd8a9e5a736e3fd2543b3ad85f4 (plain) (tree)






















































                                                                                                                                                                                                                                                                                                                                                                                                                         
##################################### RANDOM STUFF #####################################
scoreboard players set #a lim 6
function bktsb:rng

execute if score #a randr matches 0 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:16,buy:{id:"minecraft:emerald",Count:3},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:cocoa_beans",Count:1}}

execute if score #a randr matches 1 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:16,buy:{id:"minecraft:emerald",Count:9},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:cobweb",Count:16}}

execute if score #a randr matches 2 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:16,buy:{id:"minecraft:emerald",Count:5},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:sweet_berries",Count:1}}

execute if score #a randr matches 3 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:16,buy:{id:"minecraft:emerald_block",Count:3},buyB:{id:"minecraft:netherrack",Count:1},sell:{id:"minecraft:crimson_nylium",Count:1}}

execute if score #a randr matches 4 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:16,buy:{id:"minecraft:emerald_block",Count:3},buyB:{id:"minecraft:netherrack",Count:1},sell:{id:"minecraft:warped_nylium",Count:1}}

execute if score #a randr matches 5 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:16,buy:{id:"minecraft:emerald",Count:5},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:glow_lichen",Count:1}}
##################################### DOUBLE FLOWERS #####################################
scoreboard players set #a lim 5
function bktsb:rng

execute if score #a randr matches 0 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:8,buy:{id:"minecraft:emerald",Count:3},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:sunflower",Count:1}}

execute if score #a randr matches 1 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:8,buy:{id:"minecraft:emerald",Count:3},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:lilac",Count:1}}

execute if score #a randr matches 2 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:8,buy:{id:"minecraft:emerald",Count:3},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:rose_bush",Count:1}}

execute if score #a randr matches 3 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:8,buy:{id:"minecraft:emerald",Count:3},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:peony",Count:1}}

execute if score #a randr matches 4 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:8,buy:{id:"minecraft:stone",Count:64},buyB:{id:"minecraft:charcoal",Count:9},sell:{id:"minecraft:lava_bucket",Count:1}}

##################################### VALUABLE STUFF #####################################

scoreboard players set #a lim 6
function bktsb:rng

execute if score #a randr matches 0 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:1,buy:{id:"minecraft:emerald",Count:30},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:knowledge_book",Count:1,tag:{Recipes:["bktsb:dummy_amethyst"],display:{Name:"{\"text\":\"Geode in a Book\",\"color\":\"#FF00FF\"}"},Enchantments:[{}]}}}

execute if score #a randr matches 1 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:1,buy:{id:"minecraft:ender_chest",Count:30},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:knowledge_book",Count:1,tag:{Recipes:["bktsb:dummy1"],display:{Name:"{\"text\":\"End City Ship in a Book\",\"color\":\"#FF00FF\"}"},Enchantments:[{}]}}}

execute if score #a randr matches 2 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:1,buy:{id:"minecraft:netherite_ingot",Count:30},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:knowledge_book",Count:1,tag:{Recipes:["bktsb:dummy2"],display:{Name:"{\"text\":\"Bastion in a Book\",\"color\":\"#FF00FF\"}"},Enchantments:[{}]}}}

execute if score #a randr matches 3 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:1,buy:{id:"minecraft:obsidian",Count:30},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:knowledge_book",Count:1,tag:{Recipes:["bktsb:dummy3"],display:{Name:"{\"text\":\"Fortress in a Book\",\"color\":\"#FF00FF\"}"},Enchantments:[{}]}}}

execute if score #a randr matches 4 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:1,buy:{id:"minecraft:diamond",Count:30},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:knowledge_book",Count:1,tag:{Recipes:["bktsb:dummy4"],display:{Name:"{\"text\":\"Buried Treasure in a Book\",\"color\":\"#FF00FF\"}"},Enchantments:[{}]}}}

execute if score #a randr matches 5 run data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:1,buy:{id:"minecraft:golden_apple",Count:30},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:knowledge_book",Count:1,tag:{Recipes:["bktsb:dummy_dungeon"],display:{Name:"{\"text\":\"Dungeon in a Book\",\"color\":\"#FF00FF\"}"},Enchantments:[{}]}}}

##################################### TRADE CYCLING #####################################

data modify entity @e[type=minecraft:wandering_trader,tag=!trade_added,limit=1] Offers.Recipes append value {maxUses:1,buy:{id:"minecraft:emerald_block",Count:30},buyB:{id:"minecraft:air",Count:1},sell:{id:"minecraft:written_book",Count:1,tag:{author:"wandering trader",title:"my wills",display:{Name:"{\"text\":\"Cycle Trades\",\"color\":\"#FF0000\"}"},pages:[],Enchantments:[{}]}}}

execute as @e[type=minecraft:wandering_trader,tag=!trade_added] run tellraw @a ["",{"text":"A wild wandering trader appeared at ","color":"green"},{"nbt":"Pos","entity":"@s"},{"text":" !","color":"green"}]
execute as @e[type=minecraft:wandering_trader,tag=!trade_added] run playsound minecraft:entity.player.levelup neutral @a ~ ~ ~ 1000000
tag @e[type=minecraft:wandering_trader,tag=!trade_added] add trade_added

execute as @e[type=minecraft:wandering_trader,limit=1,nbt={Offers:{Recipes:[{sell:{id:"minecraft:written_book",Count:1b,tag:{author:"wandering trader",title:"my wills",display:{Name:"{\"text\":\"Cycle Trades\",\"color\":\"#FF0000\"}"},pages:[],Enchantments:[{}]}},uses:1}]}}] at @s run function bktsb:tradecycle