MINECRAFT MODDING - CODING
Pair Programming

This is a technique used when writing computer programs where two programmers work together at a workstation. One, the driver, writes code while the other, the observer or navigator, reviews each line of code as it is typed in. The two programmers switch roles frequently. It has many benefits: where the programmers skills are shared, less errors are made, programmers enjoy the experience more, and better solutions are found.
TASK
Get into a pair.
Find out what experience your partner has with Minecraft and programming.
TASK
Get into a pair.
Find out what experience your partner has with Minecraft and programming.
Terminology
The following terms are important to understand:
Algorithm, Block-based programming, CamelCase convention, Commenting code, Commenting out, Compound logical operator, Control structure, Function, Loop, Pseudocode, Variables.
TASK
Algorithm, Block-based programming, CamelCase convention, Commenting code, Commenting out, Compound logical operator, Control structure, Function, Loop, Pseudocode, Variables.
TASK
- Open a Google doc in your DTC folder. Name it Programming Terminology.
- Go to technology.tki.org.nz/Glossary#glossary_31688 and find the terms and their meanings. Add them to the doc.
Important Hotkeys
1. The ESC key (top left of the keyboard) enable the user to pause and leave the Minecraft game
2. The t key activates the console at the bottom of the Minecraft game window which is where commands can be entered
3. The e key activates the inventory
4. The space key when double clicked allows the player to fly
5. The right-click on an agent allows the player to see the agents inventory
2. The t key activates the console at the bottom of the Minecraft game window which is where commands can be entered
3. The e key activates the inventory
4. The space key when double clicked allows the player to fly
5. The right-click on an agent allows the player to see the agents inventory
MINECRAFT Essential Commands
There are a number of / (slash) commands, settings, special features of the Education Edition and general know how that is required to use Minecraft effectively. This link is a good start to learning or updating what you might already know. These commands can be used in the Minecraft Console which is accessed by pressing t.
https://education.minecraft.net/support/knowledge-base/commands/
https://education.minecraft.net/support/knowledge-base/commands/
TASK
- Download the Command Worksheet file (Save in your Minecraft folder), use the commands link above to find out what the commands do and how to use them.
- Fill in the worksheet. You should test the commands as you go to see if you can get them to work.
CODING - using MakeCode
MAKECODE
MakeCode is a blocky language and it can be used to make Mods for Minecraft. Mods allow the player to run code inside Minecraft to spawn, build, plant etc. The mod can be saved and used over and over by typing a keyword into the console. MakeCode was developed by Microsoft and can be used in other programming environment such as robotics or electronics. In the Minecraft MakeCode PXT (Programming eXperience Toolkit) there is a tutorial which we will use to create our mods. When organising your screen it may be useful to place the MakeCode window and Minecraft window side-by-side as shown.
|
Mod folder
- Create a Mods folder in your Minecraft folder on your School Networked storage location. Use this folder to save your mods.
- Each mod should have a descriptive name (one that describes what the mod does). For example the chickens mod might be called chickens10. This would mean that this mod creates 10 chickens.
Mod Tutorials
To learn about the MakeCode language there are many tutorials. These create fun and exciting events in your Minecraft world. Click for tutorials.
Some of these tutorials are called: Agent move Super digger Agent build Fast forward Chicken rain Billboard Mega jump Compass rose Flower trail Spleef etc... Have a go and complete the number of tutorials the LL asks you to. |
Events
An event in computer science is an action or occurrence that is detected by a computer. For example, when someone clicks the button on their mouse, it generates a “mouse click event” for the computer. In real life, there are also events that might be associated with an action, like cause and effect. Here are some examples:
Event Action
It starts raining People open umbrellas
The bell rings Students go to class
The power button is pressed The computer turns on
The mouse button is clicked An application opens
Unplugged Activity: Events and Handlers
Activity: Last Stand at the Alamo!
Six thinking hats reflection activity
Event Action
It starts raining People open umbrellas
The bell rings Students go to class
The power button is pressed The computer turns on
The mouse button is clicked An application opens
Unplugged Activity: Events and Handlers
Activity: Last Stand at the Alamo!
Six thinking hats reflection activity
Coordinates in Minecraft are 3D like (x,y,z)
Coordinates Overview
In Minecraft, it’s important to know where you are in the world, where your agent is, and where all kinds of things from diamond mines, to woodland mansions, to underground spawners are. In Survival mode, it’s even more important to be able to get back to a safe place when the sun starts to go down, or to remember the location of points of interest so you can find them again if your inventory is full and you need to come back. To find your World Position and your Agents World Position: press F1 An overview of coordinates absolute and relative Unplugged Activity: Classroom Coordinates Activity: Minecraft Moving Company |
|
Variables (types of variables are: number, string & boolean)
Learning Pseudocode
What is pseudocode? That is a good question and now that you are familiar with modding it's a good time to learn about pseudocode. If we ask the wikihow,com website this is what they say. "Pseudocode is an informal tool that you can use to plan out your algorithms. As you begin to write more complex code, it can be hard to keep an entire program in your head before coding it. Think of pseudocode as a step-by-step verbal outline of your code that you can later transcribe into a programming language. It is a combination of human language and programming language: it mimics the syntax of actual computer code, but it is more concerned with readability than with technical specificity." https://www.wikihow.com/Write-Pseudocode Open the Pseudocode Worksheet |
|
|
|
MakeCode has a website that can be used to help you understand how the MakeCode Programming Language works. Try https://minecraft.makecode.com/docs
|
This worksheet helps you to understand what you have been doing in some of the programming exercises you have been doing.
Open the worksheet here |
Climbing WorksheetThis worksheet uses sensing of the environment to help the Agent to climb a wall.
Open the worksheet here Extension Add some string output to the Minecraft screen to explain what the agent is doing. Use a 'say' command. |
Sensing Worksheet
|