Thursday, August 26, 2021

Coding in Minecraft - Free Choice

 Yesterday I was doing coding class and I heard that we were using Minecraft Education Edition to code. I was super excited because we were gonna use the agent to help us build and destroy blocks. Here is some of the code we did (BTW I am using Python code.):

def greeting():
player.say("hello Nicole")
player.on_chat("hi", greeting)

This is the code we started with. When we type in the chat "hi", it will say "hello Nicole". You can change the name but just be aware to not make the 2 words 'greeting' different. Here is what it should look like:
There are many types of code names such as Javascript, C, C++, Python, Ruby etc... I am using Python and we made lots of commands to make the agent move, spin around and even check the id of a block! Each block has an id such as:
Stone = 1
Cobblestone = 4
Oak Wood Planks = 5
Sand = 12
And so and so...

You can copy paste the code and try it out yourself!
Bye Bloggers! See you on the next blog!

2 comments:

  1. Kia ora Nicole,

    I have been enjoying reading your blog so much that I have put as a feature blog on our Facebook. I like how you have made quality blogs based on your creation! You definitely show you have learnt something, you created and you shared.
    Well done Nicole.

    ReplyDelete
    Replies
    1. Thank you so much Miss Laxa! I'm surprised you did that. Hope you like my other blogs!

      Delete