mojira.dev
MCPE-151698

GameTest API: Player.setVelocity Does not work.

Player.setVelocity Does not work.

 

Steps to Reproduce:

1. Describe the following JavaScript code:

import { world, Vector } from "mojang-minecraft";

world.events.itemUse.subscribe(ev => {
    const vector = new Vector(0, 1, 0);
    const entities = ev.source.dimension.getEntities();
    for(const entity of entities) {
        entity.dimension.runCommand("say " + entity.id);
        entity.setVelocity(vector);
    }
});

2. Use any item to ignite events.

 

Observed Results:

All entities except players in the same dimension as the player using the item jumps upward.

 

Expected Results:

All entities, including players in the same dimension as the player using the item, jump to the upward.

Attachments

Comments 3

Is this still an issue in the latest version?

Yes, this issue also exists in the latest version.

setVelocity function does not apply to custom entity either

Lapis256

(Unassigned)

868675

Confirmed

Multiple

Android 12

GameTest

1.19.10.23 Preview, 1.19.10.22 Preview, 1.19.0.33 Preview, 1.19.0.32 Beta, 1.18.33 Hotfix, ..., 1.18.10.27 Beta, 1.18.10, 1.18.12 Hotfix, 1.18.31, 1.19.0

Retrieved