Forumskeyboard_arrow_right Help keyboard_arrow_right Java Edition

Create Forum Thread
1

Datapack problems

1 emeralds2 replies47 views
created 12/11/2019 1:32 pm by Cra-Zy history
last reply 12/12/2019 10:01 am

                    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)



and the code for the actual question section:
Information.mcfunction
Posted by avatar
Cra-Zy
Level 4 : Apprentice Network
5

comment Login or register to post a reply.

2 replies

1
12/12/2019 2:40 am
Level 18 : Journeyman Unicorn
HoboMaggot
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 4 : Apprentice Network
Cra-Zy
Thank you so much! this actually solved the global message

Planet Minecraft

Browse

Website

© 2010 - 2020
www.planetminecraft.com

Welcome