fix(lobby_transfer): restore transferPlayer beta API (Player.transfer does not exist in BDS 1.26)
All checks were successful
Deploy Addons / deploy (push) Successful in 15s

Commit 81f84b5 misdiagnosed the mc-lobby crash loop and stripped the
@minecraft/server-admin@1.0.0-beta dependency, swapping in
player.transfer({hostname,port}). At runtime that throws
"player.transfer is not a function" the first time anyone steps on a
portal — the stable @minecraft/server API never exposed transfer() on
Player in BDS 1.26.14.

The real root cause of the original crash loop was unrelated: the
mc-lobby Docker volume had lost its vanilla behavior-pack collection
(vanilla_*, chemistry*, editor, server_library, …). Copying those back
from a healthy sibling volume fixed the boot crash; nothing in the
lobby_transfer pack needed to change. Restoring the beta transferPlayer
here brings lobby back in line with hub-return-addon, which has always
used this pattern successfully on jamie/lyla/mya.

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

View File

@@ -26,6 +26,10 @@
"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,4 +1,5 @@
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 +94,10 @@ system.runInterval(() => {
player.teleport(safePos);
// Wait 5 ticks for position to save, then transfer.
// Player.transfer replaces the removed @minecraft/server-admin `transferPlayer`.
// transferPlayer from @minecraft/server-admin beta API — requires gametest experiment + permissions.json allows server-admin.
system.runTimeout(() => {
try {
player.transfer({ hostname: portal.host, port: portal.port });
transferPlayer(player, portal.host, portal.port);
} catch (e) {
player.sendMessage(`§cTransfer failed: ${e.message}`);
}