• check_circle Advancements
  • check_circle Functions
  • 3,764 views, 8 today
  • 293 downloads, 0 today
  • 11
  • 13
Loupieur's Avatar Loupieur
Level 40 : Master Dragon
9
AFK Protection Minecraft Data Pack                       Datapack
          1.19.4+

AFK Protection
is a Datapack made by TheRedLion_ (the original project : here) and edited by me (Loupieur) for the version 1.19.4+ that allows you to be in AFK Mode to be safe when you are not here when you are attacked by ennemies.

You can be in AFK Mode with the command :
trigger AFK_Mode
You can set the delay to be automatly in AFK Mode with the command :

trigger chose_AFK_Mode_delay_in_seconds_min_1_second set <number (in seconds, min 1 second)>and enable or disable the Auto AFK Mode to be automatly in AFK Mode with the command :
trigger Auto_AFK_Mode set <1 : to enable | 0 : to disable>or toggle enable/disable the Auto AFK Mode with :
trigger Auto_AFK_Mode_toggle
You can config this things with a player config command more easily and see if the Auto AFK Mode is enable or disable :

trigger AFK_Protection.player_config
If you are in combat (if you take damages or attack an enemy), you have to wait a moment (30 seconds in default) to be again in AFK Mode, the time of the cooldown can be config by admins putting a number in seconds, min 0 with the command :

function afk_protection:config
In AFK Mode you can't jump, interact with anything, hit anything, you are slow, you are invincible, invisible to be not detected by mobs away, to don't take any knockback, any mob or player can't approach you to prevent you from being pushed, you have some particles around you to see you even if you are invisible.

If you walk, sprint, sneak, move your head, make right click, make left click, swim, walk underwater, walk on water, ride pig/horse/strider, drive a minecart/boat you are no longer in AFK Mode or the delay to be automatly in AFK Mode is reset.
CompatibilityMinecraft 1.19
toMinecraft 1.20
Tags

2 Update Logs

Update #2 : by Loupieur 01/14/2024 4:51:36 pmJan 14th

Problems solved :

  • Any entity that have the NoAI NBT can't be pushed anymore by Player who are in AFK Mode
  • The [ ] of the messages send by the Datapack are now bold (it's now "[​AFK Protection]", it was "[AFK Protection]")
LOAD MORE LOGS

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome