diff --git a/crates/horizon-client/src/game/creatures.rs b/crates/horizon-client/src/game/creatures.rs index 5533d0311..40bba9cca 100644 --- a/crates/horizon-client/src/game/creatures.rs +++ b/crates/horizon-client/src/game/creatures.rs @@ -3040,7 +3040,7 @@ impl Game<'_> { if let Some(m) = self.mobs.iter_mut().find(|m| m.id == id) && m.damage(4.0, source) { - m.extra.levitation = 200; + m.add_effect("minecraft:levitation", 200, 0); // Shulker.hurtServer: a shulker hit by a bullet. horizon_client::mobs::shulker::hit_by_bullet(m); } diff --git a/crates/horizon-client/src/mobs.rs b/crates/horizon-client/src/mobs.rs index 083d0ee4a..21affe4d1 100644 --- a/crates/horizon-client/src/mobs.rs +++ b/crates/horizon-client/src/mobs.rs @@ -709,7 +709,6 @@ pub struct Extra { pub anger: i32, pub carried: Option, pub charged: bool, - pub levitation: i32, /// Held item ids (main hand, off hand) and head item. pub main_hand: Option>, pub off_hand: Option>, diff --git a/crates/horizon-client/src/mobs/living.rs b/crates/horizon-client/src/mobs/living.rs index 4c5866857..2de7297ef 100644 --- a/crates/horizon-client/src/mobs/living.rs +++ b/crates/horizon-client/src/mobs/living.rs @@ -997,8 +997,14 @@ impl Mob { movement.y = 0.2; } let mut y = movement.y; - if self.extra.levitation > 0 { - y += (0.05 * 1.0 - movement.y) * 0.2; + // LivingEntity.travelInAir: levitation lifts by its amplifier. + if let Some(&(_, _, amp)) = self + .extra + .effects + .iter() + .find(|e| e.0 == "minecraft:levitation") + { + y += (0.05 * f64::from(amp + 1) - movement.y) * 0.2; } else { y -= self.gravity(); }