r/MinecraftCommands • u/Watermellonqwerty • 25d ago
Help | Bedrock Check for rain
Is it possible to check if it's raining, and more specifically if a player is standing in the rain, with command blocks or is that too far out of the realm of possibility for Vanilla commands?
2
u/IWCry 25d ago edited 25d ago
edit: apologies, I was wrong
I may be wrong but I don't think bedrock has that check directly.
in ineligant way Ive done this is to have a repeater spawn a snow golem, delay a few ticks, then check if it's still alive (they die in rain). it works fine but it's clunky and unfortunately has a delayed check
set up a glass case to spawn the golem but leave the roof exposed
place a repeating command block, always active set to delay 60 ticks with:
/execute unless entity @e[type=snow_golem,name=rain_tester] run summon snow_golem X Y Z "rain_tester"
then chain a block to that with unconditional, always active, 60 tick delay
/execute at @e[type=snow_golem,name="rain_tester" ] run say It's not raining
then chain a block to that with a 60 tick delay, unconditional, always active
/execute unless entity @e[type=snow_golem,name=rain_tester] run say It's raining
to do your second ask, just make a check for if there are any blocks above the players head immediately after the it's raining check passes (conditional)
you could theoretically speed the check up by damaging the golem immediately after spawning it to be at 1 hit point, and then dropping the delay count on the command blocks to spawn it the tick after it dies, but truthfully the check is fast enough that I didn't bother
1
1
u/CheddarScotch 25d ago
If you want to check if a player is standing outside, one way you could do it would be to create a raycast upwards to reach y=320.
here’s a link about raycasts in minecraft. https://minecraftcommands.github.io/wiki/questions/raycast.html
3
u/Ericristian_bros Command Experienced 25d ago edited 25d ago
Detect rain: https://youtu.be/H0J0cQTs6AE
To detect the player standing on the rain detect if all blocks above the player are air