From 709c5dbc19ffb8c47e001b1d5c14846ee69e7988 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 15 Nov 2022 20:44:33 +0000 Subject: add Client::metadata --- azalea-client/src/client.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'azalea-client/src') diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 282de48f..2aef1709 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -910,6 +910,12 @@ impl Client { Ok(()) } + + /// Get the player metadata for ourselves. You can use this to get your + /// health, xp score, and other useful information. + pub fn metadata(&self) -> metadata::Player { + self.entity().metadata.clone().into_player().unwrap() + } } impl From> for HandleError { -- cgit v1.2.3