From 84171cfc94c048807520c426cf9a4af05aaf289f Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Thu, 22 Oct 2026 15:19:17 +0200 Subject: [PATCH] lan_e2e portals: wait for the guest to be placed in its Nether portal On a server the guest is held where it entered the Nether until the chunks around the destination are lit, then placed in its portal. The check read the guest's position 40 ticks after the dimension changed, which on a busy machine was still the held spot, and then stepped the guest out of a portal that wasn't there. Co-Authored-By: Claude Opus 5.5 --- tools/lan_e2e.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/lan_e2e.py b/tools/lan_e2e.py index 304668322..e781cdea6 100755 --- a/tools/lan_e2e.py +++ b/tools/lan_e2e.py @@ -496,12 +496,17 @@ def portals(host, guest, out, x, y, z, hx, hy, hz): guest('command', command=f'tp @s {x + 0.5} {y} {z + 3.5}') # players_nether_portal_default_delay: 80 ticks in survival. there = wait_dimension(guest, 'minecraft:the_nether', 600) - guest.wait(40) + # On a server the guest is held where it entered until the chunks around the destination are + # lit, then placed in its portal: wait for that before reading where it arrived. + for _ in range(30): + guest.wait(20) + arrived = [int(v // 1) for v in pos_of(guest)] + if guest.raw('block', *arrived).get('block') == 'minecraft:nether_portal': + break guest.shot(out, 'portals-nether') host_dim = host('state').get('dimension') assert there.get('dimension') == 'minecraft:the_nether', f'the guest is in {there.get("dimension")}' assert host_dim == 'minecraft:overworld', f'the host went to {host_dim} with the guest' - arrived = [int(v // 1) for v in pos_of(guest)] below = guest.raw('block', arrived[0], arrived[1] - 1, arrived[2]) assert below.get('loaded') and below.get('block') != 'minecraft:air', f'under the guest in the Nether: {below}' # The host takes an End portal while the guest is in the Nether: three levels at once.