Class MessageUtils

java.lang.Object
software.bluelib.test.utils.MessageUtils

public class MessageUtils extends Object
Utility class for sending messages to players and generating random hex values.

Purpose: This class provides utility methods for sending formatted messages to players and generating random hex values.
When: Used during game tests to communicate with players and generate random values.
Where: Invoked in game test scenarios and other utility contexts.
Additional Info: The messages are formatted using the MarkdownParser class.

Key Methods:
Since:
1.6.0
See Also:
  • Constructor Details

    • MessageUtils

      public MessageUtils()
  • Method Details

    • sendMessageToPlayers

      public static void sendMessageToPlayers(net.minecraft.gametest.framework.GameTestHelper pHelper, String pMessage)
      Sends a formatted message to all players in the game test.

      Purpose: This method sends a message to all players after formatting it using Markdown.
      When: Called during game tests to communicate with players.
      Where: Used in game test scenarios where player communication is required.
      Additional Info: If no players are found or the message formatting fails, the test will fail.

      Parameters:
      pHelper - The game test helper instance.
      pMessage - The message to be sent to players.
      Since:
      1.6.0
      See Also:
    • getRandomHex

      public static int getRandomHex()
      Generates a random hex value.

      Purpose: This method generates a random hex value within a specified range.
      When: Called when a random hex value is needed.
      Where: Used in various utility contexts where random values are required.
      Additional Info: The generated hex value is between 100000 and 999999.

      Returns:
      A random hex value.
      Since:
      1.6.0
      See Also: