Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-152715

[GameTest] Movement in Powder Snow isn't recognised by player.velocity

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.19.50.23 Preview, 1.19.50
    • 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.

            PavelDobCZ23 PavelDobCZ23
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: