microsoft / microsoft/pxt

Minecraft function works only in singleplayer (player.onTellCommand)

Open
#10,288 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
641
Avg merge
12h 4m
Merged PRs (30d)
57

Description

Describe the bug
The Minecraft function player.onTellCommand does not work in multiplayer. The event will only trigger for the hosting player.

Image

To Reproduce
Steps to reproduce the behavior:

  1. Run this program in Minecraft:
player.onTellCommand("ping", function () {
    player.say("pong")
})
  1. Whisper "ping" to yourself. /w @s ping
  2. If you are the player hosting the game, the event will trigger and respond with "pong" in the chat.
  3. If you are not the hosting player, the event will not trigger and nothing will happen.

Expected behavior
The onTellCommand event should work correctly for all players in a multiplayer game.

Additional context
This bug has existed for a long time. Previously reported and reproduced here. Seeing this resolved would mean a lot to me personally.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the implementation and event routing for player.onTellCommand in the TypeScript codebase, then reproduce the issue with both the hosting player and another multiplayer player using the steps above. Trace why only the host receives the event and verify that whispering "ping" makes both players respond with "pong" when the fix is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.