Which programming language is the Minceraft command system based off?
It's custom
It's actually quite interesting to look at this language in a programming sense.
Minecraft's commands by themselves are limited to a small set of built-in functions (the commands) with positional arguments, which may or may not be optional or overloaded (e.g. the second argument for /tp
) depending on which function it is. Without command blocks, a program is only a single function call.
Now, command blocks, especially in 1.9, add some functionality to the system. Impulse/Chain represents several functions executed in a row, where the conditional setting can cause the program to skip function calls depending on the result of previous function calls. Repeat/Chain command block lines represent infinite loops (while True {do something}
).
So far, we have a very basic language with basic control elements. However, so far, we have not taken the game world into account, which can be read from and written to by commands, making it Minecraft's equivalent of system memory. And it does a horrifyingly bad job at that.
There is a three-dimensional memory called blocks, which is bounded in one dimension, and unbounded in the other. However, not the entire range of positions in the latter two is made accessible by the runtime environment (Minecraft) at all times (due to chunk unloading). This block memory stores a "number" from a very very strange list (block id, potentially block state and potentially tile entity data).
And there is another type of memory storage called entities, which comes with three-dimensional floating point coordinates, and a couple of other predetermined parameters that can be accessed by some of our functions. Some of these parameters are changed by the runtime environment in a way that is largely out of our control.
To make things even worse, our programs have to be written directly into the blocks memory, and the position of your functions determines their execution order, somewhat akin to Befunge. Parts of your program stored in inaccessible sections of block memory simply don't execute at all.
Granted, most programs access only a very limited subset of this system memory. But the fact remains that this system memory exists, and can be used at least theoretically, and that's unlike every programming language I've come across so far.