Jump to content

Output text to the chat window?


Arphahat

Recommended Posts

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.