mojira.dev
MC-221510

Dolphin would rather drown than get air when chasing items

Around my underwater base that I am building, I have dolphins attached to fence with enough movement space to reach the surface of the ocean. However, if there is an item in the water near a dolphin, it will drown because it would rather try getting the item (despite not reaching it) than move to the surface for air. I've had to completely rinse seagrass and kelp around my pillars just to make sure they don't drop for whatever reason.

(All dolphins are named and do not despawn without reason, and I'm sure this is the reason why they sometimes vanish)

I have attached screenshots showing this process, and I felt very bad while doing this experiment. I'm sorry about torturing a dolphin for the sake of this.

Reproduce

  • Build a tank of water with no roof

  • Put a glass floor in the middle of the tank (so there is water on both sides of the glass floor

  • Summon a dolphin on the top part of the tank so it can access the air

  • Drop an item below the middle glass floor

  • Wait
    ❌ Notice the dolphin tries to reach the item but fails and eventually drowns

Expected Result

The dolphin would go up for air and not try to get the item

Attachments

Comments 7

⚠️ Please do not mark Unreleased Versions as affected. You don't have access to them yet.

-- I am a bot. This action was performed automatically! Please report any issues on Discord or Reddit

My does that option even exist then, yes, I know this is a bot

Thought the same thing to be honest. But that's unrelated. My dolphins keep dying because of items somehow being near them 😞

anthony cicinelli

I was able to reproduce in 1.17.1 I've added some reproduction steps and an expected result to the report

Code analysis (Mojang mappings, 22w44a): Dolphin.DolphinPlayWithItemsGoal does not check the dolphin's air supply. A potential fix would be to add a this.dolphin.getAirSupply() check to the canUse() function inside the goal, like Dolphin.DolphinSwimToTreasureGoal does.

Can confirm in 1.19.3

Can confirm in 24w14a.

WhiteApes

(Unassigned)

Confirmed

Mob behaviour

Dropped_Item, dolphin

1.16.5, 21w11a, 1.17.1, 22w44a, 1.19.3, 1.20.1

Retrieved