CodeBlock - Programming
- Mod
- Builtin
- Author: gigaturbo [email protected]Credits: inspired by Gnancraft, ComputerCraft, Visual Bots, TurtleMiner, basic_robot
Tips
Before using this mod, remember to confirm that the mod has been enabled.
CodeBlock allows in-game lua code to build anything you want.
Tips
Search for code
in the item bar, you can find the block and 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.
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.
Tips
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 block is the run block, select the 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.
Note
When placing the Run 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)