我制作了一个数据包,用于缓解交易大厅中的村民卡顿问题。
如果你用命名牌将村民命名为“Stillager”或“stillager”,他们将完全停止移动和寻路行为。这是通过将村民的“NoAI”标签设置为 1 来实现的。这通常会导致刷新交易,因此我在上午 8:00 和下午 2:00 设置了一个函数来手动刷新所有交易。这与原版行为基本一致:村民每天会刷新两次交易,时间略有随机性;但一天中的四个阶段(工作、收集、游荡和睡眠)可以划分为四个时间段,这就是设定刷新时间的逻辑依据。
如果你想禁用此效果,只需给村民打上“Moveager”或“moveager”的命名牌即可,名称将会消失,其 AI 也会恢复正常。
这在村民被锁定在 1×1 空间内的交易大厅中特别有用。在我测试的世界中,我有一个大约包含 ~150 名村民的交易大厅,启用后 TPS 从 15 提升到 20,MSPT 从约 65 降低到约 50,FPS 从 ~30 提升到 ~60(我已将其上限设为此值)。这种大幅减少卡顿的效果无需使用双层地毯等技巧,且完全是可选的:刷怪笼中的村民或自然生成的村民完全不受影响——即按需启用(opt-in)。
仅受影响的生物是村民。如果你将其他生物命名为 "Stillager" 或 "Moveager",它们将不会受到任何影响。
特别感谢 VanillaTweaks 团队;本数据包是使用他们的 “SilenceMe” 和 “Track Raw Statistics” 数据包作为模板制作的。
这是我的第一个数据包,欢迎提供反馈。
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.
下载 Stillagers
下载 Stillagers
下载 Stillagers
下载 Stillagers
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Stillagers
下载 Stillagers
下载 Stillagers
下载 Stillagers
下载 Stillagers
下载 Stillagers
已更新至 26.3,同时保持向后兼容性
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
数据包
此数据包添加了属于阿瓦里海盗的独特结构,将他们的独特风格带入你的 Minecraft 世界!兼容性:1.20 至 26.3
数据包
一个 Minecraft 光线投射库,能够精确检测玩家正在查看的方块,包括像台阶和楼梯这样的特殊方块形状。
数据包
此数据包添加了新的“祝福模式”难度。
数据包
添加了基于官方概念图的蓝蛙和红眼树蛙变体。
数据包
为模组生物群系添加原版回溯特性!
数据包
允许服务器管理员方便地禁用 Xaero's Map 系列模组中的实体雷达、小地图等功能,使竞技游戏更加公平。
评论 0
登录后参与评分
还没有评论,来抢沙发吧