Skip to main content

MenusServerHost

Trait MenusServerHost 

pub trait MenusServerHost {
    // Provided methods
    fn open_menu(
        &mut self,
        uuid: u128,
        rows: u8,
        title: Text,
        items: Vec<Option<ItemStack>>,
    ) -> Result<Option<i32>, StackWriteError> { ... }
    fn close_menu(&mut self, uuid: u128) { ... }
}
Expand description

The server host’s methods of the menus area, implemented by the game and reached through ServerHost.

Provided Methods§

fn open_menu( &mut self, uuid: u128, rows: u8, title: Text, items: Vec<Option<ItemStack>>, ) -> Result<Option<i32>, StackWriteError>

Side: server. Opens a chest menu of rows rows (1 to 6) titled title for the player, showing items (by slot, padded with empty ones), in place of the menu they had open: its window id.

fn close_menu(&mut self, uuid: u128)

Side: server. Closes the player’s native menu (a native_menu_closed follows).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§