1

I'm currently writing a datapack and want to have a message send only once to a player when they join the server for the first time.

I have a rough idea of how I could use scores to say who isn't new, but I can't figure out how to target someone when they join.

Here's a quick example of my idea:

/execute unless entity @a[score={joined=1..}] run msg @[<Part I can't figure out>] Welcome
/execute unless entity @a[score={joined=1..}] run scoreboard player add @[<Part I can't figure out>] joined 1

It's just a rough example to show what part I'm talking about, so don't come at me if the syntax is wrong.

2 Answers 2

2

I found an answer, I didn't realize that when selecting a target, you can use =! to say "not equal to". So when you would type @[tag=!<your tag here>] to target the user then give them the tag afterwards.

1
  • If this worked, press the green check mark next to your answer to help others who had the same problem figure it out. Welcome to Arqade!
    – AdamRaichu
    Commented Jan 16, 2023 at 20:41
0

You can use @s selector:

execute as @a at @s unless entity @s[joined=1..] run msg @s Welcome
execute as @a at @s unless entity @s[joined=1..] run scoreboard player add @s joined 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.