Skip to content

Commit 7b28e9a

Browse files
committed
Respect AFK players marked by the Detect AFK Players datapack
1 parent 4960d20 commit 7b28e9a

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,27 @@ Just like the Vanilla Tweaks version,
3030
this pack also doesn't allow players to tag AFK players,
3131
if a player is marked AFK by the Vanilla Tweaks AFK Display pack.
3232

33+
## Detect AFK Players Compatible
34+
35+
This pack will not allow players to tag AFK players
36+
from the Detect AFK Players datapack.
37+
It should treat these players the same it treats players marked
38+
AFK by the Vanilla Tweaks AFK Display datapack.
39+
3340
## Usage Guide
3441

3542
To add someone to the tagger's team and give them a tag,
3643
an admin can use the command `/execute as <playername> run function tag:become_tagger`
3744

45+
To make someone no longer a tagger (and take away their tag),
46+
an admin can use the command `/execute as <playername> run function tag:become_normal`
47+
3848
An admin can create a new tag at anytime by using the command `function tag:spawn_tag`
3949

50+
As long as a player is a tagger, they will have a red name.
51+
This only works if the player isn't on another team.
52+
Every 5 seconds, the game will give all taggers who aren't on a team back their red name.
53+
4054
The pack keeps track of how many times each player has been tagged.
4155
An admin can display it under player names with the command
4256
`/scoreboard objectives setdisplay below_name tg_timesTagged`
@@ -91,6 +105,8 @@ I felt were issues with the original pack.
91105
* To make a player no longer a tagger, use `/execute as <player> run function tag:become_normal`
92106
* If a tagger has no team, they are occasionally added back to the `tg_tagged` team (to give them the red name)
93107
* Uninstall command attempts to remove tag game tags from players (for players who are online)
108+
* Added support for the Detect AFK Players datapack
109+
* Players marked AFK by this datapack also cannot be tagged
94110

95111
## Issues
96112

data/tag/function/check_tag.mcfunction

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ execute on attacker if entity @s[tag=tm_tg_tagged] run tag @s add tg_tagger
77
tag @s add tg_tagged
88

99
# if done with cooldown AND tagged player isn't afk
10-
execute if entity @s[team=!afkDis.afk] if entity @p[tag=tg_tagger,scores={tg_tagCooldown=0}] run function tag:swap_tagger
10+
execute if entity @s[team=!afkDis.afk,tag=!afk] if entity @p[tag=tg_tagger,scores={tg_tagCooldown=0}] run function tag:swap_tagger
1111

1212
# else still on cooldown AND tagged player isn't afk
13-
execute if entity @s[team=!afkDis.afk] unless entity @p[tag=tg_tagger,scores={tg_tagCooldown=0}] as @a[tag=tg_tagger] run function tag:cooldown_message
13+
execute if entity @s[team=!afkDis.afk,tag=!afk] unless entity @p[tag=tg_tagger,scores={tg_tagCooldown=0}] as @a[tag=tg_tagger] run function tag:cooldown_message
1414

1515
# Tell off other player for hitting an afk player
1616
execute if entity @s[team=afkDis.afk] on attacker run tellraw @s [{"color":"red","text":"You cannot tag an AFK player!"}]
17+
execute if entity @s[tag=afk] on attacker run tellraw @s [{"color":"red","text":"You cannot tag an AFK player!"}]
1718

1819
# cleanup
1920
tag @s remove tg_tagged

0 commit comments

Comments
 (0)