Controlling IRL light with Minecraft (ComputerCraft mod).
How does it work:
Before I start explaining how it works let's name devices that take part in the process:
MCPC - the ComputerCraft computer in Minecraft
MyServ - My IRL server
PowSwitch - Smart power switch connected to the lamp
Lamp is connected to a Wi-Fi power switch (PowSwitch). PowSwitch connects to the Internet and has an API to control it.
ComputerCraft computers can do simple HTTP web requests. These aren't capable of making API requests/calls tho.
That's where MyServ comes in - it reacts to MCPC's HTTP web request and "translates" it into an PowSwitch's API call.
In simpler words - When you press the button in Minecraft MCPC tries to download random data from MyServ. MyServ detects MCPC's request and reacts with sending an command over PowSwitch's API. This API command makes PowSwitch switch power and therefore switch the enitre lamp.