mojira.dev
MCPE-190967

Sometimes teleporting player produces slightly added movements or counters knockback

In recant updates I noticed teleporting has gotten really janky. Sometimes, or on a laggy server, teleport a player who then move slightly afterwards to quickly stop make a slight added movement in the direction they were going.

Another is using applyKnockback() right after a teleport. Where sometimes, or again on a laggy server, it counters the knockback.

I created a simple script to help demonstrate the issue.

import { world } from "@minecraft/server"

world.afterEvents.itemUse.subscribe(({ itemStack, source }) => {
    switch (itemStack.typeId) {
        case "minecraft:stick":
            source.applyKnockback(source.getViewDirection().x, source.getViewDirection().z, 4, 0)
            break
        case "minecraft:blaze_rod":
            source.teleport({ x: source.location.x, y: source.location.y + 3, z: source.location.z })
            source.applyKnockback(source.getViewDirection().x, source.getViewDirection().z, 4, 0)
            break
        case "minecraft:breeze_rod":
            source.teleport({ x: source.location.x, y: source.location.y, z: source.location.z })
            break
    }
})

The stick applies knockback on the player who uses it. The blaze rod teleports the player 3 blocks up, then applies knockback in the players view direction. The breeze rod only teleports to the same position. In the clip I used the tp command but this has the same effect.

This wasn’t an issue in previous major updates as I’ve been using applyKnockback() to keep the players velocity after a teleporting.

Attachments

Comments 1

why hasnt this been fixed yet?

Protoplosion

(Unassigned)

Unconfirmed

Windows

Windows 10

1.21.62 Hotfix

Retrieved