How can I tell if two Minecraft entities are in the same body of water?
How can I test for two entities, both of which are in the same body of water?
The only way I can think of doing it is having several /testforblock commands, testing for water around the entity, and have another command block testing for other entities within a radius. Then having more command blocks testing for water, and more command blocks having bigger entity testing radius.
So in theory, if the command block finds water, AND an entity, then it will do something, but if it finds land, and an entity, it won't. Will this approach work? Is there a better approach?
Pictures about "How can I tell if two Minecraft entities are in the same body of water?"



How can you tell if a player is in water in Minecraft?
You can detect players who gained the water breathing effect while underwater (but not players who had water breathing beforehand) with @a[scores={difference=0..},nbt=!{ Air:300s}] . It fails to detect players the exact tick they take damage from drowning.How do you check entity data in Minecraft?
You can use the /data command to get, merge and remove NBT tags (formerly called data tags) for entities and block entities. The /data command is most useful for changing attributes of a mob after the mob has spawned or modifying attributes of a block entity after you have placed it.How do you summon entity where you look?
Water physics- You can place water in the following blocks: stairs, slabs, fences, walls, iron bars, glass panes, chests, trap doors, ladders, signs.
- Water can flow out these blocks, but can not flow into them.
- When full of water, they will count as water blocks for all gameplay (such as swimming)
How to Tell if a MOB is POSSESSED in Minecraft!
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Liam Moore, Juan Salamanca, Andrea Piacquadio, Pixabay
