I understand commands but I am fairly new to the 1.13 changes.

I am trying to make an AFK system within vanilla Minecraft.

I want to use the /execute command to execute once. I want to detect when a scoreboard objective is a certain value and print

[Player] has gone AFK

in the chat only once. This is my command at the moment,

execute as @a[scores={afk=1..}] at @s run tellraw @a {"text":"","color":"red","extra":[{"selector":"@s"},{"text":" has gone AFK.","color":"yellow"}]}

It keeps printing until the scoreboard value is reset.


1. /execute as @a[scores={afk=1..},tag=!afkMesaage] run tellraw @a <your message>
2. /tag add @a[scores={afk=1..}] afkMessage
3. /tag remove @a[scores={afk=0}] afkMessage

Command blocks:

  1. Repeating, Always active
  2. Chain, Always active
  3. Chain, Always active