- check_circle Advancements
- check_circle Functions
- 12,745 views, 22 today
- 621 downloads, 1 today
2
I created a datapack which helps with villager lag in trading halls.
Previous versions for different minecraft versions are available here: www.teh3l3m3nts.com/stillagers-datapack/
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.
-- UPDATE 2023.06.08 -- Updated the "pack format" tag marking it as compatible with 1.20 and 1.20.1, fully tested and working.
-- UPDATE 2023.12.25 -- Updated the "pack format" tag marking it as compatible with 1.20.2, fully tested and working
-- UPDATE 2023.12.25 -- Updated the "pack format" tag marking it as compatible with 1.20.3 and 1.20.4, fully tested and working
-- UPDATE 2024.04.23 -- Updated the "pack format" tag marking it as compatible with 1.20.4, fully tested and working
Previous versions for different minecraft versions are available here: www.teh3l3m3nts.com/stillagers-datapack/
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.
-- UPDATE 2023.06.08 -- Updated the "pack format" tag marking it as compatible with 1.20 and 1.20.1, fully tested and working.
-- UPDATE 2023.12.25 -- Updated the "pack format" tag marking it as compatible with 1.20.2, fully tested and working
-- UPDATE 2023.12.25 -- Updated the "pack format" tag marking it as compatible with 1.20.3 and 1.20.4, fully tested and working
-- UPDATE 2024.04.23 -- Updated the "pack format" tag marking it as compatible with 1.20.4, fully tested and working
Credit | VanillaTweaks |
Compatibility | Minecraft 1.14 |
to | Minecraft 1.20 |
Tags |
8 Update Logs
Stillagers.v1.0.8 : by surfrock66 04/23/2024 9:10:26 pmApr 23rd
Updated version for 1.20.5
LOAD MORE LOGS
tools/tracking
5258196
119
stillagers
Create an account or sign in to comment.
I'm on 1.19.2 fabric, and with many mods, including performance ones. I have about 60 - 80 villagers in my hall in minecarts. Minihud says I have ~900 entities in my base, which I presume are chests*, item frames, banners, etc. I have Enhanced Block entities running, so the chests shouldn't be causing lag.
I've got basically maxed out Ryzen 9's for client and server, so I can't add more hardware to the problem.
Aside from adding more performance mods, I can't find any advice on how to reduce MSPT besides remove entities. Given the hardware that I have, I suspect there's something I'm missing though.
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.
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.
Also, why do you still play Minecraft if you hate Mojang that much?
I'll make them still and push them into the lava pit if they annoy me.