Same issue as MCPE-241098, reproduced on Bedrock Dedicated Server. Filing separately as BDS is tracked independently.
When a SimulatedPlayer is spawned via spawnSimulatedPlayer() from @minecraft/server-gametest, behavior packs using stable (non-beta) @minecraft/server versions receive event.player = undefined in playerSpawn handlers and in per-tick world.getAllPlayers() / dimension.getEntities() results. The SimulatedPlayer is fully valid in the spawning addon's beta-API context but is not marshaled to stable-API addons.
Steps to Reproduce
Same as MCPE-241098, performed on BDS instead of a local client world.
Install two behavior packs on a BDS world:
Pack A:
@minecraft/server2.9.0-beta +@minecraft/server-gametest1.0.0-beta, spawns a SimulatedPlayerPack B:
@minecraft/server2.3.0 (stable), subscribes toplayerSpawnand accessesevent.player.id
Enable Beta APIs experiment.
Start the server, join as a real player — both packs handle the event correctly.
Trigger Pack A to call
spawnSimulatedPlayer().
Expected Result
Pack B receives event.player as a valid Player object.
Actual Result
Pack B receives event.player = undefined. Throws TypeError: Cannot read property 'id' of undefined. Ongoing per-tick crashes from getAllPlayers() / getEntities() returning undefined entries for the SimulatedPlayer.
Identical to the local-client behavior reported in [MCPE-XXXXXX].
Impact
SimulatedPlayers are commonly used for chunk-loading and spawn-anchoring on dedicated servers. This bug makes them incompatible with the majority of published behavior packs that use stable API versions, severely limiting their usefulness in modded server environments.
Suggested Fix
Same as MCPE-241098: downcast SimulatedPlayer to Player when delivering to stable-API contexts.
Environment
BDS 1.26.33.2, Pack A: @minecraft/server 2.9.0-beta, @minecraft/server-gametest 1.0.0-beta, Pack B: @minecraft/server 2.3.0 (stable), Beta APIs experiment enabled
Hi!
Thank you for your report!
We're already tracking this issue at MCPE-241098, so I will resolve and link this ticket as a Duplicate.
I suggest also to browse through the main issue for potential fixes.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki