Skip to main content

Crate basalt_api

Crate basalt_api 

Source
Expand description

Basalt public plugin API.

This crate is the single dependency for all Basalt plugins. Types are organized into focused modules:

  • prelude — essentials for every plugin (glob import this)
  • components — ECS component types (Position, Velocity, etc.)
  • system — system registration (SystemContext, Phase, etc.)
  • command — command argument types (Arg, CommandArgs, etc.)
  • types — primitive Minecraft types (Uuid, Slot, TextComponent, etc.)
  • world — block states, collision, block entities

Re-exports§

pub use context::Response;
pub use events::Event;
pub use events::EventBus;
pub use events::Stage;
pub use plugin::CommandEntry;
pub use plugin::Plugin;
pub use plugin::PluginMetadata;
pub use plugin::PluginRegistrar;

Modules§

broadcast
Broadcast message types for cross-player communication.
budget
Cooperative CPU budget for tick-based systems.
command
Command argument types, parsing, validation, and dispatch. Command system: argument types, parsing, validation, dispatch.
components
Component types and marker trait for the Entity Component System.
container
Container types shared across the Basalt crate ecosystem.
context
Event dispatch context, trait definitions, and response queue.
events
Game events and the event bus.
gamemode
Gamemode type for the Minecraft protocol.
logger
Plugin logger with automatic target prefixing.
player
Player identity for event dispatch contexts.
plugin
Plugin trait and registration API.
prelude
Prelude module — import this in every plugin.
recipes
Plugin-facing wrapper around the recipe registry that dispatches registry-lifecycle events.
system
System registration types for the plugin API.
types
Primitive Minecraft types.
world
World access: block states, collision, block entities, chunk storage. World access: block states, collision, block entities, chunk storage.

Macros§

game_cancellable_event
Implements Event and EventRouting for a cancellable event dispatched on the game loop’s bus.
game_event
Implements Event and EventRouting for a non-cancellable event dispatched on the game loop’s bus.
instant_cancellable_event
Implements Event and EventRouting for a cancellable event dispatched on the instant loop’s bus.
instant_event
Implements Event and EventRouting for a non-cancellable event dispatched on the instant loop’s bus.