“It’s Always Sunny in Philadelphia” star Rob McElhenney will direct the Warner Bros. adaptation of "Minecraft," developer Mojang announced Tuesday.

The studio snagged the film rights to the wildly popular open-world environment-building video game in February 2014, with Shawn Levy initially pegged to direct. However, he and writers Kieran Mulroney and Michele Mulroney left the live-action project in December, reportedly because their ideas didn't mesh with those of the game's developer.

A co-creator, writer and star of "It's Always Sunny," McElhenney has helmed three episodes of the FX comedy, as well as the upcoming TV movie "Pariah." "Minecraft" will mark his feature directorial debut.

"The LEGO Movie's" Roy Lee will produce the film with Jill Messick.