sandstone-mc / sandstone

Sandstone | Next Generation Framework for Minecraft
https://sandstone.dev/
MIT License
171 stars 15 forks source link

`ObjectiveInstance`s or `Score`s in commands always produce invalid output #158

Closed GrantGryczan closed 2 years ago

GrantGryczan commented 2 years ago

The reason ObjectiveInstances don't work is because they don't have a custom toString method. I'm not sure about Scores though.

Example input:

const test = Objective.get('test');
MCFunction('test', () => {
    scoreboard.objectives.add(test, 'dummy');
    scoreboard.players.set(test('$value'), 5);
});

Output:

scoreboard objectives add (scoreHolder) => new Score_1.Score(this.commandsRoot, scoreHolder.toString(), this) dummy
scoreboard players set $value test,5