execute store result score random itemcount run random value 1..9
execute if score random itemcount matches 1 run data modify entity @s Offers.Recipes append value {maxUses:2,buy:{id:emerald,count:13},sell:{id:knowledge_book,components:{custom_data:{bloodmoontome:tag},recipes:["survivalplus:tomes/bloodmoon"],item_name:{"text":"Blood Moon Tome","italic":false},lore:[{"text":"Makes the next night a blood moon","italic":false,"color":"gray"}],enchantment_glint_override:1b}}}
execute if score random itemcount matches 2 run data modify entity @s Offers.Recipes append value {maxUses:2,buy:{id:emerald,count:13},sell:{id:knowledge_book,components:{custom_data:{weathertome:tag},recipes:["survivalplus:tomes/weather"],item_name:{"text":"Weather Tome","italic":false},lore:[{"text":"Summons a Thunder Storm","italic":false,"color":"gray"}],enchantment_glint_override:1b}}}
execute if score random itemcount matches 3 run data modify entity @s Offers.Recipes append value {maxUses:3,buy:{id:emerald,count:13},sell:{id:knowledge_book,components:{custom_data:{glowtome:tag},recipes:["survivalplus:tomes/glow"],item_name:{"text":"Glow Tome","italic":false},lore:[{"text":"Makes rare mobs glow for a minute","italic":false,"color":"gray"}],enchantment_glint_override:1b}}}
execute if score random itemcount matches 4 run data modify entity @s Offers.Recipes append value {maxUses:3,buy:{id:emerald,count:16},sell:{id:knowledge_book,components:{custom_data:{xptome:tag},recipes:["survivalplus:tomes/xp"],item_name:{"text":"XP Tome","italic":false},lore:[{"text":"Gain 10 levels","italic":false,"color":"gray"}],enchantment_glint_override:1b}}}
execute if score random itemcount matches 5 run data modify entity @s Offers.Recipes append value {maxUses:4,buy:{id:emerald,count:10},sell:{id:knowledge_book,components:{custom_data:{weaktome:tag},recipes:["survivalplus:tomes/weak"],item_name:{"text":"Weakness Tome","italic":false},lore:[{"text":"Weakens nearby mobs","italic":false,"color":"gray"}],enchantment_glint_override:1b}}}
execute if score random itemcount matches 7 run data modify entity @s Offers.Recipes append value {maxUses:4,buy:{id:emerald,count:10},sell:{id:knowledge_book,components:{custom_data:{bosstome:tag},recipes:["survivalplus:tomes/boss"],item_name:{"text":"Teleport Boss Tome","italic":false},lore:[{"text":"Teleports the nearest boss to your location","italic":false,"color":"gray"}],enchantment_glint_override:1b}}}
execute if score random itemcount matches 9 run data modify entity @s Offers.Recipes append value {maxUses:4,buy:{id:emerald,count:11},sell:{id:knowledge_book,components:{custom_data:{magnettome:tag},recipes:["survivalplus:tomes/magnet"],item_name:{"text":"Magnetism Tome","italic":false},lore:[{"text":"Collects all items in a wide range","italic":false,"color":"gray"}],enchantment_glint_override:1b}}}