I know this might sound stupid but I'm honestly curious. Would this ever be possible? Or is Minecraft's language too basic. Would I ever be able to write python, then run it in Minecraft?
-
IDK Minecraft at all, but please clarify -- are you talking about running the full "set"of real Python code including internet and GUI, or just a subset of the code that would be compatible with whatever Minecraft can support? Or something else entirely like translating Python -> whatever Minecraft uses?– l3l_azeCommented Oct 21, 2020 at 6:07
-
1Well Python is a programming language which has methods and variables and values. Minecraft command blocks don't have variables and not really methods or values (they kinda do but it's weak). So probably not.– PenguinCommented Oct 21, 2020 at 15:32
-
Does this answer your question? This uses a mod.– randomuser922Commented Oct 21, 2020 at 20:17
-
1It's definitely possible to convert a subset of any language to Minecraft command blocks, but a huge issue is the lack of variables outside of chat.– JunelillyCommented Oct 21, 2020 at 23:13
1 Answer
It really depends on what you mean by that. If you mean doing things inside the game like automating tasks using Python, it's not completely out of the question. The mod OpenComputers adds computer blocks and items which allow you to do something like that using Lua.
If you mean writing Python scripts that interact with the game from the outside, then yes; in fact, the Rasperry Pi edition of the game is made to do just that. As stated in the comments to your question by randomuser922, there's even a mod that simulates these features.
If you mean translating Python code to Minecraft commands... not really. But there are a few programming languages made to facilitate writing Minecraft commands, such as Command Block Language or MPL. These compile into command blocks which you can then import into a world.