根据体型差异增加生物碰撞伤害。
更新内容:
- 玩家首次生成时将获得一个随机体型。
- 添加了可选开关,用于启用或禁用碰撞逻辑和随机体型功能。默认情况下两者均处于开启状态。
- 可在配置文件中自定义每个随机选择的体型大小。
我仅在 1.20.1 版本配合 Pehkui 3.8.2 进行了测试,但理论上它应该也能在其他版本上正常运行。
碰撞逻辑的工作原理:
剧透
-
首先检查较大的生物是否正在向较小的生物移动。
-
然后计算两个发生碰撞的生物之间的体型缩放比例差异。
-
接着检查较大生物的体型是否至少是较小生物的 4 倍。
-
然后检查较大生物的体型是否小于较小生物的 100 倍。
-
随后在差异值中加入随机波动。
-
加入波动后,检查较大生物的状态是行走、疾跑、潜行还是下落,并根据不同状态应用不同的乘数。
-
最后,在将差异值作为伤害施加给较小生物之前,检查配置文件是否允许较小生物因此死亡。
您可以将此模组放入任何您想要的地方,无论是整合包还是您自己的模组中,只需确保人们能够找到您的名字或模组页面即可。您不得编辑我的代码并上传为原创作品。这意味着您可以在私下编辑和使用它,但未经我许可请勿上传。
Adds mob collision damage based on size differences.
Update:
- Players are now given a random size on first spawn.
- Optional toggle to turn on and off both the collision logic and random size. Both are on by default.
- Can coustomize each randomly picked size in config file.
I've only tested it on 1.20.1 with pehkui 3.8.2, but it should work on other versions.
How the collision logic works:
Spoiler
-
First it checks if the bigger mob is moving into the smaller mob.
-
Then it finds the scale difference between the two coliding mobs.
-
Then it checks if the bigger one is at least 4x the scale.
-
Then it checks if the bigger mob is less than 100x the scale.
-
Then it adds random variance to the difference.
-
After adding varience it checks if the bigger mob was either walking, sprinting, crouching, or falling, adding different multipliers off that.
-
Finally it checks if config allows the smaller mob to die before applying the difference as damage to the smaller mob.
You may put my mod in whatever you want, whether it's a modpack, or your own mod, just make sure people are able to either find my name or the mod page. You can not edit my code and upload it as your own, this means you can edit, and use it privately, just dont upload it without my permission.
评论 0
登录后参与评分
还没有评论,来抢沙发吧