1 00:00:00,000 --> 00:00:05,020 Hour of Code Minecraft | Events 2 00:00:05,020 --> 00:00:10,320 On this next level, you can pick to be either Steve or Alex. 3 00:00:10,320 --> 00:00:16,670 Press the arrow buttons on your keyboard to move up, down, left, and right. 4 00:00:16,670 --> 00:00:20,890 Now you can move around a level wherever you want. 5 00:00:20,890 --> 00:00:27,340 To use a creature, just walk towards it, turn to face it, and press the spacebar. 6 00:00:27,340 --> 00:00:34,280 If you're using a touch screen, swipe up, down, left, and right to move around. 7 00:00:34,280 --> 00:00:38,829 Then tap the game to use the item in front of you. 8 00:00:38,829 --> 00:00:41,100 But what happens when you use it? 9 00:00:41,100 --> 00:00:46,851 In Minecraft, sheep drop wool when you shear them, cows run away when you hit them, and 10 00:00:46,851 --> 00:00:51,219 creepers explode when you get near them. 11 00:00:51,219 --> 00:00:55,440 These reactions happen thanks to something called events. 12 00:00:55,440 --> 00:01:00,010 Events tell your program to listen or wait for when something happens. 13 00:01:00,010 --> 00:01:02,859 And when it does, perform an action. 14 00:01:02,859 --> 00:01:08,340 So far, you've used one event. Code you put in the "when spawned" slot runs when your 15 00:01:08,340 --> 00:01:12,120 creature is created or when the game starts. 16 00:01:12,120 --> 00:01:17,780 Over the next few levels you'll have new slots for events such as "when touched" that runs 17 00:01:17,780 --> 00:01:23,060 when you touch the creature, or "when used" for when you use the creature. 18 00:01:23,060 --> 00:01:29,820 Or, if you want your zombie to disappear when the sun comes up, put that in the "when day" slot