Mohist icon indicating copy to clipboard operation
Mohist copied to clipboard

[1.16.5] ServerChatEvent.setComponent Method is not running

Open AMagikarpA opened this issue 1 year ago • 2 comments

``

Minecraft Version : {Minecraft version} 1.16.5 Mohist Version : {Provide Mohist build number} 1.16.5 - 1070 Operating System : {Provide the name of your OS} Windows 10 Logs : {Link(s) of logs and crash reports if you have} Nothing Mod list : {List of your mods. You can also use /getmodlist command on your server} None Plugin list : {List of your plugins. You can also use /getpluginlist command on your server} None Description of issue : {Give all details about your issue}

ServerChatEvent.setComponent is Changed Chat Message. But if you use setComponent, not sending message

AMagikarpA avatar Jul 29 '22 00:07 AMagikarpA

Hello, thanks for opening this issue!

Before continuing, please understand that Mohist is a free and open source software, made by people in their free time. Know that we are not able to give any eta about when your issue will get answered or fixed.

Our team will first check if your issue isn't duplicated. If it's the case, we will close your issue, giving your the number of the other issue so that you can follow its progress. If you are able to do it, please check that your issue isn't duplicated, this would help us a lot.

Thank you for your patience, and have a nice day (or night)!

MohistBOT avatar Jul 29 '22 00:07 MohistBOT

@SubscribeEvent
public void test(ServerChatEvent event){
    event.getPlayer().sendMessage(
            new StringTextComponent(
                  ITextComponent.Serializer.toJson(event.getComponent())), Util.DUMMY_UUID);
    event.setComponent(new StringTextComponent(event.getMessage()));
}

image Uploaded from the relevant discord message: https://discord.com/channels/311256119005937665/926039573522427904/1002252599816364213

MagnusHJensen avatar Jul 29 '22 10:07 MagnusHJensen