8-10 yrs old

11-13 yrs old

14-18 yrs old

Computer Science

Service Learning & Social Good

Learn more how to use Functions in blocks, JavaScript and Python with MakeCode Coding Editor.

avatar Submitted By: Minecraft Education

October 12, 2020


  • Creativity
  • Critical Thinking

Learning Objectives

  • Learn to use functions to make the agent perform repeated tasks in Minecraft: Education Edition.
  • Learn the importance of clearly naming functions.
  • Learn to use multiple functions to complete challenges.
  • Utilize the following National Curriculum Standards for Social Studies K-12: People, Places and Environments
  • Utilize the following CSTA standards: 1A-AP-11, 1A-AP-12, 1A-AP-14, 1B-AP-08, 1B-AP-11, 2-AP-14
  • Utilize the following ISTE standards: 3D, 4A

Guiding Ideas

These learning activities are designed to provide the learner with flexibility and choice in his/her learning.

The learner will be introduced to three tutorials that are at three levels of difficulty (Novice, Intermediate and Expert) which are followed by an educational activity where he/she can apply coding skills.

Within each tutorial, the learner will have the option of selecting a coding language (Blocks, JavaScript or Python).

The learner may choose a tutorial at his/her appropriate difficulty level and language OR choose to complete all tutorials and the educational activity. It will take approximately an hour to complete all activities.


  • Do you have processes that you repeat every day that include multiple small steps to complete the larger task?

Some examples are writing your name, tying your shoes, logging into the computer, solving long division, etc. The small steps build up to form the larger process.

  • Have you ever wanted to perform a set of steps together repeatedly in coding? Why would you want to do this?

There are many examples in our daily life where you are repeating multiple steps over and over again to finish a task. An example could be building a house and stacking blocks to make a wall. 

Student Activities

TUTORIAL 1: AGENT FUN (Novice-5 minutes)

Main objective: The learner will use functions to code the agent and objects to perform specific actions.

Answer Key:

TUTORIAL 2: MODIFYING AGENT FUN (Intermedite-10 minutes)

Main objective: The learner will use functions to code the agent and objects to perform specific actions and change that code to different functions.

Answer Key:


Main Objective: The learner will use organized functions to code the agent to build a house.

Answer Key:


Subject Area: Social Studies: People, Places and Environments – Community Needs and Structure

Main purpose of the activity:

  • The learner will construct a multi-use (Live, work and play) block in a city.
  • The learner’s challenge is to use the agent to construct a model of a city block using functions.

“Craftcity’s mayor has approached you to develop a proposal and model of a city block. The city has an ordinance (rule) that says buildings can only be up to 5 stories high (25 total blocks high). This city proposal will be a new type of city block that is a live, work, play model. You need to focus on using functions with your agent to build a micro-community within your block.”

Outcome of This Activity:

The learner will have successfully coded the agent using functions to build a live, work, play city block that meets the city ordinance.

Possible Solution for this Activity: 

Performance Expectations

Ask the learner about the skills that they have practiced during the activity to reinforce the new concepts.

  • What is a function?

It’s a defined section of code to perform a task that can be easily repeated.

  • How do functions help when coding?

They simplify and condense repeated activities in your program making it easier to debug and find errors. 


  • Creativity
  • Critical Thinking