Interface Helper

All Known Subinterfaces:
ICommand
All Known Implementing Classes:
Command, Paginator

public interface Helper
An ease-of-access interface to provide the Minecraft game instance, chat and console logging mechanisms, and the Baritone chat prefix.
Since:
8/1/2018
Author:
Brady
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Helper
    Instance of Helper.
    static final net.minecraft.client.Minecraft
    Deprecated.
    static final net.minecraft.client.GuiMessageTag
    The tag to assign to chat messages when Settings.useMessageTag is true.
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.network.chat.Component
     
    default void
    logDebug(String message)
    Send a message to chat only if chatDebug is on
    default void
    logDirect(boolean logAsToast, net.minecraft.network.chat.Component... components)
    Send components to chat with the [Baritone] prefix
    default void
    logDirect(String message)
    Send a message to chat regardless of chatDebug (should only be used for critically important messages, or as a direct response to a chat command)
    default void
    logDirect(String message, boolean logAsToast)
    Send a message to chat regardless of chatDebug (should only be used for critically important messages, or as a direct response to a chat command)
    default void
    logDirect(String message, net.minecraft.ChatFormatting color)
    Send a message to chat regardless of chatDebug (should only be used for critically important messages, or as a direct response to a chat command)
    default void
    logDirect(String message, net.minecraft.ChatFormatting color, boolean logAsToast)
    Send a message to chat regardless of chatDebug (should only be used for critically important messages, or as a direct response to a chat command)
    default void
    logDirect(net.minecraft.network.chat.Component... components)
    Send components to chat with the [Baritone] prefix
    default void
    Send a message as a desktop notification
    default void
    logNotification(String message, boolean error)
    Send a message as a desktop notification
    default void
    Send a message as a desktop notification regardless of desktopNotifications (should only be used for critically important messages)
    default void
    logNotificationDirect(String message, boolean error)
    Send a message as a desktop notification regardless of desktopNotifications (should only be used for critically important messages)
    default void
    logToast(String message)
    Send a message to display as a toast popup
    default void
    logToast(String title, String message)
    Send a message to display as a toast popup
    default void
    logToast(net.minecraft.network.chat.Component title, net.minecraft.network.chat.Component message)
    Send a message to display as a toast popup
    default void
     
  • Field Details

    • HELPER

      static final Helper HELPER
      Instance of Helper. Used for static-context reference.
    • mc

      @Deprecated static final net.minecraft.client.Minecraft mc
      Deprecated.
      The main game instance returned by Minecraft.getInstance(). Deprecated since IPlayerContext.minecraft() should be used instead (In the majority of cases).
    • MESSAGE_TAG

      static final net.minecraft.client.GuiMessageTag MESSAGE_TAG
      The tag to assign to chat messages when Settings.useMessageTag is true.
  • Method Details

    • getPrefix

      static net.minecraft.network.chat.Component getPrefix()
    • logToast

      default void logToast(net.minecraft.network.chat.Component title, net.minecraft.network.chat.Component message)
      Send a message to display as a toast popup
      Parameters:
      title - The title to display in the popup
      message - The message to display in the popup
    • logToast

      default void logToast(String title, String message)
      Send a message to display as a toast popup
      Parameters:
      title - The title to display in the popup
      message - The message to display in the popup
    • logToast

      default void logToast(String message)
      Send a message to display as a toast popup
      Parameters:
      message - The message to display in the popup
    • logNotification

      default void logNotification(String message)
      Send a message as a desktop notification
      Parameters:
      message - The message to display in the notification
    • logNotification

      default void logNotification(String message, boolean error)
      Send a message as a desktop notification
      Parameters:
      message - The message to display in the notification
      error - Whether to log as an error
    • logNotificationDirect

      default void logNotificationDirect(String message)
      Send a message as a desktop notification regardless of desktopNotifications (should only be used for critically important messages)
      Parameters:
      message - The message to display in the notification
    • logNotificationDirect

      default void logNotificationDirect(String message, boolean error)
      Send a message as a desktop notification regardless of desktopNotifications (should only be used for critically important messages)
      Parameters:
      message - The message to display in the notification
      error - Whether to log as an error
    • logDebug

      default void logDebug(String message)
      Send a message to chat only if chatDebug is on
      Parameters:
      message - The message to display in chat
    • logDirect

      default void logDirect(boolean logAsToast, net.minecraft.network.chat.Component... components)
      Send components to chat with the [Baritone] prefix
      Parameters:
      logAsToast - Whether to log as a toast notification
      components - The components to send
    • logDirect

      default void logDirect(net.minecraft.network.chat.Component... components)
      Send components to chat with the [Baritone] prefix
      Parameters:
      components - The components to send
    • logDirect

      default void logDirect(String message, net.minecraft.ChatFormatting color, boolean logAsToast)
      Send a message to chat regardless of chatDebug (should only be used for critically important messages, or as a direct response to a chat command)
      Parameters:
      message - The message to display in chat
      color - The color to print that message in
      logAsToast - Whether to log as a toast notification
    • logDirect

      default void logDirect(String message, net.minecraft.ChatFormatting color)
      Send a message to chat regardless of chatDebug (should only be used for critically important messages, or as a direct response to a chat command)
      Parameters:
      message - The message to display in chat
      color - The color to print that message in
    • logDirect

      default void logDirect(String message, boolean logAsToast)
      Send a message to chat regardless of chatDebug (should only be used for critically important messages, or as a direct response to a chat command)
      Parameters:
      message - The message to display in chat
      logAsToast - Whether to log as a toast notification
    • logDirect

      default void logDirect(String message)
      Send a message to chat regardless of chatDebug (should only be used for critically important messages, or as a direct response to a chat command)
      Parameters:
      message - The message to display in chat
    • logUnhandledException

      default void logUnhandledException(Throwable exception)