diff --git a/warpbook-pack/bookcode.txt b/warpbook-pack/bookcode.txt index 23ade19..b8b41e2 100644 --- a/warpbook-pack/bookcode.txt +++ b/warpbook-pack/bookcode.txt @@ -1,4 +1,4 @@ MinecraftJSON Import Code: -{"command":"/give @p written_book{pages:%s,title:CustomBook,author:Player}","jobject":[{"text":" The Wanderer’s Tome\\n"},{"text":"\\nThis ancient book seems\\nto grant the user the\\nability to travel to any\\nof the locations listed\\nwithin its pages. Simply\\nopen the book and \\npicture where you wish to\\ngo, and the Wanderer’s\\nTome will take you there,\\nat the cost of your own \\nvitality.","color":"dark_gray"},{"NEW_ITERATE_FLAG":true},{"text":"You can pick a location\\nand the book will teleport\\nthem to the Sanctuary at \\nhat location, but at the\\ncost of (X) hearts each\\ntime.\\nAdditional Sanctuaries will\\nbe added as needed.","color":"dark_gray"},{"NEW_ITERATE_FLAG":true},{"text":" Sanctuaries","bold":true},{"text":"\\nThe Crystal Ruins","color":"dark_gray"},{"text":"\\nTownsend","color":"red"},{"text":"\\nMarket","color":"dark_green"},{"text":"\\nShadowfall Arena","color":"dark_red"},{"text":"\\n Wildernesses:","color":"dark_green","bold":true},{"text":"\\nNorthern","color":"dark_green"},{"text":"\\nEastern","color":"dark_green"},{"text":"\\nSouthern","color":"dark_green"},{"text":"\\nWestern","color":"dark_green"},{"text":"\\nNortheastern","color":"dark_green"},{"text":"\\nSoutheastern","color":"dark_green"},{"text":"\\nNorthwestern","color":"dark_green"},{"text":"\\nSouthwestern","color":"dark_green"}],"jtemplate":"book"} +give @p written_book{pages:["[\"\",{\"text\":\" The Wanderer’s Tome\\n\"},{\"text\":\"\\nThis ancient book seems\\nto grant the user the\\nability to travel to any\\nof the locations listed\\nwithin its pages. Simply\\nopen the book and \\npicture where you wish to\\ngo, and the Wanderer’s\\nTome will take you there,\\nat the cost of your own \\nvitality.\",\"color\":\"dark_gray\"}]","[\"\",{\"text\":\" Sanctuaries\",\"bold\":true},{\"text\":\"\\nThe Crystal Ruins\",\"color\":\"dark_gray\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 1\"},\"bold\":false},{\"text\":\"\\nTownsend\",\"color\":\"red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 2\"}},{\"text\":\"\\nMarket\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 3\"}},{\"text\":\"\\nShadowfall Arena\",\"color\":\"dark_red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 4\"}}]","[\"\",{\"text\":\"Wildernesses:\",\"color\":\"dark_green\",\"bold\":true},{\"text\":\"\\nNorthern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 5\"},\"bold\":false},{\"text\":\"\\nEastern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 6\"}},{\"text\":\"\\nSouthern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 7\"}},{\"text\":\"\\nWestern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 8\"}},{\"text\":\"\\nNortheastern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 9\"}},{\"text\":\"\\nSoutheastern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 10\"}},{\"text\":\"\\nNorthwestern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 11\"}},{\"text\":\"\\nSouthwestern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 12\"}}]","[\"\",{\"text\":\"Call a new Tomb\",\"color\":\"dark_red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpupdatet set 1\"}}]"],title:Tome,author:Lasciel} Actual Book Command: -/give @p written_book{pages:["[\"\",{\"text\":\" The Wanderer’s Tome\\n\"},{\"text\":\"\\nThis ancient book seems\\nto grant the user the\\nability to travel to any\\nof the locations listed\\nwithin its pages. Simply\\nopen the book and \\npicture where you wish to\\ngo, and the Wanderer’s\\nTome will take you there,\\nat the cost of your own \\nvitality.\",\"color\":\"dark_gray\"}]","[\"\",{\"text\":\"You can pick a location\\nand the book will teleport\\nthem to the Sanctuary at \\nhat location, but at the\\ncost of (X) hearts each\\ntime.\\nAdditional Sanctuaries will\\nbe added as needed.\",\"color\":\"dark_gray\"}]","[\"\",{\"text\":\" Sanctuaries\",\"bold\":true},{\"text\":\"\\nThe Crystal Ruins\",\"color\":\"dark_gray\",\"bold\":false},{\"text\":\"\\nTownsend\",\"color\":\"red\"},{\"text\":\"\\nMarket\",\"color\":\"dark_green\"},{\"text\":\"\\nShadowfall Arena\",\"color\":\"dark_red\"},{\"text\":\"\\n Wildernesses:\",\"color\":\"dark_green\",\"bold\":true},{\"text\":\"\\nNorthern\",\"color\":\"dark_green\",\"bold\":false},{\"text\":\"\\nEastern\",\"color\":\"dark_green\"},{\"text\":\"\\nSouthern\",\"color\":\"dark_green\"},{\"text\":\"\\nWestern\",\"color\":\"dark_green\"},{\"text\":\"\\nNortheastern\",\"color\":\"dark_green\"},{\"text\":\"\\nSoutheastern\",\"color\":\"dark_green\"},{\"text\":\"\\nNorthwestern\",\"color\":\"dark_green\"},{\"text\":\"\\nSouthwestern\",\"color\":\"dark_green\"}]"],title:CustomBook,author:Player} \ No newline at end of file +/give @p written_book{pages:["[\"\",{\"text\":\" The Wanderer’s Tome\\n\"},{\"text\":\"\\nThis ancient book seems\\nto grant the user the\\nability to travel to any\\nof the locations listed\\nwithin its pages. Simply\\nopen the book and \\npicture where you wish to\\ngo, and the Wanderer’s\\nTome will take you there,\\nat the cost of your own \\nvitality.\",\"color\":\"dark_gray\"}]","[\"\",{\"text\":\" Sanctuaries\",\"bold\":true},{\"text\":\"\\nThe Crystal Ruins\",\"color\":\"dark_gray\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 1\"},\"bold\":false},{\"text\":\"\\nTownsend\",\"color\":\"red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 2\"}},{\"text\":\"\\nMarket\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 3\"}},{\"text\":\"\\nShadowfall Arena\",\"color\":\"dark_red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 4\"}}]","[\"\",{\"text\":\"Wildernesses:\",\"color\":\"dark_green\",\"bold\":true},{\"text\":\"\\nNorthern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 5\"},\"bold\":false},{\"text\":\"\\nEastern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 6\"}},{\"text\":\"\\nSouthern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 7\"}},{\"text\":\"\\nWestern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 8\"}},{\"text\":\"\\nNortheastern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 9\"}},{\"text\":\"\\nSoutheastern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 10\"}},{\"text\":\"\\nNorthwestern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 11\"}},{\"text\":\"\\nSouthwestern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 12\"}}]","[\"\",{\"text\":\"Call a new Tomb\",\"color\":\"dark_red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpupdatet set 1\"}}]"],title:The Wanderer's Tome,author:Lasciel} diff --git a/warpbook-pack/data/main/functions/givebook.mcfunction b/warpbook-pack/data/main/functions/givebook.mcfunction index 9a2612b..1f5ad81 100644 --- a/warpbook-pack/data/main/functions/givebook.mcfunction +++ b/warpbook-pack/data/main/functions/givebook.mcfunction @@ -1,2 +1,3 @@ #REPLACE THIS COMMAND: -give +give @p written_book{pages:["[\"\",{\"text\":\" The Wanderer’s Tome\\n\"},{\"text\":\"\\nThis ancient book seems\\nto grant the user the\\nability to travel to any\\nof the locations listed\\nwithin its pages. Simply\\nopen the book and \\npicture where you wish to\\ngo, and the Wanderer’s\\nTome will take you there,\\nat the cost of your own \\nvitality.\",\"color\":\"dark_gray\"}]","[\"\",{\"text\":\" Sanctuaries\",\"bold\":true},{\"text\":\"\\nThe Crystal Ruins\",\"color\":\"dark_gray\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 1\"},\"bold\":false},{\"text\":\"\\nTownsend\",\"color\":\"red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 2\"}},{\"text\":\"\\nMarket\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 3\"}},{\"text\":\"\\nShadowfall Arena\",\"color\":\"dark_red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 4\"}}]","[\"\",{\"text\":\"Wildernesses:\",\"color\":\"dark_green\",\"bold\":true},{\"text\":\"\\nNorthern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 5\"},\"bold\":false},{\"text\":\"\\nEastern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 6\"}},{\"text\":\"\\nSouthern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 7\"}},{\"text\":\"\\nWestern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 8\"}},{\"text\":\"\\nNortheastern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 9\"}},{\"text\":\"\\nSoutheastern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 10\"}},{\"text\":\"\\nNorthwestern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 11\"}},{\"text\":\"\\nSouthwestern\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpbook set 12\"}}]","[\"\",{\"text\":\"Call a new Tomb\",\"color\":\"dark_red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger warpupdatet set 1\"}}]"],title:Tome,author:Lasciel} +scoreboard players set @s warpupdate 1 diff --git a/warpbook-pack/data/main/functions/init.mcfunction b/warpbook-pack/data/main/functions/init.mcfunction index 073f337..449e7dc 100644 --- a/warpbook-pack/data/main/functions/init.mcfunction +++ b/warpbook-pack/data/main/functions/init.mcfunction @@ -2,3 +2,5 @@ say look at that it's a datapack scoreboard objectives add warpbook trigger scoreboard objectives add tick dummy scoreboard objectives add warpcooldown dummy +scoreboard objectives add warpupdate dummy +scoreboard objectives add warpupdatet trigger diff --git a/warpbook-pack/data/main/functions/master.mcfunction b/warpbook-pack/data/main/functions/master.mcfunction index fdcb083..068ff67 100644 --- a/warpbook-pack/data/main/functions/master.mcfunction +++ b/warpbook-pack/data/main/functions/master.mcfunction @@ -5,6 +5,9 @@ #Adds To the tick counter to time seconds scoreboard players add #tick tick 1 scoreboard players enable @a warpbook +scoreboard players enable @a warpupdatet +execute as @a unless score @s warpupdate matches 1 run scoreboard players set @s warpupdate 0 +execute as @a if score @s warpupdatet matches 1 run function main:update #Run the main warping command if a player has pushed the book button execute as @a if score @s warpbook matches 1.. run function main:warp # Every 1 second diff --git a/warpbook-pack/data/main/functions/tp.mcfunction b/warpbook-pack/data/main/functions/tp.mcfunction index d490be8..93ea6e6 100644 --- a/warpbook-pack/data/main/functions/tp.mcfunction +++ b/warpbook-pack/data/main/functions/tp.mcfunction @@ -18,8 +18,33 @@ scoreboard players set @s warpcooldown 30 #Step 4: to enable the autoupdate button, run /function main:resetupdate #That's it! You're done! +#The crystal Ruins +#execute if score @s warpbook matches 1 run tp +#Townsend +execute if score @s warpbook matches 2 run tp @s 5156 83 5829 +#Market +execute if score @s warpbook matches 3 run tp @s 318 131 15527 +#Shadowfall Arena +execute if score @s warpbook matches 4 run tp @s 5162 65 1470 +#Northern +execute if score @s warpbook matches 5 run tp @s 434 80 -828 +#Eastern +execute if score @s warpbook matches 6 run tp @s 1412 88 154 +#Souther +execute if score @s warpbook matches 7 run tp @s 407 95 1267 +#Western +execute if score @s warpbook matches 8 run tp @s -742 90 95 +#Northeastern +execute if score @s warpbook matches 9 run tp @s 1419 132 -824 +#Southeastern +execute if score @s warpbook matches 10 run tp @s 1374 86 1150 +#Northwestern +execute if score @s warpbook matches 11 run tp @s -508 77 -825 +#Southwestern +execute if score @s warpbook matches 12 run tp @s -507 83 1150 #BEFORE HERE +scoreboard players set @s warpbook 0 #Play fancy particle effects execute at @s run particle minecraft:totem_of_undying ~.1 ~.1 ~.1 0 0 0 0.7 250 force execute at @s run playsound minecraft:block.beacon.ambient voice @s ~ ~ ~ 100 diff --git a/warpbook-pack/data/main/functions/update.mcfunction b/warpbook-pack/data/main/functions/update.mcfunction new file mode 100644 index 0000000..238cc19 --- /dev/null +++ b/warpbook-pack/data/main/functions/update.mcfunction @@ -0,0 +1,9 @@ +# Desc: Runs when a player needs a update +# +# Called by: #minecraft:tick +execute if score @s warpupdate matches 0 run tellraw @s ["",{"text":"You have summoned the Wanderer's Tome. There is new knowledge to behold.","color":"green"}] +execute if score @s warpupdate matches 1 run tellraw @s ["",{"text":"You hold the Wanderer's Tome. There can be no other.","color":"red"}] +execute if score @s warpupdate matches 1 run playsound minecraft:block.beacon.deactivate voice @s ~ ~ ~ 100 +execute if score @s warpupdate matches 0 run playsound minecraft:entity.evoker.prepare_summon voice @s ~ ~ ~ 100 +execute if score @s warpupdate matches 0 run function main:givebook +scoreboard players set @s warpupdatet 0 diff --git a/warpbook-pack/data/main/functions/warp.mcfunction b/warpbook-pack/data/main/functions/warp.mcfunction index 4d7b195..89ab858 100644 --- a/warpbook-pack/data/main/functions/warp.mcfunction +++ b/warpbook-pack/data/main/functions/warp.mcfunction @@ -1,6 +1,5 @@ # Desc: Template for each warp # # Called by: nothing -scoreboard players set @s warpbook 0 execute if score @s warpcooldown matches 1.. run function main:cooldown execute if score @s warpcooldown matches 0 run function main:tp