fix(lobby_transfer): replace removed @minecraft/server-admin transferPlayer with stable Player.transfer
All checks were successful
Deploy Addons / deploy (push) Successful in 15s

Bedrock 1.26 rejects the @minecraft/server-admin 1.0.0-beta dependency at
pack load, which was crashing mc-lobby on boot (exit 1 right after pack
stack + block-version logging). The transferPlayer helper has been part of
the stable @minecraft/server API as Player.transfer since 1.21, so we can
drop the server-admin import and dependency entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-23 23:36:16 +01:00
parent db8f37a24d
commit 81f84b56a0
2 changed files with 3 additions and 7 deletions

View File

@@ -26,10 +26,6 @@
"module_name": "@minecraft/server",
"version": "1.17.0"
},
{
"module_name": "@minecraft/server-admin",
"version": "1.0.0-beta"
},
{
"uuid": "b2c3d4e5-1111-2222-3333-fedcba654321",
"version": [1, 0, 0]

View File

@@ -1,5 +1,4 @@
import { world, system } from "@minecraft/server";
import { transferPlayer } from "@minecraft/server-admin";
// Portal block → transfer target mapping (custom blocks — priority detection)
const PORTAL_BLOCKS = {
@@ -93,10 +92,11 @@ system.runInterval(() => {
safePos.z += 4; // Move 4 blocks away from portals (portals are at z=-24)
player.teleport(safePos);
// Wait 5 ticks for position to save, then transfer
// Wait 5 ticks for position to save, then transfer.
// Player.transfer replaces the removed @minecraft/server-admin `transferPlayer`.
system.runTimeout(() => {
try {
transferPlayer(player, { hostname: portal.host, port: portal.port });
player.transfer({ hostname: portal.host, port: portal.port });
} catch (e) {
player.sendMessage(`§cTransfer failed: ${e.message}`);
}