Data Packs Server Utility

Combat Logging Prevention

  • 11.9k views 1 today
  • save_alt 1.3k downloads
Compatibility
Minecraft 1.13
to version
Minecraft 1.19
Changes include
  • Functions
Added CreditCreated By GrubLubSnub
  • 15
  • 13
  • 19
GrubLubSnub
Lvl 51Grandmaster Blockhead
80
This pack prevents combat logging by killing the player that logged out when they rejoin. If you hit someone or get hit by someone, you are "in combat" and can only leave the game after 30 seconds. The timer resets back to 30 seconds every time you get hit or hit someone.

If you want to edit the amount of time you need to wait before logging off, use /scoreboard players set #cooldown damage_timer <#ofTicks/>

A warning is send to new players to let them know, and the combat timer is visible above your hotbar.

Requested by User3996952G.

1 Update Logs

Update #1 : by GrubLubSnub 11/17/2022 11:10:44 amNovember 17, 2022 @ 4:10 pm UTC

  • Optimized datapack.
  • Cooldown display is now red and changes to green when finished
  • You can now change the cooldown with /scoreboard players set #cooldown damage_timer <#ofTicks>
  • Default cooldown is now 30 seconds.

More like this

  Have something to say?

KaleidioMakes
01/29/2023 7:53 am
Level 1 : New Miner
history
Hi there, asking for permission to add this to my curseforge-published modpack for our anti-cheat update? I'd also like to modify the advancements of the datapack to do the same thing if any entity hits, not just players
1
GrubLubSnub
01/31/2023 10:17 pm
Level 51 : Grandmaster Blockhead
As long as you include a link to this website in a place easy to find and give credit you may include it.
1
KaleidioMakes
02/01/2023 12:06 pm
Level 1 : New Miner
Thanks a bunch! Saved me a lot of time having to figure out the core code myself. It will be heavily modified though to support minigames a bit better, alongside the other changes I mentioned. Thanks
1
Zylon27
11/23/2022 10:28 am
Level 1 : New Miner
Is this for bedrock and does it work on realms?
1
GrubLubSnub
11/24/2022 10:56 am
Level 51 : Grandmaster Blockhead
This is not for Bedrock, but it does work for Java Realms. (Bedrock doesn't have datapacks)
1
Lordphenex
11/18/2022 7:20 am
Level 44 : Master Miner
That's a good datapack ! Maybe killing the player is a bit extreme as combat logging can happen unvoluntarily. Maybe instead of killing the player you could give him a strong negative effect so if he was fighting with someone, he will get killed easily.

Also, there is an easier and more straight-forward way to detect when a player log back : there is the custom score leave_game that tracks the number of times a player left the world.
1
GrubLubSnub
11/18/2022 10:29 am
Level 51 : Grandmaster Blockhead
Do you have a suggestion on what the affect should be and for how long?

I just killed the player because if you do not know where they logged out they will be able to escape or wait a few days irl to get away for free.
2
Lordphenex
11/18/2022 10:36 am
Level 44 : Master Miner
Yeah I got your point. If they log back short amount of time after loging out, if you give them a little bit of slowness, blindness the other fighter can come and find them. If they are to afraid, they will have to wait before logging back, so either way there will be some sort of a punishment.
1
GrubLubSnub
11/18/2022 6:34 pm
Level 51 : Grandmaster Blockhead
Would you like me to make a version with this or add an option?
1
Lordphenex
11/19/2022 11:00 am
Level 44 : Master Miner
Yes adding an option for servers to choose what should happen when logging back could be great.
1

Welcome