MinecraftUtils interface provides a collection of commonly-needed Minecraft utility functions, eliminating the need to copy and paste these functions into your mods.
Accessing MinecraftUtils
Chat Messaging
sendMessage
- Kotlin
- Java
message: String- The message to display in chatprefix: String- Custom prefix for the message (optional)
[Essential] and should only be used for Essential-specific information. For general messages, use UTextComponent or the two-parameter version.
sendChatMessageAndFormat
- Kotlin
- Java
message: String- Message key or text to formatparameters: vararg Any- Optional formatting parameters
Server Detection
isHypixel
Boolean - true if the player is currently connected to the Hypixel server
Resource Loading
getResourceImage
BufferedImage, useful for creating dynamic textures.
Parameters:
location: ResourceLocation- The resource to load
BufferedImage? - The loaded image, or null if loading failed
Development Environment Detection
isDevelopment
Boolean - true if the game is running in a development environment rather than production