Need Help With NPC Command [Bedrock] [PS5]
I’m making a PvP world and I have a GUI that uses /titleraw but some people have complained it blocks there view so I’m trying to add an NPC that turns the GUI on/off. The GUI will only run the titleraw command if the player doesn’t have the “NoTitleraw” tag. The command for the NPC is as following. (spaces in selector commands aren’t actually in NPC, it’s so Reddit doesn’t think I’m listing a different Reddit category).
/execute as @ initiator if entity @ s[tag=!NoTitleraw] run tag @ s add NoTitleraw
/execute as @ initiator if entity @ s[tag=NoTitleraw] run tag @ s remove NoTitleraw
For some reason, the command that removes NoTitleraw (Adds GUI back) works perfectly while the other doesn’t. I tested in chat to see where my error was but the on,y thing wrong with the first command was the @ initiator part. When I used a separate selector in chat, it worked fine.
I’m not an expert in commands or anything so please tell me how to fix this problem and if I’m just dumb and it’s really obvious or not.