execute at @n[nbt={Item:{components:{"minecraft:custom_data":{convertbook:"tag"}}}}] run function survivalplus:giant_deal/convert/converteffect
execute at @n[nbt={Item:{components:{"minecraft:custom_data":{convertbook:"tag"}}}}] run summon item ~ ~ ~ {PickupDelay:40s,Glowing:1b,Tags:[itemguard,special],Item:{id:"minecraft:written_book",components:{"minecraft:custom_data":{curse_book:tag,nodupe:tag},written_book_content:{pages:[[[{"text":"Glass Cannon","color":"blue","click_event":{"action":"run_command","command":"/trigger cursemenu set 1"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\n+100% Damage","color":"green"},{"text":"\n-50% Max HP\n-10% Defense","color":"red"}]],[["",{"text":"Instakill","color":"blue","click_event":{"action":"run_command","command":"/trigger cursemenu set 2"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\n5% chance to kill on hit","color":"green"},{"text":"\n0.1% chance to take 20 damage when hurt","color":"red"}]],[["",{"text":"Unscabbard","color":"blue","click_event":{"action":"run_command","command":"/trigger cursemenu set 3"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\nGain more damage the less defense you have","color":"green"},{"text":"\nHaving too much defense reduces your damage","color":"red"},{"text":"\n0 Armor = +100% dmg\n12+ Armor = reduced dmg","color":"reset"}]],[["",{"text":"Shadow Friends","color":"blue","click_event":{"action":"run_command","command":"/trigger cursemenu set 4"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\nYou gain a shadow follower that deals damage to enemies on contact","color":"green"},{"text":"\nBut you're at constant risk of losing your sanity","color":"red"}]],[["",{"text":"Monster Skin","color":"blue","click_event":{"action":"run_command","command":"/trigger cursemenu set 5"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\nYour stats increase at night and even more during Blood Moon","color":"green"},{"text":"\nBut sleeping once will reduce your stats","color":"red"},{"text":"\nStats will refresh on death","color":"reset"}]],[["",{"text":"Living on The Edge","color":"blue","click_event":{"action":"run_command","command":"/trigger cursemenu set 6"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\nGain a +200% damage bonus when at 8 health or under","color":"green"},{"text":"\nBut you can no longer heal from magic sources","color":"red"}]],[["",{"text":"Damage Reduction","color":"blue","click_event":{"action":"run_command","command":"/trigger cursemenu set 7"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\nGain a permanent absorption buff that negates up to 4 damage","color":"green"},{"text":"\nBut all armor points are negated","color":"red"}]],[["",{"text":"Gluttony","color":"blue","click_event":{"action":"run_command","command":"/trigger cursemenu set 8"},"hover_event":{"action":"show_text","value":"Click to select"}},{"text":"\n+100% damage when full on food and a 5% chance to feed you on kill","color":"green"},{"text":"\nBut you starve faster","color":"red"}]]],title:"Curse Book",author:"Curse Titan",generation:3}}}}
kill @n[nbt={Item:{components:{"minecraft:custom_data":{convertbook:"tag"}}}}]