mojira.dev
MCPE-226702

player.applyImpulse causes the player to phase through blocks

Creating a behavior pack such that it applies an impulse using scripts causes the player to phase through

To reproduce:

  1. Create a behavior pack such that it constantly runs the code:

player.applyImpulse({
					x: -0.5,
					y: 0,
					z: 0,
				});
  1. Teleport to around 1000 ~ 1000

  2. Place blocks such that it blocks your direction

  3. Notice that you phase through those blocks

Expected:

You don’t phase through

Note:

The world included is the same world in the video. At around 0 ~ 0, the glitch does not happen, at around 1000 ~ 1100, it does

Attachments

Comments 1

Full code used:

import { world, system } from "@minecraft/server";

world.afterEvents.worldLoad.subscribe(() => {
	system.run(startupRepeat);
});

function startupRepeat() {
	const players = world.getPlayers();
	if (players.length > 0) {
		system.run(startup);
	} else {
		system.run(startupRepeat);
	}
}

function startup() {
	const players = world.getPlayers();

	system.run(start);

	system.runInterval(() => {
		system.run(main);
	});
}

function start() {}

function main() {
	let players = world.getPlayers();
	let overworld = world.getDimension("overworld");

	for (const player of players) {
		let playerLocation = player.location;

		if (playerLocation.y >= -63) {
			let playerLocationBlock = overworld.getBlock(playerLocation);

			if (playerLocationBlock.type.id === "minecraft:trip_wire") {
				player.applyImpulse({
					x: -0.5,
					y: 0,
					z: 0,
				});
			}
		}
	}
}

KYKY5435

(Unassigned)

Unconfirmed

iOS

18.6

1.21.110.26 Preview, 1.21.110.25 Preview, 1.21.110.24 Preview

Retrieved