A FUSE filesystem for querying and controlling Minecraft, as a universal mod platform (but mainly for fun). A blog post covering the technical details can be found here.
Warning: don't get your hopes too high, this is still WIP!
This plugin makes it possible to control your game through the filesystem, and therefore with common
Unix tools like cat
, find
, grep
etc. This means you can easily write Minecraft mods with
languages like bash and Python without needing to touch Java, gradle or Fabric.
For fun, to learn about FUSE, but most importantly - why not?
In ./scripts you can find some python that encapsulates the filesystem structure and makes for a nicer scripting experience. See the demo script for some examples.
import common
mc = Minecraft.from_args()
player = mc.player()
print(f"{player.name} is at {player.position}")
player.kill()
- Download latest release, or build it yourself
- Build FUSE filesystem with
cargo build --bin minecraft-fs --release
- Build Minecraft mod with
cd plugin; ./gradlew build
, which will build the jar file tobuild/libs
- Build FUSE filesystem with
- Install Minecraft mod
- Client version: 1.18.2
- Dependencies: Fabric Loader, Fabric API and Fabric Language Kotlin
- Install MCFS via mod manager/putting mod jar in
mods/
- Install as above
- Start Minecraft
- Mount the FUSE filesystem over an empty directory
mkdir mnt; ./minecraft-fs ./mnt
- Join a single player world - there's currently no support for multiplayer
Your mountpoint should contain something like the following:
$ cd mnt
$ ls
player version worlds
$ ls -l player
drwxr-xr-x - dom 21 Feb 20:27 control
lrwxr-xr-x 0 dom 21 Feb 20:27 entity -> world/entities/by-id/135
.rwxr-xr-x 256 dom 21 Feb 20:27 health
.rwxr-xr-x 256 dom 21 Feb 20:27 name
.rwxr-xr-x 256 dom 21 Feb 20:27 position
lrwxr-xr-x 0 dom 21 Feb 20:27 world -> ../worlds/overworld
Congratulations, you can now manipulate the game through reading and writing to these special files.
; wo=write only, ro=read only, rw=read and write
βββ command ; wo, executes a command as the player
βββ player
βΒ Β βββ control ; all the files here are write-only
βΒ Β βΒ Β βββ jump ; causes the player to jump on any input
βΒ Β βΒ Β βββ move ; applies the given x,y,z force to the player
βΒ Β βΒ Β βββ say ; makes the player chat
βΒ Β βββ health ; rw, the player's health
βΒ Β βββ name ; ro, the player's name
βΒ Β βββ position ; rw, the player's position
βΒ Β βββ gamemode ; rw, the player's gamemode
βΒ Β βββ hunger ; rw, the player's hunger
βΒ Β βββ exhaustion ; rw, the player's exhaustion
βΒ Β βββ saturation ; rw, the player's food saturation
βΒ Β βββ target ; wo, a position to look at
βΒ Β βββ entity -> world/entities/by-id/135 ; symlink to player entity
βΒ Β βββ world -> ../worlds/overworld ; symlink to player world
βββ worlds
βββ overworld
βΒ Β βββ blocks
βΒ Β β βββ 100,64,250
βΒ Β β β βββ adjacent ; dir of symlinks to adjacent blocks
βΒ Β β β βΒ Β βββ above -> ../../100,65,250
βΒ Β β β β βββ below -> ../../100,63,250
βΒ Β β β β βββ east -> ../../101,64,250
βΒ Β β β β βββ north -> ../../100,64,249
βΒ Β β β β βββ south -> ../../100,64,251
βΒ Β β β β βββ west -> ../../99,64,250
βΒ Β β β βββ pos ; ro, this block's position
βΒ Β β β βββ type ; rw, the block's type
βΒ Β β βββ 100.2 64.555 250.1223 ; this works too
βΒ Β β β βββ ...
βΒ Β βΒ Β βββ README ; ro, explains the dir structure
βΒ Β βββ entities
βΒ Β βΒ Β βββ by-id
βΒ Β βΒ Β β βββ 107 ; entity id
βΒ Β βΒ Β β βΒ Β βββ health ; rw, the entity's health (if living)
βΒ Β βΒ Β β βΒ Β βββ living ; inaccessible, exists to indicate living
βΒ Β βΒ Β β βΒ Β βββ position ; rw, the entity's position
βΒ Β βΒ Β β βΒ Β βββ target ; wo, a position to look at
βΒ Β βΒ Β β βΒ Β βββ type ; ro, the entity's type
βΒ Β βΒ Β β βββ 108
βΒ Β βΒ Β β βΒ Β βββ health
βΒ Β βΒ Β β βΒ Β βββ living
βΒ Β βΒ Β β βΒ Β βββ position
βΒ Β βΒ Β β βΒ Β βββ target
βΒ Β βΒ Β β βΒ Β βββ type
βΒ Β βΒ Β β ...
βΒ Β βΒ Β βββ spawn ; rw, spawns an entity, read file for help
βΒ Β βββ time ; rw, the world's time
βββ nether
βΒ Β βββ blocks
βΒ Β βΒ Β βββ ...
βΒ Β βββ entities
βΒ Β βΒ Β βββ ...
βΒ Β βββ time
βββ end
βββ blocks
βΒ Β βββ ...
βββ entities
βΒ Β βββ ...
βββ time
- More endpoints
- player gamemode
- entity hunger
- better player movement
- entity looking direction (yaw,pitch,roll)
- entity target pos
- symlink to entity vehicle
- Inventory management
- individual slots
- symlink to current slot, armour, other hand
- give/spawn items
- More block control
-
- orientation
- nbt tags
- Entity spawning
- More entity filters than
by-id
- by-type
- by-proximity-to a position and radius
- Server settings
- game rules
- pvp
- difficulty
- weather
- Event file for reacting to events
-
tail
able file of events such as player chat
-
- Client specific things
- pause/unpause game
- load into world, stop server
- Multiplayer support
- install as a server mod, control the server world
- install as a client mod and join an unmodded server, at least control the player