Get started with GameTest Framework

Use script and structures to build scaffolds and tests

In every complex Minecraft creation you build, you’ll want to run through your gameplay scenarios over and over again, to make sure that everything is working the way you expect. The easier it is to replay or try out certain experiences, the quicker you can get back to building. Over the years, many creators have used careful systems of base save worlds, test environments, and reset functions to replay everything in various states of their worlds. At the same time, Minecraft is an ever-evolving game, and new capabilities can sometimes cause wrinkles in existing Add-Ons and worlds. So – in addition to scaffolding and testing during the building process, you’ll want to double check your creations as Minecraft evolves to ensure that everything works the way you expect. 

GameTest Framework – an experimental feature in Minecraft – is a scaffolding toolset that allows you to build, test, and run your custom Add-Ons and worlds. With GameTest Framework, you can build out individual tests and mechanisms to try out ideas and validate that those environments work as expected. Minecraft itself comes with over 300 built-in tests, which you can run by enabling the GameTest Framework experiment in a world and running the /gametest runset command. See our published guide for more on how to get started with GameTest Framework.

To build your own tests in GameTest Framework, you create Minecraft Structures (.mcstructures) and write JavaScript to set up and test for conditions. A Minecraft Structure is essentially any slice of existing worlds you’ve created and saved out via the in-game Structure Block. JavaScript provides a simple experience for setting up environments (for example, spawning mobs) and testing that those conditions have been met. We have a growing set of script APIs to help you build out scenarios and modify the world within the mojang-gametest and mojang-minecraft modules.   

To build your first GameTest, use this tutorial to get started. We also have an open community for sharing useful and interesting GameTests up on GitHub.  We welcome your open-source contributions to this repository! If you’ve got a particularly clever test or just want to share a replayable GameTest with the community, follow the instructions over on the GitHub repo to make a submission. 

Whether you’re building your first Minecraft gameplay world, looking to further validate your complex Add-Ons, or simply sharing an interesting Minecraft mini-replay with the community, take a look at building new GameTest Framework tests to create replayable Minecraft experiences. And when you are done, consider sharing your best tests with the community.  

We can’t wait to see what you build!

Written By
Mike Ammerlaan
Published

    Block...Block...Block...