Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceddix authored Aug 16, 2021
1 parent 14505cb commit 46ba5c1
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/minecraft/tags/functions/load.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"visiblemarkers:enable"
]
}
5 changes: 5 additions & 0 deletions data/minecraft/tags/functions/tick.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"visiblemarkers:run"
]
}
8 changes: 8 additions & 0 deletions data/visiblemarkers/functions/disable.mcfunction
Original file line number Diff line number Diff line change
@@ -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"}]
13 changes: 13 additions & 0 deletions data/visiblemarkers/functions/enable.mcfunction
Original file line number Diff line number Diff line change
@@ -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"}]
15 changes: 15 additions & 0 deletions data/visiblemarkers/functions/run.mcfunction
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 7,
"description": "Display Marker entities. Useful and simple datapack for mapmakers. Datapack by Ceddix!"
}
}

0 comments on commit 46ba5c1

Please sign in to comment.