Once he is in the creative zone, he takes charge of his time. He will ask us to help with something and then tell us to go away and then have us come see what he built while he tells us elaborate stories.
There is a kids book called the boring book that captures this process pretty well.
https://www.thriftbooks.com/w/the-boring-book_shinsuke-yoshi...
I limit their time with electronic devices (yt kids, games, etc) because it seems that the devices/services are similar to drugs including withdrawal symptoms.
So getting bored just means having to find something to play with. Lego is a good creative way to spend time. Going outside is also preferable to Minecraft ..
The friends house where they will get TV or video games.