diff --git a/data/mce/functions/core/load.mcfunction b/data/mce/functions/core/load.mcfunction index 1cdecc6..5b0fcd8 100644 --- a/data/mce/functions/core/load.mcfunction +++ b/data/mce/functions/core/load.mcfunction @@ -57,5 +57,8 @@ execute unless data storage mce:config api.announce_default_preset run data modi # v2.2.0 -> 2002000 scoreboard players set #mce load.status 2003000 + +data modify storage mce:config global.loaded set value 1b scoreboard objectives remove loadMCE -tellraw @a ["",{"text":"[MCE] ","color":"aqua"},{"text":"Marker Command Engine v2.3.0 loaded!","color":"white"}] +tellraw @a ["",{"text":"[MCE] ","color":"aqua"},{"text":"Marker Command Engine v2.3.0 loaded!","color":"yellow"}] +tellraw @a ["",{"text":"[MCE] ","color":"aqua"},{"text":"Click here to reset.","color":"yellow","clickEvent":{"action":"run_command","value":"/function mce:load/reset_all"]}] diff --git a/data/mce/functions/load/main.mcfunction b/data/mce/functions/load/main.mcfunction index 16e6ad6..62aceac 100644 --- a/data/mce/functions/load/main.mcfunction +++ b/data/mce/functions/load/main.mcfunction @@ -1,4 +1,4 @@ scoreboard objectives add loadMCE trigger scoreboard players enable @a loadMCE -tellraw @a ["",{"text":"[✔ INSTALL]","color":"green","bold":true,"clickEvent":{"action":"run_command","value":"/trigger loadMCE set 1"},"hoverEvent":{"action":"show_text","contents":"Install the datapack"}},{"text":" "},{"text":"[✖ CANCEL]","color":"red","bold":true,"clickEvent":{"action":"run_command","value":"/trigger loadMCE set 2"},"hoverEvent":{"action":"show_text","contents":"Cancel the installation"}}] +execute if data storage mce:config {global:{loaded:1b}} run tellraw @a ["",{"text":"[✔ INSTALL]","color":"green","bold":true,"clickEvent":{"action":"run_command","value":"/trigger loadMCE set 1"},"hoverEvent":{"action":"show_text","contents":"Install the datapack"}},{"text":" "},{"text":"[✖ CANCEL]","color":"red","bold":true,"clickEvent":{"action":"run_command","value":"/trigger loadMCE set 2"},"hoverEvent":{"action":"show_text","contents":"Cancel the installation"}}] diff --git a/data/mce/functions/load/reset_all.mcfunction b/data/mce/functions/load/reset_all.mcfunction new file mode 100644 index 0000000..4156796 --- /dev/null +++ b/data/mce/functions/load/reset_all.mcfunction @@ -0,0 +1,27 @@ +# Objectives +scoreboard objectives add mce.queue dummy +scoreboard objectives add mce.tick dummy +scoreboard objectives add mce.compat dummy +scoreboard objectives add mce.cd dummy +scoreboard objectives add mce.log dummy +scoreboard objectives add loadMCE +scoreboard players reset #tick mce.tick +scoreboard players reset #queue.active mce.compat +scoreboard players reset #sched.exists mce.compat +scoreboard players reset #error.count mce.queue + +# Storages +data remove storage mce:error Last +data remove storage mce:error Code +data remove storage mce:queue commands +data remove storage mce:schedule jobs +data remove storage mce:log entries +data remove storage mce:text_batch entries +data remove storage mce:batch commands +data remove storage mce:config mce.debug +data remove storage mce:config mce.queue_interval +data remove storage mce:config mce.track_output +data remove storage mce:config api.announce_default_preset + +# Debug / Tellraw +tellraw @a ["",{"text":"[MCE] ","color":"aqua"},{"text":"Marker Command Engine v2.3.0 reseted!","color":"yellow"}]