notbeer/Gametest-API-Wrapper

Add a broadcast function for translations.

Opened this issue · 1 comments

The proposal is simple; create a broadcast function that instead accepts a translation key as an argument, as well as a list of text to substitute within the translation.
This could be implemented using the tellraw command. And could also be extended to errors in custom commands when one is thrown.

The custom commands error already uses this for errors...

            if (!getCommand) {
                data.cancel = true;
                return this.runCommand(
                    `tellraw "${data.sender.nameTag}" {"rawtext":[{"text":"§c"},{"translate":"commands.generic.unknown", "with": ["§f${command}§c"]}]}`

^^^^ found in /src/libraries/Minecraft.js