Martye
Posts: 3
Joined: Thu Nov 24, 2016 11:14 am

Using Scratch with Minecraft

Thu Dec 08, 2016 10:23 am

Hi, I wanted to know if anyone has used Scratch with Minecraft. I have used Python with Minecraft with older children but wondered if there was a way to do the same thing with Scratch for younger ones so that they are not having to focus on learning elements of Python at the same time.

I have seen some online examples but it is not clear if I need to make any updates the Pi's in order for me to be able to do this. Any help is appreciated.

Marty

timrowledge
Posts: 1284
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Using Scratch with Minecraft

Fri Dec 09, 2016 12:02 am

Well it's on my list of things to try, but not near the top. If you want to try to persuade the foundation that it is important then maybe it would get raised near the top...

There *is* a Squeak to MineCraft interface - see http://croquetweak.blogspot.ca/2013/02/ ... i.html?m=1 and I'd anticipate building on that to connect to Scratch since Scratch is a Squeak application.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

mob-i-l
Posts: 267
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Google+ Twitter YouTube

Re: Using Scratch with Minecraft

Wed Mar 15, 2017 5:24 pm

It is possible to control Minecraft PI Edition using the built-in Scratch 1.4, see this project:
https://scratch.mit.edu/projects/13703270/
Also see this video:
http://www.youtube.com/watch?v=LyxO5gANs3I
I've not tested this in a long time, so something could have changed that breaks it.
Last edited by mob-i-l on Fri Mar 17, 2017 7:39 am, edited 1 time in total.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/

timrowledge
Posts: 1284
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Using Scratch with Minecraft

Wed Mar 15, 2017 5:40 pm

Interesting - I'd never heard of that before. Unfortunately it seems to be no longer possible to download 1.4 project files via the 'embed' feature because there appears to be no such feature. I suppose that's one way of trying to kill off non-Flash Scratch.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

mob-i-l
Posts: 267
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Google+ Twitter YouTube

Re: Using Scratch with Minecraft

Wed Mar 15, 2017 8:00 pm

timrowledge wrote:Unfortunately it seems to be no longer possible to download 1.4 project files via the 'embed' feature because there appears to be no such feature.
It's possible to download from Scratch here, see Download 1.4 Project after clicking on Embed (maybe you need Flash in the browser for this to work).
It is here too: https://github.com/mobluse/raspberry-pi ... 3703270.sb
Last edited by mob-i-l on Fri Mar 17, 2017 7:38 am, edited 1 time in total.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/

ghp
Posts: 1409
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: Using Scratch with Minecraft

Thu Mar 16, 2017 11:55 pm

Hello,
exercised the python library mentioned in the scratch project today and it works. It is not very stable, so from time to time connection was lost and the mediator needed a restart.
The challenges in coding have been the coordinate system, x, z lay flat and y is height; and the box number '0' seems to be something like 'void', with a box type '35' I could build some piles.
And minecraft pi grabs the mouse pointer, so it was needed to pause this when changes in scratch have been needed.
Regards,
Gerhard

mob-i-l
Posts: 267
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Google+ Twitter YouTube

Re: Using Scratch with Minecraft

Fri Mar 17, 2017 8:13 am

ghp wrote:The challenges in coding have been the coordinate system, x, z lay flat and y is height; and the box number '0' seems to be something like 'void', with a box type '35' I could build some piles.
And minecraft pi grabs the mouse pointer, so it was needed to pause this when changes in scratch have been needed.
Yes, the coordinate system in Minecraft is unusual, but it probably comes from 2D first, and there y usually goes up.

The block ID 0 is AIR and 35 is WOOL. For the rest of the IDs see this file in Raspbian Jessie:
/opt/minecraft-pi/api/java/src-api/pi/Block.java
The wool colors are defined in:
/opt/minecraft-pi/api/java/src-api/pi/Color.java
E.g. 0=WHITE, 1=ORANGE, 2=MAGENTA, 3=LIGHT_BLUE, 4=YELLOW, 5=LIME, 6=PINK, 7=GRAY, 8=LIGHT_GRAY, 9=CYAN, 10=PURPLE, 11=BLUE, 12=BROWN, 13=GREEN, 14=RED, 15=BLACK

I found an ID-list with sub-IDs that might be useful:
http://minecraft-ids.grahamedgecombe.com/

You can press Tab to release the mouse, see https://www.raspberrypi.org/learning/ge ... worksheet/
Have Pi0&1A&1B&1B+&2B&3B&4B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/

ghp
Posts: 1409
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: Using Scratch with Minecraft

Sun Mar 19, 2017 11:17 pm

Hello,
inspired from scratch2mcpi-program, I added a MinecraftAdapter to scratchClient.
This adapter decouples scratch interface and minecraft api by a queue, thus allowing different speeds. Tried to build some large arrangements of blocks and found no one missing.
There is a sample scratch-script in scratch/minecraft/minecraft.sb; the config file is config/config_minecraft.xml

Usage is quite simple:
start minecraft on pi
start scratchClient with command line argument -c config/config_minecraft.xml
start scratch sample program ~/scratchClient/scratch/minecraft/minecraft.sb

Image
Have fun,
Gerhard

Return to “Scratch”