Data Packs Server Utility

AFK Status/Protection/Prefix by RecReo

  • 3k views 0 today
  • save_alt 258 downloads
Compatibility
Minecraft 1.16
to version
Minecraft 1.20
Changes include
  • Advancements
  • Functions
  • 8
  • 8
  • 7
RecReo
Lvl 27Expert System
2
This datapack lets players on the server see if others are near their pc or went to take a snack and left Minecraft open.

To manually enter the AFK mode use:
/trigger afk

It also offers protection from monsters so you can leave your game running and not worry about losing your resources.
But still, you need to be aware of your enemies, as they can still damage you!
The datapack is highly customizable. Here are some settings:


Settings
/scoreboard players set ... <afkSettings> <value/0=true/1=false>
  • Protection — define whether the AFK player will be protected from mobs, but not players, drowning, fall damage, or other types of damage; (default = true)
  • Particles — define whether particles appear near the AFK player; (default = true)
  • Prefix — define whether AFK players have a prefix next to their name; (reload required)
  • AfterHitDelay — time in seconds after being hit or hitting a target when the player can't be marked as AFK; (default = 30 seconds)
  • AfkTime — time in seconds the player needs to stand still to automatically be marked as AFK, set to 0 to disable AutoAFK; (default = 30 seconds)
Warning!!!
This datapack may conflict with other datapacks that use teams! Name your team default so players will automatically join after they leave the AFK status, or provide a function that will put players in needed teams every tick.

To remove the datapack from the world and leave no trace use:
/function afk:remove

More like this

  Have something to say?

Skyrarus
02/21/2024 2:05 pm
Level 1 : New Miner
hmm...
/scoreboard players set sugy87 afk_time 300 and still puts me in afk after 30s
1
RecReo
02/29/2024 7:08 am
Level 27 : Expert System
history
I’m not sure if afk_time does something, as I made this datapack almost half a year ago.
If you are talking about the settings, the scoreboard for it is AfkTime.
Exactly how it’s in the description.
2
noobreal987
11/04/2023 4:17 pm
Level 1 : New Miner
ITS GOOD
2
WildFyr
10/27/2023 5:51 pm
Level 18 : Journeyman Network
How does one edit the settings? I have never used a scoreboard command to change data pack settings, always a function, so this is different to me.
1
RecReo
10/28/2023 9:45 am
Level 27 : Expert System
My bad! I changed it a bit, hope it's more clear)
When configuring things like Protection/Particles/Prefix, 0 represents false/off, and 1 represents true/on.
And for AfkTime/AfterHitDelay — it's seconds.
I made an entire settings gui in one of my other datapacks, but I thought that this datapacks was too small for this
I hope you like this datapack and I am sorry for the inconvenience.
2
ZORO_TM
10/18/2023 12:18 am
Level 1 : New Miner
valid for 1.20.2 ?
1
RecReo
10/19/2023 2:31 am
Level 27 : Expert System
Yes, of course)
1

Welcome