This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Jummit's profile picture

What if MC commands would use LUA?

Started by Jummit, 25 September 2017 - 06:38 AM
Jummit #1
Posted 25 September 2017 - 08:38 AM
I always was frustrated when I coded with the MC commands, because they are so difficult to program with. First, they were only commands that were two words long, and then they started to add (BAD) syntax for more complex code.

Would you like the MC command syntax replaced with lua syntax?

Here is a code snippet of how a command would look like:
MC syntax:

time set day
LUA syntax:

time.set(day)
-- day is a variable
time.set(1000)
-- time needs a number


say word
time set 1000
command argument argument […]
would mean

say(word)
time.set(1000)
command.argument(argument)
If the command requires more then one argument it change does that automatically

Why do you like the old syntax/prefer the lua syntax? What would you like to have as MC command syntax?
Edited on 27 September 2017 - 04:51 AM
KingofGamesYami #2
Posted 25 September 2017 - 02:28 PM
Considering you can do


commands.tellraw("@p", {text="Hello!", bold=true})

I feel there is no reason to change the syntax.
Jummit #3
Posted 26 September 2017 - 10:40 AM
Considering you can do


commands.tellraw("@p", {text="Hello!", bold=true})

I feel there is no reason to change the syntax.
This has nothing to do with CC. I had the idea from the command computer, and thought that it would be cool to have this in vanilla.
CLNinja #4
Posted 26 September 2017 - 04:15 PM
Considering you can do


commands.tellraw("@p", {text="Hello!", bold=true})

I feel there is no reason to change the syntax.
This has nothing to do with CC. I had the idea from the command computer, and thought that it would be cool to have this in vanilla.

But why? Commands in almost every game have always been /<command> [args]. Changing it would mean everyone would have to relearn how to do stuff.
Jummit #5
Posted 26 September 2017 - 04:33 PM
-snip-

But why? Commands in almost every game have always been /<command> [args]. Changing it would mean everyone would have to relearn how to do stuff.
Yes, thats true. But really, advanced commands can get very tricky. And maybe you could make some sort of syntactic sugar that works for commands that go like

say word
time set 1000
command argument argument […]
would mean

say(word)
time.set(1000)
command.argument(argument)
If the command requires more then one argument it does that automatically
Edited on 26 September 2017 - 03:36 PM
LDDestroier #6
Posted 05 October 2017 - 11:34 PM
I feel like having a /lua command would be okay. But not a total rework of the minecraft command syntax.