Lesson plan

The Experiment

Students use events, event handlers, and variables to solve coding puzzles and navigate a time-travel obstacle course in Minecraft.

The Experiment
Ages
Ages 8-10
Duration
1 hour
Essential question

How can we use events and variables in code to interact with and change the world around us?

Overview

In this lesson, students step into a narrative where a malfunctioning time-travel device has trapped them in a historical time loop. To escape and find the time gate, learners must adopt a coding mindset and apply foundational computer science concepts to solve environmental challenges.

Using Minecraft Education, learners tackle five hands-on coding challenges. They configure event handlers to grant fire resistance and jump boosts, manipulate variables to count placed blocks and cycle block IDs, and coordinate multiple event triggers to control in-game weather.

Learning objectives

By the end of this lesson students will be able to:

  • Apply events and event handlers to trigger player abilities and environmental changes.
  • Create and update variables to track block counts and change block states.
  • Test and debug code to overcome physical obstacles in the world.
  • Recognize that multiple algorithms can successfully complete a coding task.

Blocks and items used in this lesson

Key vocabulary

Event
An action or occurrence recognized by software, such as walking, swimming, or placing a block.
Event Handler
A coding block that waits for an event to occur and executes instructions in response.
Variable
A named storage location in a program that holds a value that can be changed.
Forever Loop
A programming loop that repeats its instructions continuously while the program is running.

Before class

Lesson sequence

Suggested timing: about 60 minutes in total.

  1. Introduction and Narrative Setup10 min

    Introduce the time loop scenario from the classroom presentation. Explain the core goals: navigating obstacles to reach the time gate by coding with events, event handlers, and variables.

  2. Movement Code: Lava Swim and The Climb15 min

    Guide students through Activities 1 and 2. In Activity 1, students code an On Player Swim event handler with lava resistance default values to cross a shallow lava lake. In Activity 2, students use a Forever event to apply Jump Boost 2, enabling them to jump 2.5 blocks high and reach the next area.

  3. Variables in Action: Building and World Shift20 min

    Direct students to Activities 3 and 4. Students use On Block Placed to increment a counter variable and speak the count, placing at least 34 pyramid blocks (iron, gold, diamond, or emerald) until a beacon appears. Next, they use On Player Walk to increase a count variable that places blocks by ID (1=Stone, 2=Grass, 3=Dirt) at specific coordinates to open a doorway.

  4. Advanced Challenge: Make it Rain!10 min

    Students complete Activity 5 by linking multiple events together. They set variables to true when distinct events fire, then run a forever loop that monitors these variables and makes it rain once all conditions are met.

  5. Formative Assessment and Wrap-Up5 min

    Review key vocabulary and have students answer the lesson reflection questions verbally or on the printable assessment sheet from the educator guide.

Assessment: success criteria

  • Student successfully configures event handlers to survive crossing the lava lake and jump 2.5 blocks high.
  • Student creates a working counter variable that updates upon placing blocks until 34 pyramid blocks are placed.
  • Student uses player movement to increment a variable and place sequential block IDs to open the doorway.
  • Student accurately defines an event, a variable, and names at least two event handlers during assessment.

Differentiation

Support

Help students locate the default value settings for fire resistance and Jump Boost 2 within their code blocks.

Stretch

Encourage students to test different block types for their pyramid or design unique combinations of event handlers to trigger the rain event.

Knowledge check

5 questions to check understanding after the lesson. Tap an answer to see if it is right; the score appears at the end.

  1. 1In Activity 2, how high does Jump Boost 2 allow the player to jump?

  2. 2What is the minimum number of blocks students must place to complete the pyramid in Activity 3?

  3. 3Which event handler is used in Activity 1 to grant fire resistance?

  4. 4In Activity 4, which block type corresponds to block ID 1?

  5. 5How do students trigger the weather change in Activity 5?

Resources

Part of the Coding Fundamentals curriculum

This is lesson 14 of 17 in Coding Fundamentals.

  1. Basic Moves and the Agent
  2. Coding Challenge
  3. Dinosaur Run
  4. Earth’s Moon & Mars
  5. Ganymede (Jupiter's Moon) & Saturn's Rings
  6. Gray Wolves
  7. Mercury and Venus
  8. Minecraft Space Center
  9. Panda's Protected Habitat
  10. Polar Bear Rescue
  11. Revisiting Biomes
  12. Revisiting Planets
  13. Sea Turtle Assistance
  14. The Experiment
  15. Uranus’ Rings and Neptune's Moon, Triton
  16. We Need Beets!
  17. Wild West

Frequently Asked Questions

Do students need to swim through deep lava in Activity 1?

No, the lava lake is only one block deep, so students do not need to swim, but they must use the On Player Swim event handler to gain fire resistance.

Which materials are allowed when building the pyramid in Activity 3?

Students can construct the pyramid using iron, diamond, gold, or emerald blocks.

Where can the printable questions for assessment be found?

A printable version of the formative assessment questions is provided at the end of the educator guide in the supporting files.

Adapted from The Experiment by Minecraft Education on Minecraft Education, last updated Feb 4, 2025. This classroom version, the timings and the quiz were written by 9Minecraft Education.

You May Also Like

9Minecraft Education is an independent teaching resource and is not affiliated with Mojang or Microsoft. Lesson plans here are our own classroom-ready adaptations; each one links to the original resource and credits its author. © 2026 9minecraft.net