Hey guys you know how to send an string with textcomponent? i can send textcomponent normaly, but if i try send string + textcomponent, textcomponent is like this: if somebody can help me would be great!
Try this: Code (Text): TextComponent tc = new TextComponent(string); tc.addExtra(" " + yourtextcomponent); So now it's all in one textcomponent. ^SP
The void addextra is for add an string after the textcomponent, i want add an string before the textcomponent.
Code (Java): TextComponent textComponent = new TextComponent("Hello,"); TextComponent anotherComponent = new TextComponent( "World" ); textComponent.addExtra( " " + anotherComponent ); The code would output: Code (Text): Hello, TextComponent{text=World, BaseComponent(color=§f, bold=null, italic=null, underlined=null, strikethrough=null, obfuscated=null, extra=null, clickEvent=null, hoverEvent=null)} You are obviously oblivious to the fact that when you try to append a string with another object it combines the String with that object's toString method.
The BungeeCord API has ProxiedPlayer::sendMessage(BaseComponent...), as this is the BungeeCord Chat API. General adviced to use the ComponentBuulder unless otherwise stated.