r/MinecraftCommands • • 18d ago

Help | Bedrock How can I detect rain?

Working on a thirst bar, and thought it'd be fun if I l made it so when looking up while it's raining would reflenish thirst. I looked through all the commands and I don't think I cound anything?

So I'd not mind any info for what i could do

3 Upvotes

10 comments sorted by

1

u/VladimireUncool Command Rookie 18d ago edited 18d ago

My first instinct would be using cauldrons somehow, as they fill up when it rains.
I'm not too keen on bedrock commands, but i think there's a /testforblocks, in which you can test for a cauldron filled to the first level, then run the thirst-commands, and lastly /setblock the water-cauldron with an empty one to repeat the cycle.

1

u/_Puron 18d ago

The one issue for that is that cauldrons usually take some time before filling up, so it wouldn't be a good way for an instant detection ty for your thoughts though ^ ^

2

u/VladimireUncool Command Rookie 18d ago edited 18d ago

Idk if I remember correctly, but have you tried checking if dry farmland gets wet in the rain?

Also, fire.
Check if daylight sensors turn on, when it rains. If so, hook it up to a command block that sets a block on fire constantly as long as the sensor is on. As soon as it begins raining, the fire will be put out, and another command block will testfor that the fire is put out, and then active the thirst filling process. Although, this might get tricky if it stops raining at night, as the fire would only be respawned during daytime, so I'd consider the farmland method, even though it might take a minute to activate.

2

u/_Puron 18d ago

This may actually work without the daylight dectors :o Cause the Fire itself is the rain check, so if it gets put out it could be detected and it wouldn't be affected by day or night i dont think (?)

1

u/VladimireUncool Command Rookie 18d ago

Yeah, drop the daylight sensors and maybe try with repeaters instead, as there needs to be time in between the fire being put out and it being replaced.

3

u/PlasmaTurtle21 Bedrock command Experienced 18d ago

https://wiki.bedrock.dev/commands/detect-rain

The bedrock command wiki has a section on rain detection using fire.

1

u/theonlygreenleaf Command Experienced 18d ago

On Java I would say just use a predicate I have no idea for bedrock. If you don't find a better solution you might be able to compare a daylight and nightlight detector which in theory can detect rain but I'm not sure how reliable it is.

1

u/Ericristian_bros Command Experienced 16d ago

Bedrock does not have predicates

1

u/theonlygreenleaf Command Experienced 16d ago

I know, it's very sad :( Nor scoreboard triggers… nor a lot of things really. Would be nice for mojang to actually add even half of the command things that exist on java.

1

u/Ericristian_bros Command Experienced 16d ago

Bedrock Behavior packs are more powerful than Java datapacks. So if you want lot of things, take a look at that