1

Datapack problems

Cra-Zy's Avatar Cra-Zy12/11/19 1:32 pm history
1 emeralds 149 2
12/12/2019 10:01 am
Cra-Zy's Avatar Cra-Zy

                    SOLVED!





Hi!
I try to remake several addons of a datapack made by CommanderRedstone, which he used for the HeroFair theme park (https://www.youtube.com/watch?v=QIHJmyk5xlQ)

the thing is, is that his datapack isn't made for 1.14.4 and so i thought i would update it to 1.14.4 and maybe i could use it for myself (no worries, the proper credits are given ;) )


Functionality:

With this datapack, when a person stands 2 blocks above infested stone, a message will popup with clickable texts, these texts are questions the player can choose from. by clicking a message a new message will appear with the answer to that question.

Whenever the player decides to leave, the chat will be "cleared" and a goodbye message will pop-up


The Problem:
Whenever a player stands above the infested stone, only that players score will be affected, but nevertheless the goodbye message will pop-up for everybody on the server. which isn't what i want. the goodbye message is seen in the "infostart" code, in the "information" code is where all the questions with answers are layed out.

If a player clicks a question, the goodbye message will be sent again to every player on the server. so its a never-ending process, unless the player leaves the infested stone. then everyone gets 1 final goodbye till the next player decides to stand above the infested stone.


Could someone help me figure out how to affect only the player above the infested stone?


the code:
infostart.mcfunction (looped)
# Datapack for interactive help desks (Minecraft 1.14.4)
# Inspired by: CommanderRedstone
# Created by: CraZy

#------------------------------------------------ Start Function ----------------------------------------------------------------
scoreboard players add @a InfoStart 0
execute as @p at @s if block ~ ~-2 ~ minecraft:infested_stone run function infotable:info/information

tag @a remove infosession
execute as @p at @s if block ~ ~-2 ~ minecraft:infested_stone run tag @s add infosession


#------------------------------------------------ GoodBye Message ---------------------------------------------------------------

execute if entity @a[​tag=infosession2] run tellraw @p[​tag=!infosession] {"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> Have a nice day!"}
execute if entity @a[​tag=infosession2] run scoreboard players set @p[​tag=!infosession] InfoStart 0
tag @a remove infosession2
execute as @p at @s if block ~ ~-2 ~ minecraft:infested_stone run tag @s add infosession2



and the code for the actual question section:
Information.mcfunction
# Datapack for interactive help desks (Minecraft 1.14.4)
# Inspired by: CommanderRedstone
# Created by: CraZy


#------------------------------------------------ Welcome Message -----------------------------------------------------

scoreboard players set @a[​scores={InfoStart=0}] InfoStart 1
scoreboard players enable @s InfoStart
tellraw @p[​scores={InfoStart=1..,InfoStart=1}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> Welcome to the information desk! How can I be of your assistance?\n\n"},{"text":" [​Park Questions] ","color":"green","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}},{"text":"[​Credits]\n","color":"red","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 17"}}]



#------------------------------------------------ Park Questions ------------------------------------------------------

scoreboard players enable @s InfoStart
tellraw @p[​scores={InfoStart=3}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> Questions about the Park? Ask me anything!\n\n"},{"text":" [​What are RollerCredits?]","color":"green","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 4"}},{"text":" [​Which Ride is the Best?]","color":"red","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 5"}},{"text":"\n [​What can I do in the Park?] ","color":"gold","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 6"}},{"text":"\n [​Is this world up for Download?]","color":"light_purple","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 7"}},{"text":"\n [​How do I earn RollerCredits?] ","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 8"}},{"text":"\n [​How long did it take to make this world?]","color":"yellow","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 9"}},{"text":"\n [​Is there a Website?] ","color":"light_purple","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 10"}},{"text":"[​Can I buy Food??] ","color":"gray","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 11"}},{"text":"\n [​Can I open an Attraction?] ","color":"green","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 12"}},{"text":"[​How do shops work?]","color":"yellow","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 13"}},{"text":"\n [​How do I contact staff?]","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 14"}},{"text":"\n [​What are the Rules?]","color":"red","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 15"}},{"text":"\n [​I Lost my Map]","color":"dark_aqua","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 16"}},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 1"}}]


#--------------------------------------------- Park Questions Answers --------------------------------------------------

tellraw @p[​scores={InfoStart=4}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"RollerCredits are points, which you can use for epic armor or special addons to make your experience even greater!"},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=5}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"There is no Best! but I highly recommend seeing the ","color":"white"},{"text":"\n Pirate's Adventure","bold":true,"color":"light_purple"},{"text":" ride.","bold":false,"color":"white"},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=6}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"There is a TON to do, go in an Attraction, play some Games, earn achievements and points, and most important: HAVE FUN!"},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=7}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"Nope."},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=8}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"You can earn RollerCredits by playing Mini-Games, or go and visit one of our top-notch Attractions! Because everytime you go in a certain attraction you get some points."},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=9}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"C","bold":true,"color":"dark_red"},{"text":"r","color":"yellow"},{"text":"a","color":"white"},{"text":"Z","bold":true,"color":"gold"},{"text":"y","color":"yellow"},{"text":" Started building this Park on the 24th of April, 2019. And still it isn't finished"},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=10}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"As for right now? No. Sorry :c"},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=11}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"Yes You can at our various restaurants, take a look on your map!"},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=12}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"Only Employees can do so, to become one, simply solicitate on our website!"},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=13}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"You go to one of my colleague clerics, stand right in front of him, and tell him what you want to order, it's as simple as that!"},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=14}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"If you need some assistance, simply do /staff and you can see which staff members are online"},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=15}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"/rules....can't make it easier than that...."},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]

tellraw @p[​scores={InfoStart=16}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"Then here you go! a brand new fresh one :)"},{"text":"\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 3"}}]


#-------------------------------------------------- Credits ------------------------------------------------------------

tellraw @p[​scores={InfoStart=17}] [{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> "},{"text":"C","bold":true,"color":"dark_red"},{"text":"r","color":"yellow"},{"text":"a","color":"white"},{"text":"Z","bold":true,"color":"gold"},{"text":"y","color":"yellow"},{"text":" created the Datapack (which was inspired by CommanderRedstone), the Park and Resource pack! What an amazing guy!","bold":false,"color":"white"},{"text":"\n\n "},{"text":"<<< Back\n","color":"white","clickEvent":{"action":"run_command","value":"/trigger InfoStart set 1"}}]



#----------------------------------------------- Spam Prevention --------------------------------------------------------

scoreboard players set @a[​scores={InfoStart=0..}] InfoStart 2
Posted by Cra-Zy's Avatar
Cra-Zy
Level 19 : Journeyman Architect
12

Create an account or sign in to comment.

2

1
12/12/2019 2:40 am
Level 51 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
tag @a remove infosession
execute as @p at @s if block ~ ~-2 ~ minecraft:infested_stone run tag @s add infosession


#------------------------------------------------ GoodBye Message ---------------------------------------------------------------

execute if entity @a[tag=infosession2] run tellraw @p[tag=!infosession] {"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<Cleric> Have a nice day!"}
execute if entity @a[tag=infosession2] run scoreboard players set @p[tag=!infosession] InfoStart 0
tag @a remove infosession2
execute as @p at @s if block ~ ~-2 ~ minecraft:infested_stone run tag @s add infosession2



You tellrawed to everyone without the infosession tag the goodbye message.
In datapacks, @p = @a, unless a position or entity has been selected, so essentially you're doing: tellraw @a[tag=!infosession2]

You could do instead: execute as @a[tag=infosession2] run tellraw @s {etc
2
12/12/2019 10:01 am
Level 19 : Journeyman Architect
Cra-Zy
Cra-Zy's Avatar
Thank you so much! this actually solved the global message
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome