Inspired by this question about the security risks of gaming mods in general, which was in turn inspired by this question about the security risks of Skyrim mods specifically, I have a question of my own:
How safe are Minecraft mods? I know that it's possible to build Turing-complete devices in Minecraft, and that Command blocks can be controlled with real scripting code written in-game, and there are mods that introduce blocks that players can control with in-game scripts as well (e.g. a nuclear reactor mod that lets you control its functions with a script). I also know that there are mods that significantly alter the function of the game, and that often these mods are repacked by people other than their authors into modpacks, which were mentioned as a potential source of risk in the first linked question. I also know that there have been modded Minecraft servers that have sold in-game randomized lootboxes in exchange for real-world money, so there's clearly some method of interacting with files outside the game (though I admit I'm not certain how they implemented it, so maybe it's the other way around, with things outside the game altering the game's files).
All of this leads me to think that Minecraft mods might be unsafe from a security perspective, and might be a potential vector for malware. Is this accurate, or does Minecraft have security measures that might mitigate this apparant risk? Note that I'm not asking about damaging your in-game assets, but about damaging your computer outside of the game by infecting it with viruses, spyware, or other forms of malware.