From 6d2dfc421cf76374467879aa07db2819e7b7d661 Mon Sep 17 00:00:00 2001 From: pancakes
Date: Mon, 2 Jun 2025 15:38:43 +1000 Subject: [PATCH] Initial commit --- .../tags/dialog/pause_screen_additions.json | 3 + data/minecraft/tags/dialog/quick_actions.json | 3 + data/simplewaypoints/dialog/create.json | 152 ++++++++++++++++++ data/simplewaypoints/dialog/delete.json | 24 +++ data/simplewaypoints/dialog/manage.json | 39 +++++ data/simplewaypoints/dialog/rename.json | 31 ++++ data/simplewaypoints/dialog/set_color.json | 139 ++++++++++++++++ data/simplewaypoints/dialog/set_range.json | 35 ++++ .../function/create.mcfunction | 3 + .../function/delete.mcfunction | 2 + .../function/rename.mcfunction | 2 + .../function/set_color.mcfunction | 3 + .../function/set_range.mcfunction | 2 + pack.mcmeta | 6 + 14 files changed, 444 insertions(+) create mode 100644 data/minecraft/tags/dialog/pause_screen_additions.json create mode 100644 data/minecraft/tags/dialog/quick_actions.json create mode 100644 data/simplewaypoints/dialog/create.json create mode 100644 data/simplewaypoints/dialog/delete.json create mode 100644 data/simplewaypoints/dialog/manage.json create mode 100644 data/simplewaypoints/dialog/rename.json create mode 100644 data/simplewaypoints/dialog/set_color.json create mode 100644 data/simplewaypoints/dialog/set_range.json create mode 100644 data/simplewaypoints/function/create.mcfunction create mode 100644 data/simplewaypoints/function/delete.mcfunction create mode 100644 data/simplewaypoints/function/rename.mcfunction create mode 100644 data/simplewaypoints/function/set_color.mcfunction create mode 100644 data/simplewaypoints/function/set_range.mcfunction create mode 100644 pack.mcmeta diff --git a/data/minecraft/tags/dialog/pause_screen_additions.json b/data/minecraft/tags/dialog/pause_screen_additions.json new file mode 100644 index 0000000..a6f1c60 --- /dev/null +++ b/data/minecraft/tags/dialog/pause_screen_additions.json @@ -0,0 +1,3 @@ +{ + "values": ["simplewaypoints:manage"] +} diff --git a/data/minecraft/tags/dialog/quick_actions.json b/data/minecraft/tags/dialog/quick_actions.json new file mode 100644 index 0000000..a6f1c60 --- /dev/null +++ b/data/minecraft/tags/dialog/quick_actions.json @@ -0,0 +1,3 @@ +{ + "values": ["simplewaypoints:manage"] +} diff --git a/data/simplewaypoints/dialog/create.json b/data/simplewaypoints/dialog/create.json new file mode 100644 index 0000000..5512696 --- /dev/null +++ b/data/simplewaypoints/dialog/create.json @@ -0,0 +1,152 @@ +{ + "type": "minecraft:confirmation", + "title": "Create Waypoint", + "body": { + "type": "minecraft:plain_message", + "contents": "Create waypoint at your location" + }, + "inputs": [ + { + "type": "minecraft:text", + "key": "name", + "label": "Display Name" + }, + { + "type": "minecraft:single_option", + "key": "color", + "label": "Color", + "options": [ + { + "id": "white", + "display": { + "text": "White", + "color": "white" + } + }, + { + "id": "aqua", + "display": { + "text": "Aqua", + "color": "aqua" + } + }, + { + "id": "black", + "display": { + "text": "Black", + "color": "black" + } + }, + { + "id": "blue", + "display": { + "text": "Blue", + "color": "blue" + } + }, + { + "id": "dark_aqua", + "display": { + "text": "Dark Aqua", + "color": "dark_aqua" + } + }, + { + "id": "dark_blue", + "display": { + "text": "Dark Blue", + "color": "dark_blue" + } + }, + { + "id": "dark_gray", + "display": { + "text": "Dark Gray", + "color": "dark_gray" + } + }, + { + "id": "dark_green", + "display": { + "text": "Dark Green", + "color": "dark_green" + } + }, + { + "id": "dark_purple", + "display": { + "text": "Dark Purple", + "color": "dark_purple" + } + }, + { + "id": "dark_red", + "display": { + "text": "Dark Red", + "color": "dark_red" + } + }, + { + "id": "gold", + "display": { + "text": "Gold", + "color": "gold" + } + }, + { + "id": "green", + "display": { + "text": "Green", + "color": "green" + } + }, + { + "id": "light_purple", + "display": { + "text": "Light Purple", + "color": "light_purple" + } + }, + { + "id": "red", + "display": { + "text": "Red", + "color": "red" + } + }, + { + "id": "yellow", + "display": { + "text": "Yellow", + "color": "yellow" + } + } + ] + }, + { + "type": "minecraft:number_range", + "key": "range", + "label": "Range (m)", + "start": 5.0, + "end": 1000.0, + "step": 5.0, + "initial": 100 + } + ], + "yes": { + "label": { + "translate": "gui.ok", + "fallback": "Create Waypoint" + }, + "action": { + "type": "dynamic/run_command", + "template": "function simplewaypoints:create {name:\"$(name)\",color:\"$(color)\",range:\"$(range)\"}" + } + }, + "no": { + "label": { + "translate": "gui.cancel", + "fallback": "Cancel" + } + } +} diff --git a/data/simplewaypoints/dialog/delete.json b/data/simplewaypoints/dialog/delete.json new file mode 100644 index 0000000..75749cc --- /dev/null +++ b/data/simplewaypoints/dialog/delete.json @@ -0,0 +1,24 @@ +{ + "type": "minecraft:confirmation", + "title": "Delete Waypoint", + "body": { + "type": "minecraft:plain_message", + "contents": "Delete closest waypoint?" + }, + "yes": { + "label": { + "translate": "gui.yes", + "fallback": "Yes" + }, + "action": { + "type": "run_command", + "command": "function simplewaypoints:delete" + } + }, + "no": { + "label": { + "translate": "gui.no", + "fallback": "No" + } + } +} diff --git a/data/simplewaypoints/dialog/manage.json b/data/simplewaypoints/dialog/manage.json new file mode 100644 index 0000000..5c0cf75 --- /dev/null +++ b/data/simplewaypoints/dialog/manage.json @@ -0,0 +1,39 @@ +{ + "type": "minecraft:dialog_list", + "title": "Simple Waypoints", + "external_title": "Manage Waypoints", + "body": { + "type": "minecraft:plain_message", + "contents": [ + "Datapack by ", + { + "text": "pancakes", + "color": "dark_purple", + "underlined": true, + "click_event": { + "action": "open_url", + "url": "https://pancakes.gay" + }, + "hover_event": { + "action": "show_text", + "value": [ + "Open URL:\n", + { + "text": "https://pancakes.gay", + "color": "blue", + "underlined": true + } + ] + } + } + ] + }, + "dialogs": [ + "simplewaypoints:create", + "simplewaypoints:rename", + "simplewaypoints:set_color", + "simplewaypoints:set_range", + "simplewaypoints:delete" + ], + "columns": 1 +} diff --git a/data/simplewaypoints/dialog/rename.json b/data/simplewaypoints/dialog/rename.json new file mode 100644 index 0000000..9b1c5b5 --- /dev/null +++ b/data/simplewaypoints/dialog/rename.json @@ -0,0 +1,31 @@ +{ + "type": "minecraft:confirmation", + "title": "Rename Waypoint", + "body": { + "type": "minecraft:plain_message", + "contents": "Rename closest waypoint" + }, + "inputs": [ + { + "type": "minecraft:text", + "key": "name", + "label": "Display Name" + } + ], + "yes": { + "label": { + "translate": "gui.ok", + "fallback": "Rename" + }, + "action": { + "type": "dynamic/run_command", + "template": "function simplewaypoints:rename {name:\"$(name)\"}" + } + }, + "no": { + "label": { + "translate": "gui.cancel", + "fallback": "Cancel" + } + } +} diff --git a/data/simplewaypoints/dialog/set_color.json b/data/simplewaypoints/dialog/set_color.json new file mode 100644 index 0000000..a5fc1ef --- /dev/null +++ b/data/simplewaypoints/dialog/set_color.json @@ -0,0 +1,139 @@ + +{ + "type": "minecraft:confirmation", + "title": "Set Waypoint Color", + "body": { + "type": "minecraft:plain_message", + "contents": "Set color of closest waypoint" + }, + "inputs": [ + { + "type": "minecraft:single_option", + "key": "color", + "label": "Color", + "options": [ + { + "id": "white", + "display": { + "text": "White", + "color": "white" + } + }, + { + "id": "aqua", + "display": { + "text": "Aqua", + "color": "aqua" + } + }, + { + "id": "black", + "display": { + "text": "Black", + "color": "black" + } + }, + { + "id": "blue", + "display": { + "text": "Blue", + "color": "blue" + } + }, + { + "id": "dark_aqua", + "display": { + "text": "Dark Aqua", + "color": "dark_aqua" + } + }, + { + "id": "dark_blue", + "display": { + "text": "Dark Blue", + "color": "dark_blue" + } + }, + { + "id": "dark_gray", + "display": { + "text": "Dark Gray", + "color": "dark_gray" + } + }, + { + "id": "dark_green", + "display": { + "text": "Dark Green", + "color": "dark_green" + } + }, + { + "id": "dark_purple", + "display": { + "text": "Dark Purple", + "color": "dark_purple" + } + }, + { + "id": "dark_red", + "display": { + "text": "Dark Red", + "color": "dark_red" + } + }, + { + "id": "gold", + "display": { + "text": "Gold", + "color": "gold" + } + }, + { + "id": "green", + "display": { + "text": "Green", + "color": "green" + } + }, + { + "id": "light_purple", + "display": { + "text": "Light Purple", + "color": "light_purple" + } + }, + { + "id": "red", + "display": { + "text": "Red", + "color": "red" + } + }, + { + "id": "yellow", + "display": { + "text": "Yellow", + "color": "yellow" + } + } + ] + } + ], + "yes": { + "label": { + "translate": "gui.ok", + "fallback": "Set Color" + }, + "action": { + "type": "dynamic/run_command", + "template": "function simplewaypoints:set_color {color:\"$(color)\"}" + } + }, + "no": { + "label": { + "translate": "gui.cancel", + "fallback": "Cancel" + } + } +} diff --git a/data/simplewaypoints/dialog/set_range.json b/data/simplewaypoints/dialog/set_range.json new file mode 100644 index 0000000..7b66d0e --- /dev/null +++ b/data/simplewaypoints/dialog/set_range.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:confirmation", + "title": "Set Waypoint Range", + "body": { + "type": "minecraft:plain_message", + "contents": "Set range of closest waypoint" + }, + "inputs": [ + { + "type": "minecraft:number_range", + "key": "range", + "label": "Range (m)", + "start": 5.0, + "end": 1000.0, + "step": 5.0, + "initial": 100 + } + ], + "yes": { + "label": { + "translate": "gui.ok", + "fallback": "Set Range" + }, + "action": { + "type": "dynamic/run_command", + "template": "function simplewaypoints:set_range {range:\"$(range)\"}" + } + }, + "no": { + "label": { + "translate": "gui.cancel", + "fallback": "Cancel" + } + } +} diff --git a/data/simplewaypoints/function/create.mcfunction b/data/simplewaypoints/function/create.mcfunction new file mode 100644 index 0000000..9b8b150 --- /dev/null +++ b/data/simplewaypoints/function/create.mcfunction @@ -0,0 +1,3 @@ +execute if entity @e[type=minecraft:armor_stand,tag=simplewaypoints] run return run tellraw @s {"text":"You are too close to an existing waypoint!","color":"red"} +$execute align xyz run summon armor_stand ~0.5 ~ ~0.5 {CustomNameVisible:1b,NoGravity:1b,Small:1b,Invisible:1b,Marker:1b,attributes:[{id:"minecraft:waypoint_transmit_range",base:$(range).0d}],Tags:["simplewaypoints"],CustomName:{"color":"$(color)","text":"$(name)"}} +$waypoint modify @e[type=minecraft:armor_stand,tag=simplewaypoints,limit=1,sort=nearest] color $(color) diff --git a/data/simplewaypoints/function/delete.mcfunction b/data/simplewaypoints/function/delete.mcfunction new file mode 100644 index 0000000..6ca0213 --- /dev/null +++ b/data/simplewaypoints/function/delete.mcfunction @@ -0,0 +1,2 @@ +execute unless entity @e[type=minecraft:armor_stand,tag=simplewaypoints,distance=..2] run return run tellraw @s {"text":"You need to be next to a waypoint","color":"red"} +kill @e[type=minecraft:armor_stand,tag=simplewaypoints,limit=1,sort=nearest] diff --git a/data/simplewaypoints/function/rename.mcfunction b/data/simplewaypoints/function/rename.mcfunction new file mode 100644 index 0000000..b90b7d3 --- /dev/null +++ b/data/simplewaypoints/function/rename.mcfunction @@ -0,0 +1,2 @@ +execute unless entity @e[type=minecraft:armor_stand,tag=simplewaypoints,distance=..2] run return run tellraw @s {"text":"You need to be next to a waypoint","color":"red"} +$data modify entity @e[type=minecraft:armor_stand,tag=simplewaypoints,limit=1,sort=nearest] CustomName merge value {"text":"$(name)"} diff --git a/data/simplewaypoints/function/set_color.mcfunction b/data/simplewaypoints/function/set_color.mcfunction new file mode 100644 index 0000000..6e99110 --- /dev/null +++ b/data/simplewaypoints/function/set_color.mcfunction @@ -0,0 +1,3 @@ +execute unless entity @e[type=minecraft:armor_stand,tag=simplewaypoints,distance=..2] run return run tellraw @s {"text":"You need to be next to a waypoint","color":"red"} +$data modify entity @e[type=minecraft:armor_stand,tag=simplewaypoints,limit=1,sort=nearest] CustomName merge value {"color":"$(color)"} +$waypoint modify @e[type=minecraft:armor_stand,tag=simplewaypoints,limit=1,sort=nearest] color $(color) diff --git a/data/simplewaypoints/function/set_range.mcfunction b/data/simplewaypoints/function/set_range.mcfunction new file mode 100644 index 0000000..8faccde --- /dev/null +++ b/data/simplewaypoints/function/set_range.mcfunction @@ -0,0 +1,2 @@ +execute unless entity @e[type=minecraft:armor_stand,tag=simplewaypoints,distance=..2] run return run tellraw @s {"text":"You need to be next to a waypoint","color":"red"} +$attribute @e[type=minecraft:armor_stand,tag=simplewaypoints,limit=1,sort=nearest] minecraft:waypoint_transmit_range base set $(range) diff --git a/pack.mcmeta b/pack.mcmeta new file mode 100644 index 0000000..34fab53 --- /dev/null +++ b/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "description": "Simple Waypoints", + "pack_format": 79 + } +} \ No newline at end of file