Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.12.2] event.getMessage() is buggy


TimTarAn
 Share

Recommended Posts

Hello, I have this code 

@SubscribeEvent
    public static void chat(final ClientChatEvent event){
        System.out.println(event.getMessage());
        System.out.println(event.getMessage() == "inventory");
        if (event.getMessage() == "inventory"){
            Minecraft.getMinecraft().player.sendChatMessage("No");
            event.setCanceled(true);
        }
    }

But..

[11:46:54] [Client thread/INFO] [STDOUT]: [com.example.examplemod.Blocks2:chat:39]: inventory
false
[11:46:54] [Client thread/INFO] [STDOUT]: [com.example.examplemod.Blocks2:clientChatEvent:31]: inventory
[11:46:54] [Server thread/INFO] [minecraft/MinecraftServer]: <TimTarAn> inventory
[11:46:54] [Client thread/INFO] [minecraft/GuiNewChat]: [CHAT] <TimTarAn> inventory

WTF

 

Edited by TimTarAn
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.