
Pets somehow drowning
SpaceNerd95251 opened this issue ยท 6 comments
Sometimes, my pets will drown. I'm not 100% how this is happening, since the spots they are drowning in are areas where they could easily swim up to the surface. For clarification, this happens when they are independent
Hm... I had issues with drowning pets in the past due to Spectrum's Liquid Crystal (you can walk in it like normal, but you can't breathe in it), so much so I patched it inside FettLol (maybe I should lift this into IndyPets or PR it to Spectrum), though I don't think I've had them drown in plain water.
From a quick test, pets appear to float up water just fine even when the player is not near:
Do you maybe have flowing currents that they could get stuck in/under?
Note that their "anti-drown behavior" is literally pressing space so they float straight up.
Just one block where they could get stuck is enough - pets will find any danger eventually.
That does appear to be the problem. The places where they drowned didnt have flowing current (well, one did, but that was more of a waterfall leading to the ocean where he drowned, not a flowing source block in the ocean). But it seems the places where they drowned did have a block directly above that cut off. I guess the AI isn't programmed to move even a single block over if the block they are surfacing at is blocked off. Unfortunate, but not your fault, just something you wouldn't notice in vanilla since tamed pets normally either follow you or sit, so they wouldn't do this.
just something you wouldn't notice in vanilla since tamed pets normally either follow you or sit, so they wouldn't do this
Yeah, there's a lot wrong with vanilla pets (as in 2eb8bfc, cats don't even try to put themselves out of fire).
I'll see if anything can be done to prevent them drowning like this, though it'll probably mean adding AI behavior, which I could only really do for vanilla pets, but that's better than nothing I suppose.
Saving pets is hard. Currently experimenting with adding a "danger" to be escaped when a pet has little air left, so it'll panic before drowning and run to another position.
Issue is that even with the panic speed boost, it can't escape flowing water:
I still wonder if you don't have some water death traps somewhere, because in testing I had trouble keeping the pets underwater as they would just naturally wander out of there.
Another thought: Maybe they didn't drown in water? I remember having pets die inside a wall because of an automated piston.
Nvm, that would say "suffocated in a wall".
As far as I know, both places where they died (they were named so it said the coords in the console) were places that weren't flowing water, had a block directly above the water, and had other water blocks (that weren't flowing) next to them without a block above, meaning they theoretically had the option to go there and swum up and been fine
Just released 1.4.2 with the drowning panic - I haven't fixed the flowing water issue but it might still help.
Also lifted the fix for cats not caring about being on fire for 1.16 - 1.18 (Mojang fixed that in 1.19).
I'm not sure if this is enough to help your situation, so let me know if there's still an issue.