In the last project, we learned how to infinitely place blocks with a forever/infinite loop. In this project, we will learn how to loop an area of blocks and how to make the loop stop after some period of time. When we are done, our program will dig giant tunnels for use wherever we move!
First, add the code into your project as shown. Here we see a new function, “postToChat”.
This function does exactly what it says, it posts the given text into the chat inside Minecraft. Since this program will have a start and an end, we will use this chat to let us know when the program has started/ended.
We also see a new import for the “time” library. We’ll see why this is here later.
Feel free to test out the code to see it in action!