Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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!  :)

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

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.