Plugin API
Menus and Displays
Item builders, chest menus, sidebars, boss bars, holograms, particles and tab lists.
Updated Dec 5, 2026
All of these are guest-side helpers in rocketmc-plugin-api, in the prelude unless noted.
| Module | Similar to | What it gives you |
|---|---|---|
item_builder::ItemBuilder | ItemStack + ItemMeta | Fluent builder: amount, name, lore, enchant, custom_enchant, attribute |
menu | Inventory GUI listeners | Chest menus with per-slot click handlers. Clicks and drags are cancelled for you |
paged_menu | Paginated GUI | PagedMenu::new(title, items).open(&player, page) with previous and next buttons, 45 items per page |
sidebar | Scoreboard sidebar | A per-player sidebar with up to 15 lines (Java players) |
bossbar | Bukkit.createBossBar | create, and show_timed for a draining countdown bar |
hologram | Holograms | Hologram::spawn(world, pos, lines), set_lines, remove, built on text display entities |
shapes | Particle effects | circle, sphere, line and helix generators plus draw and draw_for |
tablist | Tab list and below-name | set_tab_header_footer, set_tab_name, set_tab_listed, set_tab_header_footer_all, BelowName |
prompt | Conversations | prompt::ask(&player, question, timeout_s, |server, player, answer| ..) |
forms | Bedrock forms | Native forms for Bedrock players |
A chest menu
Call menu::install once, then build a fresh Menu every time you open one. open consumes the menu, and only one menu is active per player.
use rocketmc_plugin_api::{prelude::*, Item};
fn on_load(&self, ctx: Context) -> Result<()> {
menu::install(&ctx)?;
prompt::install(&ctx)?; // only if you use prompt
Ok(())
}
fn open_shop(player: &Player) {
let mut shop = Menu::new(3, "&8Shop");
shop.set_button(
13,
ItemBuilder::new(Item::Diamond).name("&bBuy a diamond").lore(["&7Cost: 10 coins"]).build(),
|_server, click| click.player.send_message("&aPurchased!"),
);
shop.fill_empty(|| ItemBuilder::new(Item::GrayStainedGlassPane).name(" ").build());
shop.on_close(|_server, _player| { /* save state */ });
shop.open(player);
}
Holograms and prompts
Holograms and prompts are not saved. Respawn holograms in on_load and remove them in on_unload. Hologram::spawn takes the World handle by value.
prompt::ask(&player, "&eHow many?", 20, |_server, player, answer| {
player.send_message(&format!("&aYou typed {answer}"));
});
Timed boss bar and particles
use rocketmc_plugin_api::{shapes::{self, Plane}, geometry::Vec3, particles::Particle};
// a bar that drains over 30 seconds, then removes itself
let handle = bossbar::show_timed(vec![player], "&cEvent starts soon", BossBarColor::Red, 30);
// a ring of flames
let ring = shapes::circle(Vec3::new(0.5, 65.0, 0.5), 2.0, 40, Plane::Xz);
shapes::draw(&world, Particle::Flame, &ring);
show_timed takes its players by value and returns a TaskHandle. Run cargo doc -p rocketmc-plugin-api --open for the exact signatures of every module.