[Suggestion] Anti Enderman Griefing
PossessedRyd opened this issue ยท 4 comments
Seeing as carpet has got one player sleeping, another feature that alot of servers make use of is making it so enderman cant pick up and place blocks. Usually thats with a datapack that places something in every endermans hands that cant be placed, but potentially it could be a setting to just turn off their ability to pick up and place blocks with carpet mod.
The difference between those is that the onePlayeSleeping
is relatively complex with datapacks, checking every tick if players are sleeping and executing other logic to consider if they have slept for enough time, etc, while in a mod it is just hooked to the updateSleepingPlayers
function and checked only when that happens.
On the other hand, the enderman griefing protection is different. Since Minecraft already allows you to change the list of blocks that endermen try to pickup (even emptying the list, that's what those datapacks do), and Minecraft would anyway check that list, it doesn't add any redundant checks. It may be ever so slightly more performance if the checking is completely suppressed with a mod, but preventing enderman grief is just 2 lines in a datapack: one to set it to replace, and another specifying it's empty.
And I feel like a datapack may even be more performance friendly (by about half a nanosecond) as first the enderman checks for the block from the list in the datapack, then checks line of sight, then attempts to pick up, and the mod would intervene only after that point, whereas the datapack would intervene a couple of lines of code before, by not having any block which the enderman can pick up, thus ending before even the start of the eye line check. But tbh that's not why I say use datapack. I say because it's just useless to have it.