Class MessageUtils
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.
sendMessageToPlayers(GameTestHelper, String)- Sends a formatted message to all players.getRandomHex()- Generates a random hex value.
- Since:
- 1.6.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intGenerates a random hex value.static voidsendMessageToPlayers(net.minecraft.gametest.framework.GameTestHelper pHelper, String pMessage) Sends a formatted message to all players in the game test.
-
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:
-