This question already has an answer here:

My son loves the weather and he would like to use these commands to alter the weather. However, he's tried but nothing seems to work.

How do we use the weather and wm commands?

marked as duplicate by galacticninja, greg-449, Joachim, user232393, Virusbomb Jul 11 at 14:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • While these questions are slightly different, the answer to the duplicate explains how the /weather command works and therefore answers this question. – pppery Jul 11 at 1:11

First, make sure cheats are turned on. Changing the weather in a normal world can give you an advantage, so it is not normally allowed.

The command structure for the weather command is /weather clear/rain/thunder {optional duration}

Not the answer you're looking for? Browse other questions tagged or ask your own question.