#Predicate: Check if player is submerged?

1 messages · Page 1 of 1 (latest)

crisp spindle
#

I know I can test if movement is affected by fluid, but what would you do to know if player is completely submerged? (Consumes oxygen). Check if block at OffsetY = 0 is liquid AND is on water or Y=-1 is liquid?
Is there a property that will make this simpler?

graceful wing
#

The most reliable method would be to check the player's Air and if it's below 300s (the normal max)

#

Every other method would be a combination of at least 2, 3 or more checks. (a water block check at the players eyes, a swim predicate, and a water check at the feet, etc)

crisp spindle
#

That's interesting. Thanks.

#

There's a swim predicate?
Nevermind, I found the tag is_swimming.

rocky cairn
#

I did this with a fluid location check predicate at the players eye location

#

This also triggers if for example only a players head is submerged in a waterlogged block

#

So, if the player is drowning