#bevy #gamedev #asset #assets


Bevy plugin adding support for common asset formats such as json and yaml

6 releases (breaking)

new 0.6.0 Mar 18, 2023
0.5.0 Mar 6, 2023
0.4.0 Nov 13, 2022
0.3.0 Jul 30, 2022
0.1.0 May 1, 2022

#216 in Game dev

Download history 188/week @ 2022-11-27 104/week @ 2022-12-04 103/week @ 2022-12-11 208/week @ 2022-12-18 150/week @ 2022-12-25 241/week @ 2023-01-01 219/week @ 2023-01-08 170/week @ 2023-01-15 121/week @ 2023-01-22 213/week @ 2023-01-29 314/week @ 2023-02-05 464/week @ 2023-02-12 616/week @ 2023-02-19 279/week @ 2023-02-26 427/week @ 2023-03-05 446/week @ 2023-03-12

1,828 downloads per month
Used in 2 crates


362 lines

Bevy common assets

crates.io docs license crates.io

Collection of Bevy plugins offering generic asset loaders for common file formats.

Supported formats:

format feature example
json json json.rs
msgpack msgpack msgpack.rs
ron ron ron.rs
toml toml toml.rs
xml xml xml.rs
yaml yaml yaml.rs


Enable the feature(s) for the format(s) that you want to use.

Define the types that you would like to load from files and derive serde::Deserialize and bevy::reflect::TypeUuid for them. The latter requires a unique uuid as an attribute:

#[derive(serde::Deserialize, bevy::reflect::TypeUuid)]
#[uuid = "413be529-bfeb-41b3-9db0-4b8b380a2c46"] // <-- keep me unique
struct Level {
    positions: Vec<[f32;3]>,

With the types ready, you can start adding asset plugins. Every plugin gets the asset type that it is supposed to load as a generic parameter. You also need to configure custom file endings for each plugin:

use bevy::prelude::*;
use bevy_common_assets::json::JsonAssetPlugin;
use bevy_common_assets::msgpack::MsgPackAssetPlugin;
use bevy_common_assets::ron::RonAssetPlugin;
use bevy_common_assets::toml::TomlAssetPlugin;
use bevy_common_assets::xml::XmlAssetPlugin;
use bevy_common_assets::yaml::YamlAssetPlugin;

fn main() {
        .add_plugin(JsonAssetPlugin::<Level>::new(&["level.json", "custom.json"]))
        // ...

#[derive(serde::Deserialize, bevy::reflect::TypeUuid)]
#[uuid = "413be529-bfeb-41b3-9db0-4b8b380a2c46"]
struct Level {
    positions: Vec<[f32; 3]>,

The example above will load Level structs from json files ending on .json.level or .custom, from ron files ending on .ron.level and so on...

See the examples for working Bevy apps using the different formats.

Compatible Bevy versions

The main branch is compatible with the latest Bevy release.

Compatibility of bevy_common_assets versions:

bevy_common_assets bevy
0.5 - 0.6 0.10
0.4 0.9
0.3 0.8
0.1 - 0.2 0.7
main 0.10
bevy_main main


Dual-licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~890K SLoC