Posted April 8, 201312 yr How do I output text to the chat window? Right now, I am trying just to use it for debug purposes, but it is something that could prove useful to me later.
April 8, 201312 yr Have a look at the function: par1ICommandSender.sendChatToPlayer("TEXT"); Declared under the ICommandSender interface. Look around in the net.minecraft.command package and you should see how it is used. Good luck!
April 8, 201312 yr Have a look at the function: par1ICommandSender.sendChatToPlayer("TEXT"); Declared under the ICommandSender interface. Look around in the net.minecraft.command package and you should see how it is used. Good luck! That's basically it. And since EntityPlayer implements ICommandSender, I'd like to add, for making the answer more accessible that you can do this: void someMethod(EntityPlayer player, (some other args)) { player.sendChatToPlayer("Hello, player"); } Meaning that you can send chat to a player from any method thart has an EntityPlayer as a parameter, simply by invoking sendChatToPlayer on the EntityPlayer object. It doesn't necessarily has to be an EntityPlayer object. As long as the object implements ICommandSender (as already explained by Major Tom) it will have that method defined. WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons
April 8, 201312 yr I was looking for this one, it sends a global chat message MinecraftServer.getServer().getConfigurationManager().sendChatMsg("your message") Take a look at the net.minecraft.command.CommandServerSay class Good luck!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.