###Inform and mark informed players###
execute if entity @s[tag=nitVisitorCaravan] run tellraw @a[distance=..3,tag=!nitInformed] [{"text":"[Nomadic Caravan]","color":"green","bold":true},{"text":": ","color":"white","bold":false},{"text":"Hail, settler! I have come bearing the humble wares of my traveling caravan. We have traveled all night and thought to rest here today. If you would bring me ","color":"white","bold":false},{"text":"64 Gold Ingots ","color":"green","bold":false},{"text":"and set them at my feet, I believe I have some rare and valuable items that might be of interest to you!","color":"white","bold":false}]
execute if entity @s[tag=nitVisitorMooshroom] run tellraw @a[distance=..3,tag=!nitInformed] [{"text":"[Mooshroom Herd]","color":"red","bold":true},{"text":": ","color":"white","bold":false},{"text":"Mroooo! Hugfh.\n","color":"white","bold":false},{"text":"[۩]","color":"green","bold":true},{"text":": ","color":"white","bold":false},{"text":"This Mooshroom looks like it's been displaced along with its herd! Maybe if you can build a ","color":"white","bold":false},{"text":"Mooshroom Habitat Site ","color":"light_purple","bold":false},{"text":"in your town, they can finally be at ease.","color":"white","bold":false}]
execute if entity @s[tag=nitVisitorWolf] run tellraw @a[distance=..3,tag=!nitInformed] [{"text":"[Pack of Wolves]","color":"gray","bold":true},{"text":": ","color":"white","bold":false},{"text":"Howooooowl! Arf!\n","color":"white","bold":false},{"text":"[۩]","color":"green","bold":true},{"text":": ","color":"white","bold":false},{"text":"This pack of wolves looks hungry! It might be a good idea to drop ","color":"white","bold":false},{"text":"64 Bones and 64 Cooked Beef ","color":"red","bold":false},{"text":"at their feet, before they decide to find something else to sink their teeth into!","color":"white","bold":false}]
execute if entity @s[tag=nitVisitorWitch] run tellraw @a[distance=..3,tag=!nitInformed] [{"text":"[Witch Coven]","color":"dark_purple","bold":true},{"text":": ","color":"white","bold":false},{"text":"Nya hahaHA! Beware, settler thee! You now play host to my sisters and me! Lay down ","color":"white","bold":false},{"text":"64 Gold and 64 Glowstone Dust ","color":"gold","bold":false},{"text":"at my feet, or our coven will force you to make a frightened retreat!","color":"white","bold":false}]
execute if entity @s[tag=nitVisitorPiglin] run tellraw @a[distance=..3,tag=!nitInformed] [{"text":"[Piglin Posse]","color":"dark_red","bold":true},{"text":": ","color":"white","bold":false},{"text":"What's this? A town in the Overworld? I thought all the building-types had gone extinct. Well, since you're here, time to pay up! Drop down ","color":"white","bold":false},{"text":"64 Gold Blocks ","color":"dark_red","bold":false},{"text":"or we might make this vacation from the heat a permanent stay.","color":"white","bold":false}]
execute if entity @s[tag=nitVisitorMooshroom] run give @a[distance=..3,tag=!nitInformed] written_book{pages:['["",{"text":"Mooshroom Habitat.","bold":true,"underlined":true,"hoverEvent":{"action":"show_item","value":"{\\"id\\":\\"bundle\\",\\"Count\\":1,\\"tag\\":{\\"display\\":{\\"Name\\":\'{\\"text\\":\\"Site Planner\\",\\"italic\\":\\"false\\"}\'},\\"Items\\":[{\\"id\\":\\"minecraft:brown_mushroom\\",\\"Count\\":16},{\\"id\\":\\"minecraft:bone_meal\\",\\"Count\\":16},{\\"id\\":\\"minecraft:red_mushroom\\",\\"Count\\":16},{},{\\"id\\":\\"minecraft:dirt\\",\\"Count\\":24},{\\"id\\":\\"minecraft:paper\\",\\"Count\\":1,\\"tag\\":{\\"Enchantments\\":[{\\"lvl\\":0,\\"id\\":\\"minecraft:protection\\"}]}},{\\"id\\":\\"minecraft:dirt\\",\\"Count\\":24},{},{\\"id\\":\\"minecraft:water_bucket\\",\\"Count\\":1},{\\"id\\":\\"minecraft:stone\\",\\"Count\\":64},{\\"id\\":\\"minecraft:water_bucket\\",\\"Count\\":1},{}]}}"}},{"text":" An enclosure with a moat that pays homage to the rare Mushroom Islands. The perfect home for a displaced Mooshroom herds.\\nWater Buckets in recipe are not returned.","color":"reset"}]'],title:"Mooshroom Habitat Recipe",author:"The Mayor"}
tag @a[distance=..3] add nitInformed

###Remove player informed status###
tag @a[distance=6..50] remove nitInformed

###Collect bounties###
execute if entity @s[tag=nitVisitorCaravan] if entity @e[type=item,distance=..4,nbt={OnGround:1b,Item:{id:"minecraft:gold_ingot",Count:64b}}] run function nitk:recurs/town_square/caravan_reward
execute if entity @s[tag=nitVisitorWolf] if entity @e[type=item,distance=..4,nbt={OnGround:1b,Item:{id:"minecraft:bone",Count:64b}}] if entity @e[type=item,distance=..2,nbt={OnGround:1b,Item:{id:"minecraft:cooked_beef",Count:64b}}] run function nitk:recurs/town_square/wolf_banish
execute if entity @s[tag=nitVisitorWitch] if entity @e[type=item,distance=..4,nbt={OnGround:1b,Item:{id:"minecraft:gold_ingot",Count:64b}}] if entity @e[type=item,distance=..2,nbt={OnGround:1b,Item:{id:"minecraft:glowstone_dust",Count:64b}}] run function nitk:recurs/town_square/witch_banish
execute if entity @s[tag=nitVisitorPiglin] if entity @e[type=item,distance=..4,nbt={OnGround:1b,Item:{id:"minecraft:gold_block",Count:63b}}] run function nitk:recurs/town_square/piglin_banish