mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
Fix: living entity kill
Also fix: https://github.com/Snowiiii/Pumpkin/issues/265
This commit is contained in:
@@ -13,4 +13,4 @@ maven_group=de.snowii
|
||||
archives_base_name=extractor
|
||||
# Dependencies
|
||||
# check this on https://modmuss50.me/fabric.html
|
||||
fabric_version=0.107.0+1.21.3
|
||||
fabric_version=0.108.0+1.21.3
|
||||
|
||||
@@ -78,10 +78,11 @@ impl LivingEntity {
|
||||
.await;
|
||||
|
||||
let new_health = (self.health.load() - amount).max(0.0);
|
||||
self.set_health(new_health).await;
|
||||
|
||||
if new_health == 0.0 {
|
||||
self.kill().await;
|
||||
} else {
|
||||
self.set_health(new_health).await;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +143,8 @@ impl LivingEntity {
|
||||
///
|
||||
/// This is similar to `kill` but Spawn Particles, Animation and plays death sound
|
||||
pub async fn kill(&self) {
|
||||
self.set_health(0.0).await;
|
||||
|
||||
// Spawns death smoke particles
|
||||
self.entity
|
||||
.world
|
||||
|
||||
Reference in New Issue
Block a user