Player Motion is an enchantment effect-based library that triggers apply_impulse with a swap into spectator mode using the saddle slot with no side effects.
Credit to @BigPapi13 for making the original library this is inspired by. This project aims to succeed it.
Credit to nedraw from MCC for the ender crystal methodology & implementation this used to use.
Credit to @SuperSwordTW for helping make significant math performance & stability improvements in the previous implementation.
Credit to 1000hrcelebration & mastershroob from MCC for the method & implementation of converting a desired global vector into a local vector.
^ ^ ^)# Left/Right
scoreboard players set $x player_motion.api.launch 500
# Above/Below
scoreboard players set $y player_motion.api.launch 12000
# Forward/Backward
scoreboard players set $z player_motion.api.launch -3125
function player_motion:api/launch_local_xyz
$x, $y, and $z are the strength in blocks/tick to launch the player in the local directions. A $z of 10000 will push the player forward at 1 block/tick~ ~ ~)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_global_xyz
$x, $y, and $z are the strength in blocks/tick to launch the player in the x, y, and z directionsMotion nbt directlyat the player*Notes:
scoreboard players set $strength player_motion.api.launch 10000
function player_motion:api/launch_looking
$strength represents motion in approximate blocks/tick, scaled by 10000. A strength of 10000 will push the player at about 1 block/tickscoreboard 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 $z are the strength in approximate blocks/tick to launch the player in the x, y, and z directions*Notes:
While this library is likely the closest we've gotten to perfect player motion manipulation, there are some limitations worth mentioning:
apply_impulse update to the library, comes incompatibility with Realms. This is due to data-driven enchantments being an "experimental" feature even though there is nothing actually experimental about them.If you know any possible solutions or would like to help fixing these problems, please let me know!