-
Bug
-
Resolution: Works As Intended
-
None
-
1.20.81 (Bedrock)
-
Unconfirmed
-
Bedrock
-
1251113
Explination
When getting
block.loaction or
entity.location
In the context of a Realm, the resulting Vector3 has its X and Z values flipped.
Meaning; When one calls for a block's location that is at "x: 15 y: 6 z: -75", the script will return "x: -75 y: 6 z: 15" instead of "x: 15 y: 6 z: -75"
8mb.video-5tl-6NKOO6E5.mp4demonstrates this bug as it is on a Realm VS a self-hosted world
With the demonstration, are linked photos of the pack's manifest.json and the script's index.js
Showing the bug is accuring within the 1.10.0-Stable Version of the Scriting API
"dependencies": [{ "module_name": "@minecraft/server", "version": "1.10.0" },{ "module_name": "@minecraft/server-ui", "version": "1.1.0" }]
import { world } from '@minecraft/server'; world.afterEvents.buttonPush.subscribe(({ source, block }) => { world.sendMessage('§eButton V3Pos:§7 ' + Object.values(block.location).map(v => v.toFixed(2)).join(' ')); world.sendMessage('§6Player V3Pos:§7 ' + Object.values(source.location).map(v => v.toFixed(2)).join(' '));});
Reproduction
To reprodude this bug on your own, download the TEST.mcpackpack which is attached below, containing the exact same code as in the screenshots.
Then activate the pack on a Minecraft Bedrock Edition Realm and simply press a button.
It should send in the game chat, the coordinates of the button pressed and the player who pressed it and with that you will be able to deduce your self that the X and Z values of the actual coordinates have been switched.
Yet repeat the same experiment on a normal world, you will obtain the expected value in your game chat, where X stays at the X position and Z at Z's.