-
Bug
-
Resolution: Fixed
-
1.18.20.27 Beta, 1.18.12 Hotfix, 1.19.21 Hotfix
-
None
-
Confirmed
-
Windows
-
883291
When I was using a script that used player.velocity in its code I've found that it behaves unexpected in Powder Snow. I analyzed the issue and have found that player.velocity values didn't get updated. I've originally found the issue in beta 1.18.20.27 and also tried it in 1.18.12.2, both version had the same problem.
Expected Result:
Changes in movement in Powder Snow get reflected in the property velocity and are updated correctly.
Actual Result:
When the player is moving in Powder Snow, velocity property of Player class doesn't get updated and stays at x=0,y=0.0784,z=0.
Steps to Reproduce:
1. Load a world with such GameTest script running:
import {world} from "mojang-minecraft"; world.events.tick.subscribe(eventData => tickEvent(eventData)); function tickEvent(eventData) { if (eventData.currentTick % 20 === 0) { const players = world.getPlayers(); for (const player of players) { player.runCommand(`say X: ${player.velocity.x}`); player.runCommand(`say Y: ${player.velocity.y}`); player.runCommand(`say Z: ${player.velocity.z}`); } } }
2. Move with the player in Powder Snow and see the returned values in the chat.
Notes:
This wasn't tested on the Entity class but it might be an issue there as well.