From 46ba5c18455bfb0b92f718ae0179e2cf2f79c4d9 Mon Sep 17 00:00:00 2001 From: Ceddix <49922771+Ceddix@users.noreply.github.com> Date: Mon, 16 Aug 2021 15:17:49 +0200 Subject: [PATCH] Add files via upload --- data/minecraft/tags/functions/load.json | 5 +++++ data/minecraft/tags/functions/tick.json | 5 +++++ data/visiblemarkers/functions/disable.mcfunction | 8 ++++++++ data/visiblemarkers/functions/enable.mcfunction | 13 +++++++++++++ data/visiblemarkers/functions/run.mcfunction | 15 +++++++++++++++ pack.mcmeta | 6 ++++++ 6 files changed, 52 insertions(+) create mode 100644 data/minecraft/tags/functions/load.json create mode 100644 data/minecraft/tags/functions/tick.json create mode 100644 data/visiblemarkers/functions/disable.mcfunction create mode 100644 data/visiblemarkers/functions/enable.mcfunction create mode 100644 data/visiblemarkers/functions/run.mcfunction create mode 100644 pack.mcmeta diff --git a/data/minecraft/tags/functions/load.json b/data/minecraft/tags/functions/load.json new file mode 100644 index 0000000..70a1b1e --- /dev/null +++ b/data/minecraft/tags/functions/load.json @@ -0,0 +1,5 @@ +{ + "values": [ + "visiblemarkers:enable" + ] +} \ No newline at end of file diff --git a/data/minecraft/tags/functions/tick.json b/data/minecraft/tags/functions/tick.json new file mode 100644 index 0000000..0515083 --- /dev/null +++ b/data/minecraft/tags/functions/tick.json @@ -0,0 +1,5 @@ +{ + "values": [ + "visiblemarkers:run" + ] +} \ No newline at end of file diff --git a/data/visiblemarkers/functions/disable.mcfunction b/data/visiblemarkers/functions/disable.mcfunction new file mode 100644 index 0000000..9146fb2 --- /dev/null +++ b/data/visiblemarkers/functions/disable.mcfunction @@ -0,0 +1,8 @@ +# Reset scores. +# This datapack was created by Ceddix! https://www.planetminecraft.com/member/ceddix/ + +# remove score +scoreboard objectives remove showmarker + +# debug outputs +tellraw @s ["",{"text":"DEBUG: ","bold":true,"color":"gold"},{"text":"All scores were removed!","color":"yellow"}] \ No newline at end of file diff --git a/data/visiblemarkers/functions/enable.mcfunction b/data/visiblemarkers/functions/enable.mcfunction new file mode 100644 index 0000000..7f24884 --- /dev/null +++ b/data/visiblemarkers/functions/enable.mcfunction @@ -0,0 +1,13 @@ +# Executed with every reload. +# This datapack was created by Ceddix! https://www.planetminecraft.com/member/ceddix/ + +# add required score +scoreboard objectives add showmarker trigger + +# enable trigger +tag @s add showmarker +execute if entity @p[tag=showmarker] as @a[tag=showmarker] run scoreboard players enable @s showmarker + +# debug outputs +tellraw @s ["",{"text":"DEBUG: ","bold":true,"color":"gold"},{"text":"Datapack was reloaded!","color":"yellow"}] +tellraw @a[tag=showmarker] ["",{"text":"VisibleMarkers","bold":true,"color":"gold"},{"text":" » ","color":"dark_gray"},{"text":"You have the permissions to see markers. Use","color":"gray"},{"text":" /trigger showmarker ","color":"yellow"},{"text":"to have them displayed to you!","color":"gray"}] \ No newline at end of file diff --git a/data/visiblemarkers/functions/run.mcfunction b/data/visiblemarkers/functions/run.mcfunction new file mode 100644 index 0000000..8292752 --- /dev/null +++ b/data/visiblemarkers/functions/run.mcfunction @@ -0,0 +1,15 @@ +# Runs every tick. +# This datapack was created by Ceddix! https://www.planetminecraft.com/member/ceddix/ + +# enable showmarker +execute if entity @p[scores={showmarker=1}] as @a[scores={showmarker=1}] run tellraw @s ["",{"text":"VisibleMarkers","bold":true,"color":"gold"},{"text":" » ","color":"dark_gray"},{"text":"All markers within your radius are now visible!","color":"green"}] +execute if entity @p[scores={showmarker=1}] as @a[scores={showmarker=1}] run scoreboard players enable @s showmarker +execute if entity @p[scores={showmarker=1}] as @a[scores={showmarker=1}] run scoreboard players set @s showmarker 2 + +# marker display +execute if entity @p[scores={showmarker=2}] as @e[type=minecraft:marker] at @s if entity @p[distance=..20,scores={showmarker=2}] run particle minecraft:barrier ~ ~ ~ 0 0 0 1 1 normal @a[distance=..20,scores={showmarker=2}] + +# disable display +execute if entity @p[scores={showmarker=3..}] as @a[scores={showmarker=3..}] run tellraw @s ["",{"text":"VisibleMarkers","bold":true,"color":"gold"},{"text":" » ","color":"dark_gray"},{"text":"Markers are no longer displayed.","color":"red"}] +execute if entity @p[scores={showmarker=3..}] as @a[scores={showmarker=3..}] run scoreboard players enable @s showmarker +execute if entity @p[scores={showmarker=3..}] as @a[scores={showmarker=3..}] run scoreboard players set @s showmarker 0 \ No newline at end of file diff --git a/pack.mcmeta b/pack.mcmeta new file mode 100644 index 0000000..faca40c --- /dev/null +++ b/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 7, + "description": "Display Marker entities. Useful and simple datapack for mapmakers. Datapack by Ceddix!" + } +} \ No newline at end of file