Go to file
Nolan Rosen 7b3e317c06
Bugfix: Conflicting UUIDs (#38)
* Adding basic test for entities container

* Entities test written

* Fixes: #11

* Update src/entity.rs

Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>

* Removing unused imports

Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
2022-09-09 17:45:38 -07:00
.github Github actions for main branch 2022-09-04 01:43:52 -07:00
assets Add 256x256 png logo 2022-09-03 06:56:06 -07:00
build Add valence_nbt to valence 2022-08-29 19:28:19 -07:00
examples Split Chunk into loaded and unloaded types (#37) 2022-09-08 19:33:24 -07:00
extracted Update to 1.19.2 2022-08-30 18:41:17 -07:00
extractor Update to 1.19.2 2022-08-30 18:41:17 -07:00
packet_inspector stderr -> stdout 2022-09-05 22:29:19 -07:00
src Bugfix: Conflicting UUIDs (#38) 2022-09-09 17:45:38 -07:00
.gitignore Ignore *.iml files 2022-07-24 22:06:24 -07:00
Cargo.toml Change debug optimization levels (#33) 2022-09-08 04:40:42 -07:00
LICENSE.txt prepare for crates.io 2022-01-20 06:39:49 -08:00
README.md Clarify status of crates.io crate in the readme 2022-09-06 18:05:57 -07:00
rustfmt.toml Change rustfmt settings 2022-08-28 21:31:07 -07:00

A Rust framework for building Minecraft: Java Edition servers.

Like feather, Valence is an effort to build a Minecraft compatible server completely from scratch in Rust. The difference is that Valence has decided to organize the effort a little differently. All game logic is behind a trait. This approach has many advantages. Features such as a plugin system, dedicated executable, and vanilla game mechanics can be implemented on top of Valence. Valence is a Rust library like any other.

In the future we may decide to reimplement vanilla game mechanics as a separate project. If you're developing something like a minigame server without need for vanilla game mechanics, you can depend on Valence directly.

Goals

Valence aims to be the following:

  • Complete. Abstractions for the full breadth of the Minecraft protocol.
  • Flexible. Your use case should be achievable without manually sending and receiving packets or other hacks.
  • Minimal. The API surface is small with only the necessities exposed. Opinionated features such as a standalone executable, plugin system, and reimplementation of vanilla mechanics should be built in a separate crate on top of the foundation that Valence provides.
  • Intuitive. An API that is easy to use and difficult to misuse. Extensive documentation is important.
  • Efficient. Optimal use of system resources with multiple CPU cores in mind.
  • Up to date. Targets the most recent stable version of Minecraft. Support for multiple versions at once is not planned (although you can use a proxy).

Current Status

Valence is still early in development with many features unimplemented or incomplete. However, the foundations are in place. Here are some noteworthy achievements:

  • A new serde library for Minecraft's Named Binary Tag (NBT) format
  • Authentication, encryption, and compression
  • Block states
  • Chunks
  • Entities and tracked data
  • Bounding volume hierarchy for fast spatial entity queries
  • Player list and player skins
  • Dimensions, biomes, and worlds
  • JSON Text API
  • A Fabric mod for extracting data from the game into JSON files. These files are processed by a build script to generate Rust code for the project. The JSON files can be used in other projects as well.
  • Block entities
  • Inventory and items
  • Proxy support
  • Sounds, particles, etc.
  • Utilities for continuous collision detection

Here is a short video showing the examples and some of its current capabilities.

Getting Started

Running the Examples

You may want to try running one of the examples. After cloning the repository, run

cargo r -r --example conway

Next, open your Minecraft client and connect to the address localhost. If all goes well you should be playing on the server.

Adding Valence as a Dependency

Valence is published to crates.io. Run cargo add valence to add it to your project. Documentation is available here.

However, the crates.io version is likely outdated. To use the most recent development version, clone the repo and add Valence as a path dependency.

[dependencies]
valence = { path = "the/path/to/valence" }

View the documentation by running cargo d --open.

Contributing

Contributions are welcome! Take a look at the issue tracker to see what needs to be done. You can also join the Discord to discuss the project and ask questions.

License

Code is licensed under MIT while the Valence logo is under CC BY-NC-ND 4.0

Funding

If you would like to contribute financially consider sponsoring me (rj00a) on GitHub (soon?) or Patreon.

I would love to continue working on Valence and your support would help me do that. Thanks!