diff --git a/src/main/java/net/mcreator/superbwarfare/entity/Mk42Entity.java b/src/main/java/net/mcreator/superbwarfare/entity/Mk42Entity.java index 1fd6a56e9..9259e03f3 100644 --- a/src/main/java/net/mcreator/superbwarfare/entity/Mk42Entity.java +++ b/src/main/java/net/mcreator/superbwarfare/entity/Mk42Entity.java @@ -79,7 +79,11 @@ public class Mk42Entity extends Entity implements GeoEntity, ICannonEntity { public void readAdditionalSaveData(CompoundTag compound) { this.entityData.set(COOL_DOWN, compound.getInt("CoolDown")); this.entityData.set(TYPE, compound.getInt("Type")); - this.entityData.set(HEALTH, compound.getFloat("Health")); + if (compound.contains("Health")) { + this.entityData.set(HEALTH, compound.getFloat("Health")); + } else { + this.entityData.set(HEALTH, MAX_HEALTH); + } } @Override diff --git a/src/main/java/net/mcreator/superbwarfare/entity/Mle1934Entity.java b/src/main/java/net/mcreator/superbwarfare/entity/Mle1934Entity.java index 85e97512e..f315b6716 100644 --- a/src/main/java/net/mcreator/superbwarfare/entity/Mle1934Entity.java +++ b/src/main/java/net/mcreator/superbwarfare/entity/Mle1934Entity.java @@ -85,7 +85,11 @@ public class Mle1934Entity extends Entity implements GeoEntity, ICannonEntity { public void readAdditionalSaveData(CompoundTag compound) { this.entityData.set(COOL_DOWN, compound.getInt("CoolDown")); this.entityData.set(TYPE, compound.getInt("Type")); - this.entityData.set(HEALTH, compound.getFloat("Health")); + if (compound.contains("Health")) { + this.entityData.set(HEALTH, compound.getFloat("Health")); + } else { + this.entityData.set(HEALTH, MAX_HEALTH); + } } @Override