Create a Basic Modular GUI for Your Custom Block
Setting Up the GUI Structure
ModularUI allows you to build GUIs by combining modular components rather than writing complex rendering code. Start by creating a new GUI class that extends the appropriate ModularUI base class for your block type.
Define your GUI layout using the modular building blocks provided by the mod. Add panels, buttons, slots, and display widgets by chaining them together. Each component can be positioned and sized independently, making it easy to create organized interfaces without worrying about coordinate calculations.
Connecting to Your TileEntity
Bind your GUI to your TileEntity by specifying which data values should sync between server and client. ModularUI handles the synchronization automatically—when a value changes on the server, it updates on the client without manual packet handling.
Use the mod's data binding system to link GUI widgets (like progress bars or text displays) directly to your TileEntity's properties. This ensures your interface always reflects the current state of your machine or block, whether it's processing progress, energy levels, or inventory contents.