The IoTcraft mod allows the player's client to connect to an MQTT broker. Afterward, it can send and receive messages in the form of commands, triggers or other methods defined by the user.
Requires Fabric API, Cloth Config API and Mod Menu to function properly and for an easy setup.
After booting up the game, navigate to the mod's config (either through the Mods button provided by Mod Menu or in the config folder) and set up the MQTT broker connection details.