player's DeltaMovement has changed but will not work.
YumisLink opened this issue ยท 3 comments
Minecraft Version
1.20.1
KubeJS Version
kubejs-forge-2001.6.4-build.138
Rhino Version
rhino-forge-2001.2.2-build.18
Architectury Version
architectury-9.2.14-forge
Forge/Fabric Version
forge47.2.32
Describe your issue
i use this code and i can found that delta movement was changed but player has no any speed change.
but in the same code to other entity who isnot player ,the entity will change it's speed.
player.tell(player.getDeltaMovement());
player.setDeltaMovement(player.getDeltaMovement().multiply(2,5,2))
player.tell(player.getDeltaMovement());
Crash report/logs
No response
Player delta movement is controlled entirely client side, whilst other entities use server side.
If you wish to force particular motion onto the player you need to make sure to to do player.markHurt()
to force the movement to sync.
However if all you are after is a movement speed multiplier/addition you can use the helper methods provided by KubeJS to add attribute modifiers.
player.setMovementSpeedAddition(2)
, player.setTotalMovementSpeedMultplier(2)
, player.setDefaultMovementSpeedMultiplier(2)
. The difference between total an default multipliers is that total is applied on top of existing effects like speed, whereas default is just a set percent of the default speed of the player.