REPL Driven Minecraft(juxt.pro)
juxt.pro
REPL Driven Minecraft
https://www.juxt.pro/blog/repl-driven-minecraft
14 comments
It would be interesting to render the images from the POV of a player in the world onto a large movie screen in game. Then other players could join in, go to the cinema and watch the live stream. Might be fun for game lobbies.
It's been done. See https://m.youtube.com/watch?v=_VBO2WRpBrQ
"Public
Minecraft: Pi Edition API Python Library" https://github.com/martinohanlon/mcpi
rendering-minecraft w/ mcpi might do offline / batch rendering? https://pypi.org/project/rendering-minecraft/
Jupyter-cadquery might be worth a look: https://github.com/bernhard-42/jupyter-cadquery :
> View CadQuery objects in JupyterLab or in a standalone viewer for any IDE [w/ pythreejs]
If there's a JS port or WASM build of Minecraft, Minecraft could be rendered in a headless browser?
rendering-minecraft w/ mcpi might do offline / batch rendering? https://pypi.org/project/rendering-minecraft/
Jupyter-cadquery might be worth a look: https://github.com/bernhard-42/jupyter-cadquery :
> View CadQuery objects in JupyterLab or in a standalone viewer for any IDE [w/ pythreejs]
If there's a JS port or WASM build of Minecraft, Minecraft could be rendered in a headless browser?
Nice, I wonder if the open source Minetest can be used instead of Minecraft.
Not really a REPL, but can inject code into a running minetest instance: https://github.com/Quiark/mtrepl/
A Jupyter kernel for Minecraft would be neat:
https://jupyter-client.readthedocs.io/en/latest/wrapperkerne... :
> You can re-use IPython’s kernel machinery to easily make new kernels. This is useful for languages that have Python bindings, such as Hy (see Calysto Hy), or languages where the REPL can be controlled in a tty using pexpect, such as bash.
Looks like there's a pytest-minecraft, too: https://pypi.org/project/pytest-minecraft/
/? Minecraft site:pypi.org https://pypi.org/search/?q=minecraft
SensorCraft is just the voxel designer part of Minecraft (like original Minecraft) with Pyglet for OpenGL: https://github.com/AFRL-RY/SensorCraft
> You can re-use IPython’s kernel machinery to easily make new kernels. This is useful for languages that have Python bindings, such as Hy (see Calysto Hy), or languages where the REPL can be controlled in a tty using pexpect, such as bash.
Looks like there's a pytest-minecraft, too: https://pypi.org/project/pytest-minecraft/
/? Minecraft site:pypi.org https://pypi.org/search/?q=minecraft
SensorCraft is just the voxel designer part of Minecraft (like original Minecraft) with Pyglet for OpenGL: https://github.com/AFRL-RY/SensorCraft
Awhile back I looked into creating a Jupyter kernel for LDraw / LeoCAD / Bricklayer (SML) to build LEGO creations with code in the input cell of a notebook and render to the output cell, and put together some notes on Jupyter kernels that might be of use for creating a Minecraft / mcpi / SensorCraft Jupyter kernel: https://github.com/westurner/wiki/blob/master/bricklayer.md#...
- [ ] DOC: Jupyter-cadquery & pythreejs inspiration
- [ ] ENH: Minecraft Jupyter kernel (pytest-minecraft?,)
- [ ] ENH: mcpi Jupyter kernel
- [ ] ENH: SensorCraft Jupyter kernel
- [ ] ENH,BLD,DOC: SensorCraft: conda-forge environment.yml (target Mambaforge for ARM64 support, too)
- [ ] ENH,BLD,DOC: SensorCraft: build plaform-specific binary installer(s) with {CPython, all packages from environment.yml, Pyglet & OpenGL, } with e.g. Conda Constructor
- [ ] ENH,BLD,DOC: SensorCraft: reformat tutorials as Jupyter notebooks; for repo2docker, jupyter-book (template w/ repo2docker requirements.txt and/or conda/mamba environment.yml), & jupyter-lite, & VScode (because VSCode works on Win/Mac/Lin/Web and has Jupyter notebook support)
- [ ] ENH,BLD,DOC: SensorCraft: build a jupyter-lite build to run SensorCraft & Python & JupyterLab in WASM in a browser tab with no installation/deployment time cost
- [ ] ENH: SensorCraft: replace Pyglet (OpenGL) with an alternate WebGL/WebGPU implementation
- [ ] DOC: Jupyter-cadquery & pythreejs inspiration
- [ ] ENH: Minecraft Jupyter kernel (pytest-minecraft?,)
- [ ] ENH: mcpi Jupyter kernel
- [ ] ENH: SensorCraft Jupyter kernel
- [ ] ENH,BLD,DOC: SensorCraft: conda-forge environment.yml (target Mambaforge for ARM64 support, too)
- [ ] ENH,BLD,DOC: SensorCraft: build plaform-specific binary installer(s) with {CPython, all packages from environment.yml, Pyglet & OpenGL, } with e.g. Conda Constructor
- [ ] ENH,BLD,DOC: SensorCraft: reformat tutorials as Jupyter notebooks; for repo2docker, jupyter-book (template w/ repo2docker requirements.txt and/or conda/mamba environment.yml), & jupyter-lite, & VScode (because VSCode works on Win/Mac/Lin/Web and has Jupyter notebook support)
- [ ] ENH,BLD,DOC: SensorCraft: build a jupyter-lite build to run SensorCraft & Python & JupyterLab in WASM in a browser tab with no installation/deployment time cost
- [ ] ENH: SensorCraft: replace Pyglet (OpenGL) with an alternate WebGL/WebGPU implementation
Minetest is pretty great
Not easily as minetest is written in C++ and this is hosted on the JVM.
It's only tangentially related, but I just wanted to say that being able to programmatically hack around with the minecraft world via python on the raspberry pi is what first made programming fun for me. I distinctly remember building a binary clock; actually writing code to achieve something I wanted rather than some arbitrary class exercise
This is cool. I’d like to do this with one of my adult children who has been into Minecraft for years. Was a setup/getting started guide captured from the session that you can share?
The workshop repo has detailed instructions you can follow: https://github.com/lambdaisland/witchcraft-workshop :)
This one's older, but here's an example using Haskell: http://www.timphilipwilliams.com/slides/minecraft.pdf
The main idea is algebraic composition (a non-commutative monoid).
The main idea is algebraic composition (a non-commutative monoid).