-3

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.

2
  • AFK is cheating. No worse than /give
    – Asadefa
    Commented Feb 15, 2019 at 5:15
  • I'm trying to make it for fun, all it does is put you into the air. Yes, that may be cheating. I'm just trying to have some fun.
    – FunGamez
    Commented Feb 15, 2019 at 16:09

1 Answer 1

1
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
8
  • Cannot test it now, but should work
    – Tabin1000
    Commented Feb 26, 2019 at 17:47
  • any way to make this work with a teleporting command system? say, if someone wanted to make a way so that players were facing a specific direction at a specific time?
    – xTerrene
    Commented Apr 15, 2019 at 8:12
  • You want to teleport players somewhere when they are looking in some direction?
    – Tabin1000
    Commented Apr 15, 2019 at 11:37
  • Maybe /execute as @a[x_rotation=?,y=rotation=?] at @s run tp x y z
    – Tabin1000
    Commented Apr 15, 2019 at 11:39
  • other way around, actually. i want to force them to look in a direction at a specific location, but only once so they aren't constantly forced to. (ie. i want to make a pseudo spawn point where they're looking in a direction i need)
    – xTerrene
    Commented Apr 15, 2019 at 23:12

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.