Skip to main content

How to run code with NPC interaction button



  • Ryan Barrett


  • Hi Marcin Kowalski,

    You could use something like this:

    Hope it helps!

  • Ryan Barrett

    Hi Cathy, that is not what Marcin is looking for. That's the opposite. Currently it is not possible to execute MakeCode code via commands. There is only the "on message" event, and that is listening for the player to send a message. Marcin is looking for a way to execute agent code with a command block or npc. 

  • Moderator Beacon of Knowledge Super Star

    I tried creating an event handler - waiting for a chat command. The NPC can say the command, but it is said BY the NPC, not by the player, so nothing happens. 

    I don't see an event handler for anything an NPC does. I think NPCs can only run direct commands from the chat window. I think Ryan Barrett has it right.



Please sign in to leave a comment.