玩家运动
Player Motion 是一个基于爆炸效果的库,它使用子刻计时(subtick timing)来确保只有目标玩家被爆炸推动,且不会产生任何副作用。
感谢 @BigPapi13 制作了本库所借鉴的原始库。本项目旨在取代它。
感谢 Minecraft Commands Discord 中的 nedraw 提供的末影水晶方法论及实现方案,这也是当前版本所基于的基础。
感谢 @SuperSwordTW 帮助进行了重大的数学性能与稳定性改进。
使用方法
向特定方向发射玩家
scoreboard players set $strength player_motion.api.launch 10000
function player_motion:api/launch_looking
$strength代表每刻(tick)的位移量(以方块为单位),缩放系数为 10000。强度为 10000 将以每刻 1 个方块的速度推动玩家- 函数被调用时的朝向方向即为玩家被发射的方向
- 只有执行命令的玩家会收到运动更新
使用 XYZ 向量发射玩家
scoreboard players set $x player_motion.api.launch 500
scoreboard players set $y player_motion.api.launch 12000
scoreboard players set $z player_motion.api.launch -3125
function player_motion:api/launch_xyz
$x、$y和$z分别代表在 X、Y 和 Z 方向上推动玩家的强度(以每刻方块数计)- 与之前一样,只有执行命令的玩家会被发射
注意:这些函数是叠加*的,它们会在现有运动的基础上额外施加运动,而不是直接将运动设置为输入值。
局限性 + 已知问题
尽管这个库可能是我们迄今为止最接近完美操控玩家运动的方案,但仍有一些值得提及的局限性:
- MSPT 不一致性:虽然施加的运动是恒定的,但服务器和客户端的更新速率可能会发生变化,如果每刻都调用运动更新,当这些差异变得过大时可能会导致不一致的结果。为了获得一致的效果,该库仅应用于瞬时爆发式的运动,而持续力应转而依赖骑乘机制或漂浮效果,具体取决于上下文。
如果你知道任何可能的解决方案,或者想帮忙修复这些问题,请告诉我!
Player Motion
Player Motion is an explosion-based library that uses subtick timing to ensure that only one player is pushed by the blast without any side effects.
Credit to @BigPapi13 for making the original library this is inspired by. This project aims to succeed it.
Credit to nedraw from the minecraft commands discord for the ender crystal methodology & implementation this is now based on.
Credit to @SuperSwordTW for helping make significant math performance & stability improvements.
How to use
Launching a player where in a specific direction
scoreboard players set $strength player_motion.api.launch 10000
function player_motion:api/launch_looking
$strengthrepresents motion in blocks/tick, scaled by 10000. A strength of 10000 will push the player at 1 block/tick- The facing direction in which the function is called is the direction the player will be launched
- Only the player executing the command will receive a motion update
Launching a player with xyz vector
scoreboard players set $x player_motion.api.launch 500
scoreboard players set $y player_motion.api.launch 12000
scoreboard players set $z player_motion.api.launch -3125
function player_motion:api/launch_xyz
$x,$y, and$zare the strength in blocks/tick to launch the player in the x, y, and z directions- As before, only the player executing the command will be launched
*Note: These functions are additive and will apply motion in addition to existing motion rather than directly setting it to whatever input you send
Limitations + Known Issues
While this library is likely the closest we've gotten to perfect player motion manipulation, there are some limitations worth mentioning:
- MSPT Inconsistency: Even though the motion applied is constant, the rate at which the server and client update may vary, and calling motion updates per tick may result in inconsistencies when these variations become too large. For consistent results, the library should only be used for instantaneous bursts of motion, and continuous forces should instead rely on riding-based methods or levitation, depending on the context.
If you know any possible solutions or would like to help fixing these problems, please let me know!
下载 Player Motion
下载 Player Motion
下载 Player Motion
下载 Player Motion
下载 Player Motion
下载 Player Motion
下载 Player Motion
下载 Player Motion
下载 Player Motion
在某些时候,Mojang 不再允许这样做。这本来是一个代码检查错误或拼写错误,此次发布是紧急修复。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
数据包
此数据包添加了属于阿瓦里海盗的独特结构,将他们的独特风格带入你的 Minecraft 世界!兼容性:1.20 至 26.3
数据包
一个 Minecraft 光线投射库,能够精确检测玩家正在查看的方块,包括像台阶和楼梯这样的特殊方块形状。
数据包
此数据包添加了新的“祝福模式”难度。
数据包
使用原版/生存友好的方法更改青蛙的变种类型。支持原版(寒冷、温带、温暖)以及可选的“More Frogs 2”变种:深红、末影、地狱、毒镖、紫珀、幽匿、灵魂、诡异和木头。
数据包
手持潜影盒时可直接打开,无需将其放置在地面上。只需按住 Shift 并右键点击即可访问你的潜影盒。
数据包
所有我原创内容的合集。
评论 0
登录后参与评分
还没有评论,来抢沙发吧