I'm attempting to get my head around the minecraft "Gamerule global variables" (e.g. custom game rules which you can use to store a value) but there seems to be very little useful info about them available.
/gamerule TestVar 10 creates a new variable.
I would like to be able to use this in another command, such as a fill command, e.g. something along the lines of:
/fill ~ ~1 ~ ~ ~[TestVar] ~ minecraft:stone 0 keep
(This command would create a stone tower on top of the command block with a height equal to the TestVar. In the case above, it would be 10 high)
Is there any way to use a variable like this inside a command?
Update: I am open to using scoreboards, objectives, stats or anything else in vanilla minecraft. I'd just like to be able to insert a variable value into a static command.