Support for text replacement in a similar manner to C language #define's would be nice to have for repetitive commands or portions of commands.
For example, if you frequently use a command like execute as @a[scores={example_obj=1..},nbt= etc., then you could define a replacement and reuse that instead. In addition to making long lines shorter, it would also make it easier to change one part of the command. Instead of trying to change it everywhere, making it possible to accidentally miss a line and create a bug, you only have to change one line at the top of your file.
The syntax could look something like this:
:def LONG_EXECUTE execute as @a[scores={custom_item_obj=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{custom_item:1b}}}] at @s
:func custom_item_stuff
LONG_EXECUTE run summon minecraft:lightning_bolt
:endfunc
The code for while loops is already effectively a preprocessor, so that code could be reused or reformatted to include finding text replacement definitions.
Support for text replacement in a similar manner to C language
#define
's would be nice to have for repetitive commands or portions of commands. For example, if you frequently use a command likeexecute as @a[scores={example_obj=1..},nbt=
etc., then you could define a replacement and reuse that instead. In addition to making long lines shorter, it would also make it easier to change one part of the command. Instead of trying to change it everywhere, making it possible to accidentally miss a line and create a bug, you only have to change one line at the top of your file.The syntax could look something like this:
The code for while loops is already effectively a preprocessor, so that code could be reused or reformatted to include finding text replacement definitions.