Added get_player_entity_ids() function

master
blackfur 2021-03-18 12:00:11 +01:00
parent 9247775b92
commit 8fa51daae4
1 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,7 @@ use std::cmp::{min, max};
#[cfg(test)]
mod tests {
use crate::{create, Vec3};
use crate::{create};
#[test]
fn it_works() {
@ -108,6 +108,10 @@ impl Minecraft {
pub fn setting(&mut self, setting:&str, status:bool) {
self.conn.send(&format!("world.setting({},{})",setting,if status == true {1} else {0}));
}
pub fn get_player_entity_ids(&mut self) -> Vec<u16> {
self.conn.send_receive(&format!("world.getPlayerIds()")).split("|").map(|s| s.parse()).collect::<Result<Vec<u16>, _>>().unwrap()
}
}
pub fn create(adress:&str) -> Minecraft {