MysteryBlokHed / databind

Expand the functionality of Minecraft Datapacks.
https://databind.rtfd.io/en/stable
GNU General Public License v3.0
4 stars 0 forks source link

Store variables on the same scoreboard #149

Open MysteryBlokHed opened 1 year ago

MysteryBlokHed commented 1 year ago

Currently, all variables are stored on separate scoreboards under the --databind username. This means that for every single variable in a Databind project, a new scoreboard is created. This is unnecessary and makes it much harder to manage scoreboards.

An alternative idea is to instead store all variables on the same scoreboard (called something straightforward like databind or databind-vars) as different pseudo-users.

For example, the following code:

func main
tag load
    var foo := 1
    var bar := 2
end

Would now generate something like:

scoreboard objectives add databind-vars dummy
scoreboard players set --var-foo databind-vars 1
scoreboard players set --var-bar databind-vars 2

Commands like tvar would, of course, also have to be modified internally.

For #148: Instead of customizing the name of the --databind user, the config option would customize the name of the scoreboard.