tag @s[nbt={Inventory:[{tag:{title:"Minemart Guide",author:"pinksheep451"}}]}] add guide
give @s[tag=!guide] written_book{pages:["[\"\",\"Minemart Guide\",\"\\n\",\"\\n\",\"This guide book will teach you the basics of Minemart. At Minemart, you can buy or sell items for gems. By reading this guide, you will know how Minemart works.\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- Gems\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"Minemart uses \",{\"text\":\"gems\",\"color\":\"dark_green\"},\" as a currency. Gems can be obtained from various actions, such as killing mobs, fishing, etc. They can then be used to \",{\"text\":\"buy\",\"color\":\"gold\"},\" stuff from the stores.\",\"\\n\",\"Also, don't forget to follow the guards' rules, because they are pretty strict.\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- The dimension\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"The datapack contains a dimension so you can go to the Minemart community. You will meet villagers; to interact with them, \",{\"text\":\"right-click\",\"color\":\"gold\"},\" them.\",\"\\n\",\"To get to the Minemart dimension, \",{\"text\":\"go to the portal near your spawn\",\"color\":\"blue\"},\".\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- Stores\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"Minemart has \",{\"text\":\"nine\",\"color\":\"dark_green\"},\" different stores, each sorting their products into categories in the Creative inventory. Because of how the Creative inventory works, you may find more than one store selling the same products.\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- Buying & selling\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"To buy or sell items at stores, simply go into a store. You can bring your items to stores, or you can have nothing in your inventory at all!\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- Buying\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"To buy items, open chests in a Minemart store, then take the items out. Be sure not to \",{\"text\":\"shoplift\",\"color\":\"red\"},\", or there will be consequences. Once you're happy with the items you want to buy, go to the Minemart clerk and follow their instructions.\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- Selling\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"To sell items, you need to talk to the Minemart Item Collector. They will give you a sell box for you to sell items. To sell, \",{\"text\":\"you need to follow their instructions\",\"color\":\"gold\"},\". Once that's done, they will take items from the sell box in exchange for gems.\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- Demand\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"Did you know that prices can change over time? That is because of \",{\"text\":\"demand\",\"color\":\"dark_green\"},\". Demand goes up when you \",{\"text\":\"buy items\",\"color\":\"gold\"},\" and decreases as you \",{\"text\":\"sell items\",\"color\":\"gold\"},\". Demand loses effect as time passes. That's why item values are not fixed!\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- Banking\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"You can \",{\"text\":\"store\",\"color\":\"gold\"},\" gems in your bank accounts so you don't lose them on death. Chequing accounts have \",{\"text\":\"unlimited\",\"color\":\"dark_green\"},\" transactions, whereas savings accounts are \",{\"text\":\"limited to 10 per \",\"color\":\"dark_red\"},{\"nbt\":\"settings.bank.savings_transactions_period\",\"storage\":\"minemart:settings\",\"color\":\"dark_red\"},{\"text\":\" Minecraft days\",\"color\":\"dark_red\"},\". Be careful not to go over this limit!\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- Auctions\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"You can \",{\"text\":\"auction\",\"color\":\"gold\"},\" items in the auction house for other players to bid on. Auctions have a grace period of \",{\"nbt\":\"settings.auctions.pre_bid_phase\",\"storage\":\"minemart:settings\",\"color\":\"blue\"},{\"text\":\" seconds\",\"color\":\"blue\"},\", then bids can be placed. The top bidder gets the item(s)! Players who did not win an auction will get their bid gems back, no worries.\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- Transferring gems\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"You can \",{\"text\":\"transfer gems\",\"color\":\"dark_green\"},\" to your fellow players. Just do \",{\"text\":\"/trigger minemart_transfer set #\",\"color\":\"dark_green\"},\" to give the closest player within five blocks from you that many gems. They will appreciate it if you help them out!\"]","[\"\",\"Minemart Guide\",\"\\n\",{\"text\":\"- Quick commands\",\"italic\":true,\"color\":\"gray\"},\"\\n\",\"You can access your quick commands by doing \",{\"text\":\"[/trigger minemart_quickcommands]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger minemart_quickcommands\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[{\"text\":\"Click to see your quick commands!\",\"color\":\"yellow\"}]}},\". They act like shortcuts when using them!\"]"],title:"Minemart Guide",author:pinksheep451}
tellraw @s[tag=minemart,tag=!guide] {"text":"You got yourself a new Minemart guide!","color":"yellow"}
tellraw @s[tag=minemart,tag=guide] {"text":"You already have a Minemart guide!","color":"red"}
playsound block.note_block.pling master @s[tag=minemart,tag=guide] ~ ~ ~ 128 0.5
playsound block.lever.click master @s[tag=minemart] ~ ~ ~ 128 1.5
tag @s remove guide