aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples/testbot/commands/debug.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2025-12-28 21:54:12 -0600
committerGitHub <noreply@github.com>2025-12-28 21:54:12 -0600
commit39488a6585ce969af93f43ece1ffb1174dc95e1d (patch)
tree49b63b2321b974a7c6425e53b8602a0b4500f092 /azalea/examples/testbot/commands/debug.rs
parent25e441944412038da2be4e64854e59169d58305b (diff)
downloadazalea-drasl-39488a6585ce969af93f43ece1ffb1174dc95e1d.tar.xz
Implement `EntityRef` (#299)
* start implementing EntityRef struct * use EntityRef and impl more functions for it * fix doctests * typo * slightly reword some docs * update changelog
Diffstat (limited to 'azalea/examples/testbot/commands/debug.rs')
-rw-r--r--azalea/examples/testbot/commands/debug.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/azalea/examples/testbot/commands/debug.rs b/azalea/examples/testbot/commands/debug.rs
index f11ced45..36c699a4 100644
--- a/azalea/examples/testbot/commands/debug.rs
+++ b/azalea/examples/testbot/commands/debug.rs
@@ -6,13 +6,11 @@ use azalea::{
BlockPos,
brigadier::prelude::*,
chunks::ReceiveChunkEvent,
- entity::Position,
packet::game,
pathfinder::{ExecutingPath, Pathfinder},
- world::MinecraftEntityId,
};
use azalea_core::hit_result::HitResult;
-use azalea_entity::{EntityKindComponent, EntityUuid, metadata};
+use azalea_entity::{EntityKindComponent, metadata};
use azalea_inventory::components::MaxStackSize;
use azalea_world::InstanceContainer;
use bevy_app::AppExit;
@@ -40,7 +38,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) {
source.reply("You aren't in render distance!");
return 0;
};
- let position = source.bot.entity_component::<Position>(entity);
+ let position = entity.position();
source.reply(format!(
"You are at {}, {}, {}",
position.x, position.y, position.z
@@ -54,7 +52,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) {
source.reply("You aren't in render distance!");
return 0;
};
- let entity_id = source.bot.entity_component::<MinecraftEntityId>(entity);
+ let entity_id = entity.minecraft_id();
source.reply(format!(
"Your Minecraft ID is {} and your ECS ID is {entity:?}",
*entity_id
@@ -219,10 +217,10 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) {
.nearest_entities_by::<(), With<metadata::Player>>(|_: ()| true);
let tab_list = source.bot.tab_list();
for player_entity in player_entities {
- let uuid = source.bot.entity_component::<EntityUuid>(player_entity);
+ let uuid = player_entity.uuid();
source.reply(format!(
"{} - {} ({:?})",
- player_entity,
+ player_entity.id(),
tab_list.get(&uuid).map_or("?", |p| p.profile.name.as_str()),
uuid
));