The Meaning of Life, the Universe, and Everything.
Join Date:
1/7/2019
Posts:
46
Minecraft:
JohnTempest
Member Details
So I'm trying to detect if a player is underwater and realized that with the new swimming animation, I can's assume the block above the player's feet will be water if they are swimming so I decided to use the following commands to detect if the player is underwater.
execute at @p anchored feet if block ^ ^ ^ minecraft:water run tag @p add FeetInWater
execute at @p anchored eyes if block ^ ^ ^ minecraft:water run tag @p add HeadInWater
It's my understanding that this should work, but for whatever reason, the command anchored at eyes still detects the block at the player's feet. Does anyone understand why this happens and how to fix it?
So I'm trying to detect if a player is underwater and realized that with the new swimming animation, I can's assume the block above the player's feet will be water if they are swimming so I decided to use the following commands to detect if the player is underwater.
execute at @p anchored feet if block ^ ^ ^ minecraft:water run tag @p add FeetInWater
execute at @p anchored eyes if block ^ ^ ^ minecraft:water run tag @p add HeadInWater
It's my understanding that this should work, but for whatever reason, the command anchored at eyes still detects the block at the player's feet. Does anyone understand why this happens and how to fix it?
Thanks!
execute as @a at @s anchored feet if block ^ ^ ^ minecraft:water run tag @s add FeetInWater
execute as @a at @s anchored eyes if block ^ ^ ^ minecraft:water run tag @s add HeadInWater
How about this?
Rollback Post to RevisionRollBack
Advertisement Board
1. New minigame for Christmas! (Yes it's over, I know...) Check it out!
2. If you found my command solutions helpful, try to make my work worthwhile by crediting me. However, if you are to credit me, let me do it by:
Joining the map server or giving me a download link to add stuff.
This is mainly because I don't want some simple signs mentioning my name or my stupid head sticking to the wall.
So I'm trying to detect if a player is underwater and realized that with the new swimming animation, I can's assume the block above the player's feet will be water if they are swimming so I decided to use the following commands to detect if the player is underwater.
It's my understanding that this should work, but for whatever reason, the command anchored at eyes still detects the block at the player's feet. Does anyone understand why this happens and how to fix it?
Thanks!
How about this?
Joining the map server or giving me a download link to add stuff.
This is mainly because I don't want some simple signs mentioning my name or my stupid head sticking to the wall.
Works perfectly!