Gametest-API-Wrapper icon indicating copy to clipboard operation
Gametest-API-Wrapper copied to clipboard

Add a broadcast function for translations.

Open SIsilicon opened this issue 4 years ago • 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.

SIsilicon avatar Oct 03 '21 21:10 SIsilicon

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

jrcarl624 avatar Oct 20 '21 21:10 jrcarl624