[][src]Macro langcraft_api::insert_asm

macro_rules! insert_asm {
    ($asm:literal) => { ... };
    ($asm:literal, $input:expr) => { ... };
}

Allows inserting commands directly into the code that optionally take an input register.

  • $obj expands to the scoreboard objective used by Langcraft.
  • $0 expands to the argument provided.

With no arguments:

insert_asm!("say hello world");

With an input:

let foo = 42;
insert_asm!("execute if score $0 $obj matches 42..42 run say Foo was 42", foo);