Flat Fixer in MakeCode for Minecraft

 

Flat Fixer is a program that repairs an area of a world on which structures have been built and perhaps the grass and dirt have been destroyed.

The Flat Fixer code is explained more thoroughly in the video. The first code segment in Flat Fixer, checks the on-chat argument values to verify they are in the correct range. If not, they are set to default values. The variable origin is set to be the initial player world position, but just above were the grass would normally be in a flat world.

Flat Fixer Code 1

Flat Fixer 1 of 3

Air is repaired one Y value at a time in a for loop, one pass through the loop for each Y value. A loop is used instead of varying Y in a fill, because repairs may be needed to high in the sky, say 100 blocks, causing fill block limits to be exceeded.

Flat Fixer Code 2

Flat Fixer 2 of 3

Two layers of dirt are restored above the bedrock at Y = 1 and Y = 2. The grass is restored at Y = 3.

Flat Fixer Code 3

Flat Fixer 3 of 3

Flat Fixer is a companion program to Bang. Using the two programs, Bang can make a mess and Flat Fixer can clean it up again and again and …

Get the Code

The code is shared at  https://makecode.com/_LC4dzUPe4bYg where it can be downloaded and run in MakeCode for Minecraft.

Flat Fixer  code is shared on Code Connection at this URL

 https://makecode.com/_LC4dzUPe4bYg

To get and use the code, follow these steps.

Click the Import button import button , which is upper right in the Code Connection window just below the banner. This will open the window shown below.
Import choices

Click the Import URL button Import URL, which is on the right, to open the window shown below.

Import Copy link

Paste the URL supplied for the program you want to use in the space under the text “Copy the URL …”
import url with url

Click the Go ahead! button go ahead button.

The next window you will see will be the MakeCode window with the code downloaded from the URL. At this point, you can treat it like any other code, e.g., run it, save it locally, modify it, publish your changes or whatever else your heat desires.

We have tested several other methods of downloading the code using the URL, for example, pasting the URL in a browser. No joy. For more detailed instruction see our post How to Use Shared MakeCode on Microsoft Code Connection for Minecraft.

One thought on “Flat Fixer in MakeCode for Minecraft

  1. Pingback: Bang! — Simulating an On-TNT-Exploded Event in MakeCode for Minecraft | We Code MakeCode

Comments are closed.