• check_circle Advancements
  • check_circle Functions
  • 2,941 views, 67 today
  • 165 downloads, 6 today
  • 9
  • 10
  • 7
surfrock66 avatar surfrock66
Level 13 : Journeyman Engineer
1
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.
CreditVanillaTweaks
CompatibilityMinecraft 1.14
toMinecraft 1.18 Snapshot
Tags

1 Update Logs

Stillagers.v1.0.1 : 10/18/2021 6:08:45 pmOct 18th

Realized I didn't include enough restocks, there's cases where 2 late trades weren't restocking, that's fixed.

Create an account or sign in to comment.

1
10/18/2021 9:46 pm
Level 27 : Expert 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
10/18/2021 9:41 pm
Level 27 : Expert 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 31 : 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 31 : Artisan Creeper
ThanosSmellsBad
ThanosSmellsBad avatar
LOL
1
08/14/2021 7:36 pm
Level 9 : Apprentice Strawberry
Jay_playz2019
Jay_playz2019 avatar
Simple, but effective. I love this! mind if i use it on an SMP? it will probably be recorded. (don't worry, you will get credit still), just asking to make sure.
1
08/14/2021 11:54 pm
Level 13 : Journeyman Engineer
surfrock66
surfrock66 avatar
Yea for sure, go nuts! It was game-changing on my server.
Planet Minecraft

Website

© 2010 - 2021
www.planetminecraft.com

Welcome