• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • Minecraft 1.16.220 Update + Bug/Crash Fixes
    Added MCPE 1.16.220 version and fixed crashes for multiple plugins. You can view the full changelist here.
  • Forum Updates - 4/11/2021
    Various changes have been made to the forums and a few categories. You can view the full changelist here.

AFK Command

Warning!
Hello , there have been no replies in this thread for more than 30 days.
Please make sure you have a valid reason before you reply to this thread or you may face moderation action.

Null45

Coal Miner
#1
I made a fully functional AFK command, by running this command it will message everyone that "P is now afk" and if you change your position, yaw, pitch, or world it will automatically message everyone that "P is no longer afk"

cmd create afk AFK Main Command. | /afk
cmd add afk let %xx% = %x%
cmd add afk let %yy% = %y%
cmd add afk let %zz% = %z%
cmd add afk let %yaww% = %yaw%
cmd add afk let %pitchh% = %pitch%
cmd add afk let %levell% = %level%
cmd add afk message onlineplayers() §d%p% §ais now afk!
cmd add afk if %p% notin onlineplayers() then exit
cmd add afk if %x% != %xx% then goto 17
cmd add afk if %y% != %yy% then goto 17
cmd add afk if %z% != %zz% then goto 17
cmd add afk if %yaw% != %yaww% then goto 17
cmd add afk if %pitch% != %pitchh% then goto 17
cmd add afk if %level% != %level% then goto 17
cmd add afk sleep 0.2
cmd add afk goto 8
cmd add afk message onlineplayers() §d%p% §ais no longer afk!
cmd add afk exit