Struct Minecraft

Source
pub struct Minecraft { /* private fields */ }
Expand description

Struct containing functions and a Connection struct.

Implementations§

Source§

impl Minecraft

§Panics

All functions implemented on the Minecraft struct might panic if the API is not running anymore or packages fail to send. This might change in a 0.2.0 version of this crate

Source

pub fn post_to_chat(&mut self, msg: &str)

Post a message to the chat

Source

pub fn get_block(&mut self, pos: &TileVec3) -> u8

Get the block at a specific position

Source

pub fn get_block_with_data(&mut self, pos: &TileVec3) -> Vec<u8>

Get the block with data at a specific position

Source

pub fn get_blocks(&mut self, pos1: &TileVec3, pos2: &TileVec3) -> Vec<u8>

Get a array of blocks contained in the specified area

Source

pub fn get_blocks_with_data( &mut self, pos1: &TileVec3, pos2: &TileVec3, ) -> Vec<Vec<u8>>

Get a array of blocks with their data contained in the specified area

Source

pub fn set_block(&mut self, pos: &TileVec3, blocktype: u8, blockdata: u8)

Set a block at a specific position

Source

pub fn set_blocks( &mut self, pos1: &TileVec3, pos2: &TileVec3, blocktype: u8, blockdata: u8, )

Fill the specified area with the a block

Source

pub fn get_height(&mut self, pos: &TileVec3) -> i8

Get the highest point at the specified position

Source

pub fn save_checkpoint(&mut self)

Save the current world state as a checkpoint

Source

pub fn restore_checkpoint(&mut self)

Restore a previously saved world state

Source

pub fn setting(&mut self, setting: &str, status: bool)

Set a world setting to true or false. Available settings: “world_immutable”, “nametags_visible”

Source

pub fn get_player_entity_ids(&mut self) -> Vec<u16>

Get a list of entity ids for all online players

Source

pub fn player(&mut self) -> Player<'_>

Get a instance of the Player struct containing player related functions

Source

pub fn entity(&mut self) -> Entity<'_>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.