Plugin API
Helper Modules
Config, messages, geometry, MiniMessage and other core helpers.
Updated Dec 5, 2026
rocketmc-plugin-api ships pure-Rust helpers on top of the generated API. They need no host support and work with both API worlds. use rocketmc_plugin_api::prelude::*; imports the common ones.
This page covers the core helpers. The rest are grouped by what they do:
- Bukkit-style helpers: player, server, world and entity extension methods
- Menus and displays: items, menus, scoreboards, boss bars, holograms, particles
- Storage and economy: config, player data, economy, leaderboards
- Server toolkit: ranks, regions, homes, warps, kits, moderation
Core helpers
| Module | Similar to | Gives you |
|---|---|---|
config::PluginConfig | getConfig(), saveDefaultConfig() | A TOML file in your data folder with defaults, dotted paths and typed getters |
tasks | runTask, runTaskLater | Task helpers and countdowns |
simple_command::SimpleCommand | CommandExecutor | args[] commands with tab completion |
cooldown::Cooldowns | Cooldown maps | Thread-safe try_use, remaining, reset |
messages | ChatColor, messages.yml | & colour codes, &#rrggbb, {placeholders}, message catalogs |
time | Tick math | parse_ticks("1h30m"), format_duration |
geometry | Vector, BoundingBox | Vec3, BlockVec, BoundingBox, Cuboid, sphere, circle_xz |
location | Location | World, position and rotation; saves as world;x;y;z;yaw;pitch |
key | NamespacedKey | Validated namespace:path keys |
mini_message | Adventure MiniMessage | <red>, <#rrggbb>, <bold>, <gradient:#a:#b>, <rainbow> |
pagination | Help screens | Paginator for list commands |
random | Random, loot tables | Seedable Rng and WeightedTable |
textutil | Formatting helpers | Progress bars, 1,234, 1.5K, 1st, title case |
placeholder | PlaceholderAPI | Placeholders::register("name", |ctx| ..) and apply(text, &ctx) expand {name} and %name% |
chatformat | Chat format plugins | ChatFormat::new("{prefix}{name}: {message}").render(..); strips player & codes unless allowed |
chatfilter | Chat moderation | ChatFilter::new(words).check(msg, previous) for banned words, caps and repeats, plus censor |
use rocketmc_plugin_api::{mini_message, geometry::{BoundingBox, Vec3}};
let banner = mini_message::parse("<gradient:#ff5555:#5555ff>RocketMC</gradient> <bold>ready</bold>");
let arena = BoundingBox::centered(Vec3::new(0.0, 64.0, 0.0), 16.0, 8.0, 16.0);
let inside = arena.contains(Vec3::new(3.0, 65.0, -2.0));
Messages and config together
const DEFAULTS: &str = "[messages]\nhi = \"&aHello {player}!\"\n[limits]\nmax = 3\n";
fn on_load(&self, ctx: Context) -> Result<()> {
let config = PluginConfig::load(&ctx, "config.toml", DEFAULTS).map_err(|e| e.to_string())?;
let messages = MessageCatalog::from_config(&config, "messages");
let max = config.get_i64_or("limits.max", 3);
// messages.component("hi", &[("player", "Steve")]) -> TextComponent
Ok(())
}
PluginConfig needs fs.read.data and fs.write.data. Besides the typed getters (get_str, get_i64_or, get_bool_or, get_string_list and friends) it has set, remove, save and reload.
Not available yet
A plugin manager, plugin-defined custom events and a cross-plugin services registry need host support. Plugins can message each other through IPC in the meantime.