1
SETTING UP FOR YOUR ADVENTURE
Installing the Minecraft Python API and Spigot
Running Spigot and Creating a Game
Starting Over with a New World
Installing the Minecraft Python API and Spigot
Running Spigot and Creating a Game
Starting Over with a New World
Getting to Know the Python Shell
Say Hello to IDLE’s Text Editor
When to Use the Python Shell and When to Use the Text Editor
Testing Your Minecraft Python Setup
The Structure of Programming Languages
Changing the Values of Variables
Mission #1: Teleport the Player
Mission #2: Go Exactly Where You Want
Slowing Down Teleportation Using the time Module
Mission #3: Teleportation Tour
Mission #4: Fix the Buggy Teleportation
3
BUILDING QUICKLY AND TRAVELING FAR WITH MATH
Mission #7: Change the Blocks Under You
Using Math Operators in Arguments
Mission #9: Spectacular Spires
Parentheses and Order of Operations
Mission #10: Super Jump Somewhere New!
Mission #11: Hello, Minecraft World
Mission #12: Write Your Own Chat Message
Concatenating Integers and Floats
Mission #13: Add Usernames to Chat
Converting Strings to Integers with int()
Mission #14: Create a Block with input
Mission #15: Only Numbers Allowed
5
FIGURING OUT WHAT’S TRUE AND FALSE WITH BOOLEANS
Mission #17: Stop Smashing Blocks!
Mission #19: Am I Standing in Something Other Than Air?
Greater Than or Equal To and Less Than or Equal To
Mission #20: Am I Above the Ground?
Mission #21: Am I Close to Home?
Mission #22: Am I Entirely Underwater?
Mission #24: Is This Block Not a Melon?
Is My Number Between Two Others?
Mission #25: Am I in the House?
6
MAKING MINI-GAMES WITH IF STATEMENTS
Mission #27: Prevent Smashing, or Not
Chaining Together elif Statements
Mission #29: Teleport to the Right Place
Mission #30: Open a Secret Passage
Using if Statements to Test a Range of Values
Mission #31: Restrict Teleport Locations
Boolean Operators and if Statements
7
DANCE PARTIES AND FLOWER PARADES WITH WHILE LOOPS
Mission #33: A Random Teleportation Tour
Controlling Loops with a Count Variable
Boolean Operators and while Loops
Checking a Range of Values in while Loops
Mission #37: Make a Dance Floor
Nested if Statements and while Loops
Ending a while Loop with break
Mission #39: Create a Persistent Chat with a Loop
8
FUNCTIONS GIVE YOU SUPERPOWERS
Mission #43: Block ID Reminder
Using if Statements and while Loops in Functions
Mission #44: Wool Color Helper
Mission #45: Blocks, Everywhere
9
HITTING THINGS WITH LISTS AND DICTIONARIES
Other Useful Features of Lists
Mission #52: Night Vision Sword
Accessing Items in Dictionaries
Mission #53: Sightseeing Guide
Changing or Adding an Item in a Dictionary
Deleting Items in Dictionaries
10
MINECRAFT MAGIC WITH FOR LOOPS
Mission #60: The Diamond Prospector
Nested for Loops and Multidimensional Lists
Generating 2D Lists with Loops
Mission #62: A Weather-Worn Wall
Mission #63: Duplicate a Building
11
SAVING AND LOADING BUILDINGS WITH FILES AND MODULES
Part 1: Writing the To-Do List
Part 2: Displaying the To-Do List
Importing One Function with the from Clause
Importing All Functions with *
Storing Lots of Data with the shelve Module
Adding, Modifying, and Accessing Items with shelve
Mission #66: Save a Collection of Structures
Part 1: Saving a Structure to a Collection
Part 2: Loading a Structure from a Collection
Installing New Modules with pip
Using pip on a Mac or Raspberry Pi
Using a Module from pip: Flask
12
GETTING CLASSY WITH OBJECT-ORIENTED PROGRAMMING
Adding New Methods to Subclasses