I think functions need to support parameters. Function behavior should depend on the input, this is pretty much the definition of a function.
Lets say one made a function that creates a circle. Then he could pass radius as a parameter, so he can create different sized circles.
Suggested behavior:
Single line in .mcfunction file that goes at the top. Suggested syntax:
#parameters: <param1:type> <param2:type> <param3:type>
And access parameters with $, use $$ to get plain $.
Like this:
#parameters <entity:target> <x:int> <y:int>
kill $entity
fill ~-$x ~ ~-$y ~+$x ~ ~+$y stone
say $$ I like money $$
And such function could then be called like this: /function testfunc @e[type=pig] 10 5
Implementation would be as easy as just replacing text, and spitting errors if there are any.
Please sign in to leave a comment.
3 Comments