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.

New to Forge & MC modding - writing debug output to chat window instead of log file

Featured Replies

Posted

Hi all,

 

I apologize if the answer to this is painfully obvious and I'm just missing it, but I've been scouring this forum and Google for a little while and haven't found a solution. I'm working through an existing code base and am looking to add some debug output that I can view from within the client in the chat window rather than having to switch out to refresh the log file to see what's going on. So far, almost everything I've found says to hook on to the player object, but this is problematic for things like blocks that are loading in before the player has fully loaded in (for a single player environment), and would completely break for a dedicated server if there is no player connected. I have found a singular reference that sounds like it had potential, but the method it references doesn't appear to exist for MC 1.12.2:

 

https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/modification-development/2264126-printing-text-to-chat?comment=4

 

MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText("Sent to all players"));

 

I'm not overly concerned about my changes not being properly sided, as this is purely debug information and will not be exported into any packaged code, and it's more for ease of use than anything else. Appreciate any assistance that you might be able to provide here!

Guest
This topic is now closed to further replies.

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.