CodeBlock - Programming

  • Mod
  • Builtin
  • mod
  • education
  • programming
  • lua
About 1 min


Before using this mod, remember to confirm that the mod has been enabled.

CodeBlock allows in-game lua code to build anything you want.



Search for code in the item bar, you can find the run block and write block in creative mode (or have give permission) Click on the square to get it. Currently, since there is no formula for making blocks, they can only be given by parents in survival mode.

Writing is the box for writing code, and the code editor can be opened by right-clicking on the mouse (double-clicking on the right operating area for Android).

For first time use, you can use the chat command /codegenerate to get some example code.


How to send chat commands, please refer to "In-Game Management: Send Commands".


Double-click on the file to open the corresponding code.


The last line added is to call the line function to draw a straight line with a length of 12 "meters" (the length of a block is agreed to be one meter in the game world). The material of the line is not specified and is random.

Then click Save to save the code, then click Load and Close to load and close the editor.

The Run block is the run block, select the Run block, then go to the place you want to build and place (right mouse button) to run![Run](. /dp.png) box, and then hit (the left mouse button) the run! Run box, you can.


When placing the RunRun block, the direction you are facing is the direction in which to run.



Finally, after modifying this sentence, execute it again:

line(forward, 12, blocks.air)
Last update: 6/29/2023, 10:40:54 PM
Contributors: Riceball LEE