aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--azalea-client/src/client.rs4
-rw-r--r--azalea-client/src/plugins/packet/game/mod.rs2
-rw-r--r--azalea-entity/src/lib.rs7
3 files changed, 10 insertions, 3 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs
index 840d373d..05c529b8 100644
--- a/azalea-client/src/client.rs
+++ b/azalea-client/src/client.rs
@@ -683,6 +683,10 @@ impl Client {
/// Get the position of this client.
///
/// This is a shortcut for `Vec3::from(&bot.component::<Position>())`.
+ ///
+ /// Note that this value is given a default of [`Vec3::ZERO`] when it
+ /// receives the login packet, its true position may be set ticks
+ /// later.
pub fn position(&self) -> Vec3 {
Vec3::from(&self.component::<Position>())
}
diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs
index ed8c62ea..42aa0f9b 100644
--- a/azalea-client/src/plugins/packet/game/mod.rs
+++ b/azalea-client/src/plugins/packet/game/mod.rs
@@ -297,7 +297,7 @@ impl GamePacketHandler<'_> {
let entity_bundle = EntityBundle::new(
game_profile.uuid,
- Vec3::default(),
+ Vec3::ZERO,
azalea_registry::EntityKind::Player,
new_instance_name,
);
diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs
index 4893878a..32b0a19f 100644
--- a/azalea-entity/src/lib.rs
+++ b/azalea-entity/src/lib.rs
@@ -140,8 +140,11 @@ impl Debug for EntityUuid {
/// The position of the entity right now.
///
-/// You are free to change this; there's systems that update the indexes
-/// automatically.
+/// You are free to change the value of this component; there's systems that
+/// update the indexes automatically.
+///
+/// Its value is set to a default of [`Vec3::ZERO`] when it receives the login
+/// packet, its true position may be set ticks later.
#[derive(Component, Clone, Copy, Debug, Default, PartialEq, Deref, DerefMut)]
pub struct Position(Vec3);
impl Position {