1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00
azalea/azalea-brigadier
2025-06-08 17:44:12 -09:00
..
src insert ClientInformation earlier 2025-06-08 17:44:12 -09:00
tests fix clippy issues and improve formatting everywhere 2025-05-30 19:36:59 -08:00
Cargo.toml release 0.12.0+mc1.21.5 2025-04-13 05:30:40 +03:00
README.md remove executable bit from files 2025-04-04 15:56:06 +00:00

Azalea Brigadier

A Rust port of Mojang's Brigadier command parsing and dispatching library.

Examples

use azalea_brigadier::prelude::*;
use std::sync::Arc;

#[derive(Debug, PartialEq)]
struct CommandSource {}

let mut subject = CommandDispatcher::new();
subject.register(literal("foo").executes(|_| 42));

assert_eq!(
    subject
        .execute("foo", Arc::new(CommandSource {}))
        .unwrap(),
    42
);

See the tests for more.