Skip to main content

Use /function command with code builder functions?

Comments

2 comments

  • Debbie Alexander
    Moderator Beacon of Knowledge Super Star

    Are you asking if you can use a say command to initiate an on_chat command?

    I have done that in the past successfully. If your function initiates with the on_chat command, you just say "test" - 

    Let me know how it's going! We are here to help.

    1
  • Marine Bocquet

    Hi Debbie,

    No, not quite.

    See, the problem is that a lot of block in the code builder allow to detect events, but instead of then allowing us to use MORE blocks to code from those events, they redirect to minecraft commands. And if I wanted to use minecraft commands, I wouldn't be using the code builder in the first place, right?

    So I was looking for a way to bridge that, and I figured if I could call a function, from the event detection block, I could then chain up MORE code builder block without issues. Regardless of what I put in the function (here I put a "Say" block, but I could have put a "Summon" block or a "place" block or whatever.

    Which would allow all player to use a function designed by only one of them. I'm not even sure that could work, I'm experimenting with stuff to see how far I can push things, to design some mini-games with code for our students.

     

    I also tried what you said, with the on_chat:

    I think that's what you meant?

    I do get a reaction out of the code, but it's not the :), it's an error message that says in short:

    "Syntax error, unexpected result at "test"."

    0

Please sign in to leave a comment.