im looking around the fishes and waterentity files looking for the code that make water mobs to sufocate on land, but i cant find it, all i could find was this, but it wont do anything on my custom mob:
// what this thing do
protected void updateAir(int p_209207_1_) {
if (this.isAlive() && !this.isInWaterOrBubbleColumn()) {
this.setAir(p_209207_1_ - 1);
if (this.getAir() == -20) {
this.setAir(0);
this.attackEntityFrom(DamageSource.DROWN, 2.0F);
}
} else {
this.setAir(300);
}
}
public void baseTick() {
int i = this.getAir();
super.baseTick();
this.updateAir(i);
}
//
i solved this myself; if the mob already got a drown code, delete it and put this on its place (goes below mob atrributes):
//DIE ON LAND CODE - REPLACE DROWN CODE WITH THIS
protected void updateAir(int p_209207_1_) {
if (this.isAlive() && !this.isInWaterOrBubbleColumn()) {
this.setAir(p_209207_1_ - 1);
if (this.getAir() == -20) {
this.setAir(0);
this.attackEntityFrom(DamageSource.DROWN, 2.0F);
}
} else {
this.setAir(300);
}
}
public void baseTick() {
int i = this.getAir();
super.baseTick();
this.updateAir(i);
}
// DIE ON LAND END
im looking around the fishes and waterentity files looking for the code that make water mobs to sufocate on land, but i cant find it, all i could find was this, but it wont do anything on my custom mob:
i solved this myself; if the mob already got a drown code, delete it and put this on its place (goes below mob atrributes):