Closed JBartelsson closed 8 years ago
I do like this; I would call it "variables" though, not "constants", and I think I would use a new line prefix to define vars, any line starting with $
would be expected to be a variable definition. Then anytime that variable is found in any other line it would be replaced.
$message=This is a message
{"type":"repeat","auto":true}
/say $message
I won't worry about data types. I'll treat everything as a string. It will be up to the user to specify it correctly.
I won't try to get this in to version 1.0.0 - maybe 1.1.0 or later.
This has been completed with #42
Hi, I thought about constants in the .mcc file that smelt uses to compile the command.
Defining a constant via const then follows the name of the constant Value and then the value of the constant something like 20 or Hello
(Note: I dont know how smelt compiles data types but if necessary you need to give the constant a different data type. Example: /say XXX needs a string {NoAI:1b} needs a byte {Damage:25s} needs a short and so on)
So maybe add data type abbreviation after const CONSTANT VALUE
Thanks for reading, Skaran