MCPcopy Index your code
hub / github.com/Vulae/pkmc

github.com/Vulae/pkmc @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
744 symbols 1,501 edges 70 files 84 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

pkmc

Simple modular building blocks for Minecraft Java Edition minigame-like servers. See examples/server for example server.

[!WARNING] This project is in early development, expect ALOT of code to change.

[!IMPORTANT] This will only ever support the latest Minecraft Java Edition release version (currently 1.21.6)

This will NOT make anything use any async code (tokio/futures). This was originally built to be fully single-threaded, but that may change in the future.

Running Example Server

  1. Clone repo
  2. Extract Minecraft data cargo run -p pkmc-generated-extractor -- --release 1.21.6 --output pkmc-generated/assets/
  3. Start the server cargo run -p example-server --release
  4. Join the server (Default IP is [::1]:52817)

examples/server/config.toml to configure.

Features

Feature Implemented Comment
Server List Ping
World Loading (Single-threaded[^threaded-chunk-loading])
World Editing
World Lighting
World Saving (Probably never)
Dimensions/Multiworld
Entities
Inventories
Resource Pack
Online Mode
Packet Compression
Players & Chat (Unsigned chat)
Commands
Cookies 🍪

Some extra features may be implemented inside the example server. (pkmc will never try to implement many vanilla things, such as: vanilla world gen, redstone, world ticking)

Project Layout

  • pkmc-util Some utility stuff for everything else to use.
  • pkmc-generated Extract Minecraft server.jar data & convert to code.
  • pkmc-defs Definitions for blocks, packets, & other stuff.
  • pkmc-server General building blocks for a server.
  • examples/* Some examples & some testing stuff.

Goals

Make a simple framework for Minecraft minigame servers.

Published as a crate once more features are implemented and things are more fleshed out.

License

MIT License License is very likely change to MIT-0 or 0BSD in the future.

Notes

[^threaded-chunk-loading]: Currently only single-threaded for world stuff, but definitely going to be multi-threaded in the future.

Extension points exported contracts — how you extend this code

ServerboundPacket (Interface)
(no doc) [28 implementers]
pkmc-util/src/connection/packet.rs
CommandListener (Interface)
(no doc) [4 implementers]
pkmc-server/src/command.rs
PlayerExecutableCommand (Interface)
(no doc) [3 implementers]
examples/server/src/player/command.rs
ClientboundPacket (Interface)
(no doc) [45 implementers]
pkmc-util/src/connection/packet.rs
Entity (Interface)
(no doc) [2 implementers]
pkmc-server/src/entity_manager.rs
PacketEncodable (Interface)
(no doc) [11 implementers]
pkmc-util/src/connection/codec.rs
CommandParsable (Interface)
(no doc) [1 implementers]
pkmc-server/src/command.rs
PacketDecodable (Interface)
(no doc) [10 implementers]
pkmc-util/src/connection/codec.rs

Core symbols most depended-on inside this repo

encode
called by 243
pkmc-util/src/connection/codec.rs
iter
called by 88
pkmc-defs/src/block.rs
len
called by 70
pkmc-util/src/nbt/mod.rs
read_const
called by 58
pkmc-util/src/read_ext.rs
send
called by 52
pkmc-util/src/connection/mod.rs
lock
called by 47
pkmc-util/src/weak_collections.rs
into_iter
called by 40
pkmc-util/src/nbt/mod.rs
insert
called by 40
pkmc-defs/src/block.rs

Shape

Method 445
Class 187
Function 60
Enum 36
Interface 16

Languages

Rust100%

Modules by API surface

pkmc-defs/src/packet/play/entity.rs41 symbols
pkmc-server/src/command.rs29 symbols
pkmc-defs/src/packet/play/player.rs28 symbols
pkmc-server/src/level/anvil/level.rs26 symbols
pkmc-util/src/weak_collections.rs25 symbols
pkmc-util/src/nbt/mod.rs23 symbols
pkmc-defs/src/text_component.rs23 symbols
pkmc-server/src/entity_manager.rs22 symbols
pkmc-defs/src/packet/play/level.rs21 symbols
pkmc-util/src/position.rs20 symbols
pkmc-server/src/client_handler.rs18 symbols
pkmc-generated/generated/src/lib.rs18 symbols

For agents

$ claude mcp add pkmc \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact