Discuss Minecraft's scripting and modding capabilities, including APIs, tools, customization, automation, and creator workflows. Share ideas and feedback on how players and creators can extend and customize Minecraft.

30

Function Parameters, Output and more.

3 Comments

Post a new comment:

Please sign in to leave a comment.

Sorted by oldest
  • 2
    Registered User commented
    Comment actions Permalink

    The post is 1 year old and only few people voted, this should be implemented it's very useful. I agree with you

  • 0
    Registered User commented
    Comment actions Permalink

    You could just use scoreboard values and then execute the function.

  • 1
    Registered User commented
    Comment actions Permalink

    I think that the parameters should be headed at the top of the mcfunction like this with some character like $ starting the line to differentiate them from commands:

    $exampleA, exampleB

    And then after this, parameter names can be accessed like so in commands:

    say $exampleA$exampleB

    Then the game replaces all instances of $exampleA with whatever you passed in while calling the function:

    function myexample:function foo bar

    (says foobar)

    Obviously, this is a contrived example (you could use tellraw here), but in many cases this would be amazing to have.