Minecraft Data Packs / Server Utility

Combat Logging Prevention

  • check_circle Functions
  • 9,651 views, 16 today
  • 1,155 downloads, 2 today
  • 14
  • 13
  • 19
GrubLubSnub's Avatar GrubLubSnub
Level 49 : Master Blockhead
68
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.
CreditCreated By GrubLubSnub
CompatibilityMinecraft 1.13
toMinecraft 1.19
Tags

1 Update Logs

Update #1 : by GrubLubSnub 11/17/2022 11:10:44 amNov 17th, 2022

  • 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.

Create an account or sign in to comment.

KaleidioMakes
01/29/2023 7:53 am
Level 1 : New Miner
history
KaleidioMakes's Avatar
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 49 : Master Blockhead
GrubLubSnub's Avatar
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
KaleidioMakes's Avatar
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
Zylon27's Avatar
Is this for bedrock and does it work on realms?
1
GrubLubSnub
11/24/2022 10:56 am
Level 49 : Master Blockhead
GrubLubSnub's Avatar
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 40 : Master Miner
Lordphenex's Avatar
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 49 : Master Blockhead
GrubLubSnub's Avatar
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 40 : Master Miner
Lordphenex's Avatar
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 49 : Master Blockhead
GrubLubSnub's Avatar
Would you like me to make a version with this or add an option?
1
Lordphenex
11/19/2022 11:00 am
Level 40 : Master Miner
Lordphenex's Avatar
Yes adding an option for servers to choose what should happen when logging back could be great.
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome