2023-02-12 04:51:53 +11:00
|
|
|
<p align="center">
|
|
|
|
<img src="assets/logo-full.svg" width="650" align="center">
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p align="center">
|
|
|
|
<a href="https://github.com/valence-rs/valence/blob/main/LICENSE.txt">
|
|
|
|
<img src="https://img.shields.io/github/license/valence-rs/valence"
|
|
|
|
alt="license"></a>
|
|
|
|
<a href="https://crates.io/crates/valence">
|
|
|
|
<img src="https://img.shields.io/crates/d/valence?label=crates.io"></a>
|
|
|
|
<a href="https://discord.gg/8Fqqy9XrYb">
|
|
|
|
<img src="https://img.shields.io/discord/998132822239870997?logo=discord"
|
|
|
|
alt="chat on Discord"></a>
|
|
|
|
<a href="https://github.com/sponsors/rj00a">
|
|
|
|
<img src="https://img.shields.io/github/sponsors/rj00a"
|
|
|
|
alt="GitHub sponsors"></a>
|
|
|
|
</p>
|
2023-02-04 14:04:54 +11:00
|
|
|
|
2022-09-04 00:27:49 +10:00
|
|
|
A Rust framework for building Minecraft: Java Edition servers.
|
|
|
|
|
2023-02-12 04:51:53 +11:00
|
|
|
Built on top of [Bevy ECS](https://bevyengine.org/learn/book/getting-started/ecs/), Valence is an effort to create a
|
|
|
|
Minecraft compatible server completely from scratch in Rust. You can think of Valence as a _game engine for
|
|
|
|
Minecraft servers_. It doesn't do much by default, but by writing game logic yourself and leveraging Bevy's
|
|
|
|
powerful [plugin system](https://bevyengine.org/learn/book/getting-started/plugins/), you can make almost anything.
|
2022-09-04 13:27:49 +10:00
|
|
|
|
2023-02-12 04:51:53 +11:00
|
|
|
Opinionated features like dynamic scripting, dedicated executables, and vanilla game mechanics are all expected to be
|
|
|
|
built as optional plugins. This level of modularity is desirable for those looking to build highly custom experiences
|
|
|
|
in Minecraft such as minigame servers.
|
2022-09-04 13:27:49 +10:00
|
|
|
|
2022-09-04 00:27:49 +10:00
|
|
|
# Goals
|
|
|
|
|
|
|
|
Valence aims to be the following:
|
|
|
|
|
|
|
|
* **Complete**. Abstractions for the full breadth of the Minecraft protocol.
|
2023-02-12 04:51:53 +11:00
|
|
|
* **Flexible**. Valence provides direct access to the lowest levels of Minecraft's protocol when necessary.
|
|
|
|
* **Modular**. Pick and choose the features you actually need.
|
|
|
|
* **Intuitive**. An API that is easy to use and difficult to misuse. Extensive documentation and examples are important.
|
|
|
|
* **Efficient**. Optimal use of system resources with multiple CPU cores in mind. Valence uses very little memory and
|
|
|
|
can
|
|
|
|
support [thousands](https://cdn.discordapp.com/attachments/998132822864834613/1051100042519380028/2022-12-10_03.30.09.png)
|
|
|
|
of players at the same time without lag (assuming you have the bandwidth).
|
2022-09-04 00:27:49 +10:00
|
|
|
* **Up to date**. Targets the most recent stable version of Minecraft. Support for multiple versions at once is not
|
2023-02-12 04:51:53 +11:00
|
|
|
planned. However, you can use a proxy with [ViaBackwards](https://www.spigotmc.org/resources/viabackwards.27448/) to
|
|
|
|
achieve backwards compatibility with older clients.
|
2022-09-04 00:27:49 +10:00
|
|
|
|
|
|
|
## 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:
|
|
|
|
|
2023-02-12 04:51:53 +11:00
|
|
|
- `valence_nbt`: A speedy new library for Minecraft's Named Binary Tag (NBT) format.
|
|
|
|
- `valence_protocol`: A library for working with Minecraft's protocol. Does not depend on Valence and can be used in
|
|
|
|
other projects.
|
|
|
|
- Authentication, encryption, and compression
|
|
|
|
- Block states
|
|
|
|
- Chunks
|
|
|
|
- Entities and metadata
|
|
|
|
- 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
|
2022-09-04 00:27:49 +10:00
|
|
|
generate Rust code for the project. The JSON files can be used in other projects as well.
|
2023-02-12 04:51:53 +11:00
|
|
|
- Inventories
|
|
|
|
- Items
|
|
|
|
- Particles
|
|
|
|
- Anvil file format (read only)
|
|
|
|
- Proxy support ([Velocity](https://velocitypowered.com/), [Bungeecord](https://www.spigotmc.org/wiki/bungeecord/)
|
|
|
|
and [Waterfall](https://docs.papermc.io/waterfall))
|
2022-09-04 00:27:49 +10:00
|
|
|
|
2023-02-12 04:51:53 +11:00
|
|
|
Here is a [short video](https://www.youtube.com/watch?v=6P072lKE01s) (outdated) showing the examples and some of
|
|
|
|
Valence's capabilities.
|
2022-09-04 00:27:49 +10:00
|
|
|
|
|
|
|
# Getting Started
|
|
|
|
|
|
|
|
## Running the Examples
|
|
|
|
|
2023-02-12 04:51:53 +11:00
|
|
|
After cloning the repository, run
|
2022-09-04 00:27:49 +10:00
|
|
|
|
|
|
|
```shell
|
2023-02-12 04:51:53 +11:00
|
|
|
cargo r -r --example
|
2022-09-04 00:27:49 +10:00
|
|
|
```
|
|
|
|
|
2023-02-12 04:51:53 +11:00
|
|
|
to view the list of examples. I recommend giving `parkour`, `conway`, `terrain`, and `cow_sphere` a try.
|
|
|
|
|
2022-09-04 00:27:49 +10:00
|
|
|
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](https://crates.io/crates/valence). Run `cargo add valence` to add it to your
|
2022-09-07 11:05:57 +10:00
|
|
|
project. Documentation is available [here](https://docs.rs/valence/latest/valence/).
|
2022-09-04 00:27:49 +10:00
|
|
|
|
2022-09-13 21:33:11 +10:00
|
|
|
However, the crates.io version is likely outdated. To use the most recent development version, add Valence as a
|
|
|
|
[git dependency](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories)
|
2022-09-07 11:05:57 +10:00
|
|
|
|
|
|
|
```toml
|
|
|
|
[dependencies]
|
2022-09-13 21:33:11 +10:00
|
|
|
valence = { git = "https://github.com/valence-rs/valence" }
|
2022-09-07 11:05:57 +10:00
|
|
|
```
|
|
|
|
|
2023-02-12 04:51:53 +11:00
|
|
|
View the latest documentation by running `cargo d --open` in your project.
|
2022-09-04 00:34:55 +10:00
|
|
|
|
2022-09-04 00:27:49 +10:00
|
|
|
# Contributing
|
|
|
|
|
2022-10-09 12:08:48 +11:00
|
|
|
Contributions are welcome! Please
|
|
|
|
see [CONTRIBUTING.md](https://github.com/valence-rs/valence/blob/main/CONTRIBUTING.md). You can also
|
|
|
|
join [the Discord](https://discord.gg/8Fqqy9XrYb) to discuss the project and ask questions.
|
2022-07-13 10:50:36 +10:00
|
|
|
|
|
|
|
# License
|
|
|
|
|
2022-09-04 00:27:49 +10:00
|
|
|
Code is licensed under [MIT](https://opensource.org/licenses/MIT) while the Valence logo is
|
|
|
|
under [CC BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/)
|
|
|
|
|
|
|
|
# Funding
|
|
|
|
|
2023-02-12 04:51:53 +11:00
|
|
|
If you would like to contribute financially, consider sponsoring me (rj00a)
|
2022-10-09 12:08:48 +11:00
|
|
|
on [GitHub](https://github.com/sponsors/rj00a)
|
2023-02-12 04:51:53 +11:00
|
|
|
or [Patreon](https://www.patreon.com/rj00a).
|
2022-09-04 00:27:49 +10:00
|
|
|
|
|
|
|
I would love to continue working on Valence and your support would help me do that. Thanks!
|