I want to make a plugin to have variables in game that are a little more functional than the scoreboard system. I have a basic idea of how to implemented & code this. I just made this post to know first if it's worth taking the time to make(if people can find a use for such things), and second if people can help refine the idea down & make it less programmy syntax
I don't program with java myself, but I always wished that there was something like this THAT you could use with normal mc commands, such as using the var in tellraw text, coord positions etc. I have no idea how complicated it is to create something that can work along side with normal commands, but to be honest if It didn't, I don't see how much better this would be then the scoreboard system.
Also maybe most/all the commands could be merged into /var e.g
/var create int cheese = 29053
/var set cheese = 2052
It would basically be impossible to add the variables to vanilla commands, but I could add a command such as cmd_var which would be used like this.
# With the way I currently would set this up this plugin it would work like this.
/make_var int potato = 53
/cmd_var /summon zombie 30 %potato% 230
# Makes a command running variable
/make_var cmd test = /testfor @s
/make_var str itemName = "The Sword of"
# Will add the output of cmd to itemName
/var itemName += cmd
# itemName currently looks like "The Sword of Found PlayerName"
# we want to remove Found & one of the spaces so
/var itemName -= " Found"
# Than we run the command with the variable
/cmd_var /give @s wooden_sword{display:{Name:%itemName%}}
Now for your second suggestion that would be vary easy to implement plus I feel it looks better than 20 commands, so I'll add an updated syntax spoiler to first post when I get a chance.
I don't program with java myself, but I always wished that there was something like this THAT you could use with normal mc commands, such as using the var in tellraw text, coord positions etc. I have no idea how complicated it is to create something that can work along side with normal commands, but to be honest if It didn't, I don't see how much better this would be then the scoreboard system.
Good idea though!
That's what cmd_var would be
let's say you want to summon an entity that's dependent on a variable, here's how you would go about that.
# Would make a variable named entity.
make_var str entity
make_var int type = 0
if type == 0 than /var entity = "cow"
if type == 1 than /var entity = "bat"
if type == 2 than /var entity = "sheep"
/cmd_var summon %entity%
I want to make a plugin to have variables in game that are a little more functional than the scoreboard system. I have a basic idea of how to implemented & code this. I just made this post to know first if it's worth taking the time to make(if people can find a use for such things), and second if people can help refine the idea down & make it less programmy syntax
New Commands:
~ make a variable.
/var create
~ change variable.
/var modify (=, +=, -=, *=, /=, ++, --)
~ store variable in file.
/var storage [get, send]
~ If something that run a command with variables.
/var if (==, >, <, !=, >=, <=) (and, run) [command]
~ Run a command with variables.
/var run [command] - Runs a command with variables
Old Commands:
/make_var <int, str, float, cmd> <name> = [command]
/var <var> <=,-=,+=,*=,/=,++,--> <var>
/if (<var> <==,>,<,>=,<=,!=> <var> [and, or]) than [command] # Left Right Notation
/cmd_var [command] - %variable% what's inside gets ran
/store_var <var-name> - stores variable on file
/get_var <var-name> - gets a variable from file
Usage:
____________________________________________________________
#### Setup function ####
# Note all variable type will go into each other, but the filter changes based on variable type.
# Makes a str variable by the name of Max
make_var str Max = 13000
# Makes a int variable by the name of Min
make_var int Min = 0
# This will output “Time is XXXX” whenever called
make_var cmd c = time query daytime
# Sense A is an integer the plugin will set the first sting of them found left to right.
# Like- fake command output 1234 & 234 - A would be set to 1234 nothing else.
make_var int A = c
____________________________________________________________
#### Looping function ####
# Note that all variables are global & will work between functions
# If variable Rule doesn’t exist than run function to make all variables
if Rule == null than function func:setup-function
# Sets the output of c to A every time this function is called
var A = c;
# If A is greater compared to Max than run cmd_var time set %Min%
# cmd_var time set %Min% will take the variable Min and replace %Min% with the value
# This will run “/time set 0”
if A >= Max than cmd_var time set %Min%
____________________________________________________________
That was just an example of what it could do, I'm looking for more examples of why it would be useful to have & people who need something like this.
Thank you for reading!
I don't program with java myself, but I always wished that there was something like this THAT you could use with normal mc commands, such as using the var in tellraw text, coord positions etc. I have no idea how complicated it is to create something that can work along side with normal commands, but to be honest if It didn't, I don't see how much better this would be then the scoreboard system.
Good idea though!
A suggestion for an addition to this could be variables could be used as a command argument and selectors could be used when declaring strings e.g.
Also maybe most/all the commands could be merged into /var e.g
/var create int cheese = 29053
/var set cheese = 2052
But yeah, I'd really like to see this.
I'm a Whovian squid who likes drawing.
I'm also quite nerdy with an interest in game developing and the concept of a fourth spatial dimension.
All hail chickens.
It would basically be impossible to add the variables to vanilla commands, but I could add a command such as cmd_var which would be used like this.
Now for your second suggestion that would be vary easy to implement plus I feel it looks better than 20 commands, so I'll add an updated syntax spoiler to first post when I get a chance.
That's what cmd_var would be
let's say you want to summon an entity that's dependent on a variable, here's how you would go about that.
oh... I see
/\ bump /\
Yeah I need more support than two people if I'm going to invest time into this project, so if anybody else needs something like this speak up!
BUMP