• check_circle Advancements
  • check_circle Functions
  • 7,252 views, 2 today
  • 376 downloads, 0 today
  • 15
  • 15
  • 12
surfrock66 avatar surfrock66
Level 21 : Expert Engineer
2
I created a datapack which helps with villager lag in trading halls.

If you name tag a villager with “Stillager” or “stillager” they will stop moving and path finding altogether. This is done by setting the “NoAI” tag of the villager to 1. This typically eliminates restocks, so I have a function to manually restock all trades at 8:00 AM and 2:00 PM. This is mostly consistent with vanilla behavior, villagers restock twice a day at slightly random times, but their 4 phases of the day (work, gather, wander, and sleep) can be divided into 4 segments which is the logic behind the restock times.

If you want to disable this, you tag the villager with “Moveager” or “moveager” and the name disappears and their AI is restored.

This is particularly useful for trading halls where villagers are locked in 1×1 spaces. In my test world where I have a trading hall with ~150 villagers, it took the tps from 15 to 20, the MSPT from ~65 to ~50, and the FPS to ~30 to ~60 (where I have it capped). This has tremendous lag reduction impacts without the headache of doing double-carpet tricks, and is completely optional so villagers in mob farms or those that are naturally spawned are completely unaffected; this is opt-in.

The only mobs impacted by this are villagers. If you name another mob "Stillager" or "Moveager" it will be unaffected.

Special thanks to the VanillaTweaks team; this was made using their “SilenceMe” and “Track Raw Statistics” datapacks as templates.

This is my first datapack, so feedback is welcome.

-- UPDATE 2021.12.11 -- This has been tested in 1.18 and 1.18.1 and still works as expected.

-- UPDATE 2022.06.17 -- Updated the "pack format" tag marking it as compatible with 1.19, fully tested and working.
CreditVanillaTweaks
CompatibilityMinecraft 1.14
toMinecraft 1.19
Tags

2 Update Logs

Stillagers.v1.0.2 : by surfrock66 06/17/2022 4:30:54 pmJun 17th

There is absolutely nothing changed in this version except the "pack format" tag marking it compatible with 1.19.
LOAD MORE LOGS

Create an account or sign in to comment.

1
12/15/2021 6:55 am
Level 2 : Apprentice Explorer
SirJoeDoe
SirJoeDoe avatar
Have noticed an issue with applying this to villagers before you have them fully set up. While restocks work, if you are attempting to unlock new trades for the villager, they don't
1
06/07/2022 4:53 pm
Level 21 : Expert Engineer
surfrock66
surfrock66 avatar
I only saw this now because I guess I'm not getting email notifications?



The NoAI tag will stop leveling up. You need to trade them up BEFORE applying the stillager tag, or, use a "moveager" tag to re-enable their AI, trade them up, and then re-apply the "stillager" nametag.
1
10/30/2021 3:28 pm
Level 1 : New Miner
probablypablito
probablypablito avatar
Would it be possible to only disable Movement AI? I want to use this for villagers inside of an iron farm, which due to being in the spawn chunks causes a long of lag.
1
10/18/2021 9:46 pm
Level 32 : Artisan Princess
Kate1902019
Kate1902019 avatar
Can you make it work with other mobs too?(since I don't want zombies to chase and kill my villagers, I don't want wolves to chase and kill my sheeps, I don't want skeletons to shoot my iron golems that is hard for them to reach and tied to a lead(because that's cheating! BLAME MOJANG!!!!!) & I don't want iron golems to attack Players when they are about to attack the others Players and me)
1
06/07/2022 5:01 pm
Level 21 : Expert Engineer
surfrock66
surfrock66 avatar
It appears I stopped getting notifications for comments and haven't checked until now.

It would be possible to build a datapack like that, but not like this one. The one here looks for entities of type "villager" with the name "stillager" or "moveager" to change the data item "NoAI" to true. You'd be looking for one that is constantly searching for mobs of a type and removing the NoAI tag; there's no way to select just ones chasing villagers and such. At that point, you may as well just disable their spawning, they would spawn and stand there until they burned.
1
10/30/2021 1:50 pm
Level 3 : Apprentice Artist
DjGamer123
DjGamer123 avatar
I don't think that skeletons shooting iron golems is "cheating."

Also, why do you still play Minecraft if you hate Mojang that much?
1
10/18/2021 9:41 pm
Level 32 : Artisan Princess
Kate1902019
Kate1902019 avatar
Thank you. That would be useful because I hated it when they moves around and escaping thinks(houses, villager breeding stations, villager farms, villager houses etc.)
1
09/13/2021 8:51 pm
Level 37 : Artisan Creeper
ThanosSmellsBad
ThanosSmellsBad avatar
LOL

I'll make them still and push them into the lava pit if they annoy me.
1
09/11/2021 9:21 am
Level 1 : New Miner
kershi23
kershi23 avatar
cool
1
08/16/2021 8:53 pm
Level 37 : Artisan Creeper
ThanosSmellsBad
ThanosSmellsBad avatar
LOL
Planet Minecraft

Website

© 2010 - 2022
www.planetminecraft.com

Welcome