Plugin Proposal: Disable distant villager AI
Posted: Wed Mar 31, 2021 3:07 pm
This is in response to Burger's post at viewtopic.php?f=5&t=2789
Plugin concept: Villager AI is disabled if no players are within a certain distance, say 50 blocks. I've asked Kutecats to try and write this plugin, but if someone else wants to write it if the idea sounds good, go for it. Yukarion asked for pros and cons to be listed of such a plugin, so I'll do my best to come up with some.
Pros:
Villagers are one of the laggiest things on the server due to their horribly broken AI, and currently bases like CreaPat's are single-handedly destroying TPS due to an abundance of villagers.
Players wouldn't have to make trading halls far from their base to account for passive lag.
This plugin is entirely possible to make seeing as a different version of it exists to disable tamed mob AI if their owner is too far away.
Cons:
Could create situations where villagers just allow themselves to be killed.
Trades wouldn't reset unless a person was close to the villager.
Villager breeders would be impacted.
I'd like to hear suggestions though about how some of those cons could be eliminated. Maybe villagers could be invulnerable if no player was nearby to account for them not being able to flee from a threat? On the second con, maybe trades could be tweaked to reset twice a day regardless of whether it's day or night?
And some might call this "un-vanilla" but inherently any change is going to be that. The actual impact this would have on the game itself would pretty much not be noticeable. Villagers themselves aren't rendered if you're more than 50 blocks away anyway, so you wouldn't see them actually turning into lifeless robots.
Would like some thoughts though and maybe more information about villager AI. Does their AI even continue to function if they're out of render distance?
Plugin concept: Villager AI is disabled if no players are within a certain distance, say 50 blocks. I've asked Kutecats to try and write this plugin, but if someone else wants to write it if the idea sounds good, go for it. Yukarion asked for pros and cons to be listed of such a plugin, so I'll do my best to come up with some.
Pros:
Villagers are one of the laggiest things on the server due to their horribly broken AI, and currently bases like CreaPat's are single-handedly destroying TPS due to an abundance of villagers.
Players wouldn't have to make trading halls far from their base to account for passive lag.
This plugin is entirely possible to make seeing as a different version of it exists to disable tamed mob AI if their owner is too far away.
Cons:
Could create situations where villagers just allow themselves to be killed.
Trades wouldn't reset unless a person was close to the villager.
Villager breeders would be impacted.
I'd like to hear suggestions though about how some of those cons could be eliminated. Maybe villagers could be invulnerable if no player was nearby to account for them not being able to flee from a threat? On the second con, maybe trades could be tweaked to reset twice a day regardless of whether it's day or night?
And some might call this "un-vanilla" but inherently any change is going to be that. The actual impact this would have on the game itself would pretty much not be noticeable. Villagers themselves aren't rendered if you're more than 50 blocks away anyway, so you wouldn't see them actually turning into lifeless robots.
Would like some thoughts though and maybe more information about villager AI. Does their AI even continue to function if they're out of render distance?