Skip to content
Advertisement

Letter appears in console output, but shouldn’t. problem with Bukkit.getConsoleSender().sendMessage();

I’m trying to split code in classes. This code is sending to console text with B letter in start of line, but shouldn’t.

Code:

JavaScript

in ConsoleWrapper.java

JavaScript

but if console.sendMessage(("§c[" + pluginName + "]" + msg)); executing in main class, letter B doesn’t appeat in console.

output with cw.notify

JavaScript

output with console.sendMessage()

JavaScript

Advertisement

Answer

It’s not recommended to write your own § because of possible encoding problem.

Prefer use ChatColor enum, like that:

JavaScript

You can find all color codes here.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement