Sniff is a "Scratch-like" programming language that's designed to help Scratchers move gently from Scratch to more conventional languages. They can start writing programs, without having to learn a new language because Sniff is based on Scratch. They learn a little more about variables, compiling, syntax errors (!), and they can have fun controlling real hardware while they're doing it.

Monday, 24 March 2014

Release 5 = Minecraft

The Beta 5 release is now available on the Downloads page, and it contains lots of fixes, and improvements. However the one you're really interested in is Minecraft support!!!

While we love our gadgets, the main concept of Sniff is that its a programming language that lets experienced Scratch users move on to a "written" language that they will be familiar with. The need for this is made clear looking at the Python and Java examples that are provided with the Raspberry Pi version of Minecraft.

Minecraft has been released as a free download for Pi, with an option for external programs to tap into it, so that kids can learn to program by writing scripts to build things inside the 3D world. It's a great idea which is let down by the fact that one look at that examples provided will send any kid running and screaming. They're not particularly complex examples but even for an experienced (non-Python) programmer the syntax,  and code overhead makes them look difficult and hard to follow.

This exactly what Sniff is designed to avoid - Kids already know Scratch, which means that the Sniff syntax is familiar, so they can jump straight into problem solving, and making things! Introducing the Sniff Minecraft Device!

make minecraft device
make message string
make mcX number
make mcY number
make mcZ number
make blockType number
make blockData number

You make minecraft device and its variables like any other Sniff device. This sets up the connection to Pi Minecraft running on the current machine (if you want to use a different machine you can edit lib/Xminecraft.c - not recommended for public editing, but its pretty easy).

Now we can start doing things:

when start
.set message to "Sniff woz here"
.tell minecraft to "show"

broadcasts the message!

.set mcX to 5
.set mxZ to 5
.tell minecraft to "getHeight"
.tell minecraft to "setPos"

Moves the player to square (5,6). However before doing so, it checks the height of the land at that square, which sets mcY to the right value (Y is up) so that the player is standing on the ground rather than flying (or burried!). You can also check the players position with "getPos"

Now lets build a tower:

when start
.set mcX to 0
.set mcY to 0
.set mcZ to 0
.
.repeat 100
..tell minecraft to "getBlock"
..if blockType = 0
...set blockType to 1
...set blockData to 0
..else
...set blockType to 0
...set blockData to 0
..
..tell minecraft to "setBlock"
..change mcY by 1
..wait 0.2 secs
.
.set message to "like my tower?"
.tell minecraft to "show"

We set x/y/z to 0 (the spawn point). We check the block at that position, which gives us the blockType (ID). In addition blockData tells is more about the block (http://minecraft.gamepedia.com/Data_values). If the block is currently air (type 0), then we set it to 1 (stone), which builds a tower. If there's already a block there (because we've run the code before) we delete it by setting it to air.

There are other aspects to the Minecraft API, but they either provide duplicate ways of doing things we can already to with these functions, or they're not completely implemented/documented in the current release of minecraft for Pi. If I've missed anything that we should add, then either add it yourself (the files are there for you to change, and we'd love to receive your improvements), or email/DM/leave a comment letting us know.

So what are you waiting for? Go program Minecraft using Scratch like syntax!

71 comments:

  1. Minecraft is a online game which is played by numerous users. You can find out the best minecraft servers by visiting Bisecthosting.

    ReplyDelete
  2. A lot of games will bombard you with various controls, tutorials, how to guides and even beginner guides just to get started with playing the game.school unblocked games

    ReplyDelete
  3. There are two kinds of boys. The first types are those who you would find easily approachable, flirting with girls or completely extrovert and type two are those who like sitting at home, playing games. And unfortunately, type two is more as compared to type one. That's the secret!buy csgo accounts

    ReplyDelete
  4. I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. http://minebrowse.com/

    ReplyDelete
  5. I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. Free Minecraft Players

    ReplyDelete
  6. Sharing such resources can negatively impact on the performance of your gaming world. A dedicated server supports multiple player slots, thus allowing players to expand their online community.minecraft server hosting

    ReplyDelete
  7. Think you can't make money playing your favourite video game? Ever been told that all those hours spent on Minecraft was a waste of time? Well think again, now you too could be making money from home. minecraft windows 10 code

    ReplyDelete
  8. Can I say what relief to uncover somebody that truly knows what theyre referring to on the web. You definitely learn how to bring a concern to light to make it essential. Lots more people ought to look at this and understand this side in the story. I cant believe youre less common because you absolutely possess the gift. Madden Overdrive Coins Hack

    ReplyDelete
  9. A capable engineer called Markus Persson is the man behind Minecraft; the outside the box sandbox building game. download game mod apk

    ReplyDelete
  10. Figure you can't bring in cash playing your preferred computer game? Ever been informed that each one of those hours spent on Minecraft was an exercise in futility? https://serverbrowse.com/minecraft-server-advertising/

    ReplyDelete
  11. I like to use Mod Game apps, this is a very nice app, I like it I have downloaded them on https://gameschurch.com/, here I see a more quality version. Especially muscle clicker mod apk is my favorite game here.

    ReplyDelete
  12. There are several Minecraft host companies out there that offer a variety of servers for purchase. Many add-ons often consume further resources. In this case, it is crucial to consult your Minecraft host prior to the installation of plugins in order to make sure you have proper resources available. https://serverbrowse.com/

    ReplyDelete
  13. Runes get a sort of customization to the League of Legends.how many people play league of legends

    ReplyDelete
  14. I needed to thank you for this incredible read!! I unquestionably adored each and every piece of it. I have you bookmarked your site to look at the new stuff you post. https://serverbrowse.com/

    ReplyDelete
  15. This is truly a decent and enlightening, containing all data furthermore greatly affects the new innovation. A debt of gratitude is in order for sharing it https://pewdiepiemerch.net/pewdiepie-clutch-chair-review/

    ReplyDelete
  16. Minecraft Server Advertising I curious more interest in some of them hope you will give more information on this topics in your next articles.

    ReplyDelete
  17. This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: Minecraft Server Advertising

    ReplyDelete
  18. We are tied directly into the sate’s renewal database which allows us to process your request almost instantly. Minecraft Advertising Services

    ReplyDelete
  19. Many sites just like MMOGAH have managed to supply the desire to buy osrs gold securely on the web so you could have an edge over all the online players around you. Via trading along with exchanging, game enthusiasts could receive ample gold in their accounts giving them an outstanding experience buy osrs gold in the video game. To receive old school runescape gold, it was earlier considered as a major challenge although now people can get it very easily on MMOGAH.

    ReplyDelete
  20. Additionally, a person receives 60 power volumes of the exceptional personality in the game and also players will find 8 races as well as nine modules in the game which helps to really make the online game more amusing. There are plenty of features in the game such as high-quality graphics, best sound quality, plus much more. A player can easily select the best performing persona within classic wow gold the game and game enthusiasts could also find a number of significant things in this incredible game including weaponry, equipment, tools, and much more.

    ReplyDelete
  21. Whatever the task, whether it's a game or something else, you can enjoy it only when you are free from the hassle of writing. Masters Dissertation Writing Services is the one which can write your academic work at affordable rates.

    ReplyDelete
  22. It's all about getting noticed before your friends whenever you decide to wear these glitter bands. Choose from a wide range glitter rubber bands that go with every outfit. These enhance your personality and make you look stylish in every way possible. glitter for sale

    ReplyDelete
  23. You need to take part in a contest for Multiplayer one of the greatest sites on the web. I am going to highly recommend this website!

    ReplyDelete
  24. The title rings so many bells in gamers heads so it is worthy of the title „one of, if not the best computer grand theft auto 6 mods game series of all time“. Seeing the details it is not hard to see why GTA is so positively looked at around..

    ReplyDelete
  25. Having the option to possess part of your own territory or your entire world is serious for Minecraft players. Pc games

    ReplyDelete
  26. These CSGO Accounts have Special Medals, Rare Coins, Exotic Trophies & Loyalty Badges Main reason to purchase These CSGO High tier Accounts is to replace your Main CSGO Prime Accounts to give Similar or Better Experience.

    ReplyDelete
  27. All of our League of Legends accounts are new and have been leveled especially for our customers, so you have the chance of a complete restart with an untouched MMR of ranked games.buy lol account

    ReplyDelete

  28. You've made some good points there. I looked on the internet for additional information about the issue and found most people stream vods will go along with your views on this website.

    ReplyDelete
  29. We are a hosting company for gamers by gamers. We serve games that nobody else has, with the fastest support time. We prioritize security and reliability.For more detail check our website valheim unlimited slots host

    ReplyDelete
  30. Good website! I truly love how it is easy on my eyes it is. I am wondering how I might be notified whenever a new post has been made. I have subscribed to your RSS which may do the trick? Have a great day! mid tier csgo prime accounts

    ReplyDelete
  31. The perspective on putting resources into your own Minecraft worker may look as though it is expensive and overwhelming.runescape gold

    ReplyDelete
  32. Like all sites Fiverr.com has a few agreements that should be followed to ensure both purchaser and dealer. Right now the site is accessible to anybody matured 13 and over, isn't restricted to a specific nation and doesn't permit any brutal, spam or illicit sort gigs. Other than that, anybody can sell their gifts and administrations there. So what would you be able to offer on this site? Here's eight plans to begin with... slope

    ReplyDelete
  33. Great articles and great layout. Your blog post deserves all of the positive feedback it’s been getting. valorant account for sale

    ReplyDelete
  34. The symbol that you play as has a pickaxe, which permits him to obliterate these squares, just as lay new ones. CPS Test

    ReplyDelete
  35. PUBG employs a physics engine that can make your car react in a realistic way to bumpy, unstable terrain, so head's up: you will end up going airborne. If you're not great with bumps, stay between the lines and stick to the road for a (generally) smoother ride. apex legend account for sale

    ReplyDelete
  36. ARK Green works to nurture nature by providing effective lawn fertilizer services with the best lawn care, pest control treatment, tree care services and best yard services.

    ReplyDelete
  37. If you want to play Red Alert online with friends, family or with other gamers, here is how to get started right now! This is the best, fastest way to do it using the OpenRA free open source software!
    play red alert online

    ReplyDelete
  38. Vbucksmania is the most trusted & used get free vbucks generator on the internet . we are proud to help more than 2000 fortnite players get free vbucks everyday . we also offer free fortnite skins . all this is thanks to our sponsors.

    ReplyDelete
  39. Minewind is an enhanced-vanilla Minecraft Server List. Where people have virtually no rules to fight, anything but cheating goes. Kill players, grief, use deception and play the way you...

    ReplyDelete
  40. Carolinas Child Care is a Day Care Center that provides home daycare services with the help of effective child care resources and a pleasant and secure environment

    ReplyDelete
  41. this is really nice to read..informative post is very good to read..thanks a lot! buy fifa 21 account for sale

    ReplyDelete
  42. A Cloud Hosting Provider can make any webmaster achieve better results over the online market, without really putting so much finance in the web hosting procedure. Cloud Server Hosting is boosting every nook and corner of web hosting from its day of inception. https://onohosting.com/

    ReplyDelete
  43. It is a great website.. The Design looks very good.. Keep working like that!. need of speed

    ReplyDelete
  44. Oh my goodness! Incredible article dude! Thank you, However I am having difficulties with your RSS. I don’t understand the reason why I cannot join it. Is there anybody else having the same RSS issues? Anybody who knows the answer will you kindly respond? Thanks!!
    Minecraft Servers

    ReplyDelete
  45. An fascinating discussion is value comment. I think that it is best to write extra on this matter, it won’t be a taboo topic however generally people are not enough to talk on such topics. To the next. Cheers 꽁머니사이트

    ReplyDelete
  46. You Can Check Whether The Record Is A Prime Cs:Go Account Or Purchased Cs:Go With Cash. Along These Lines, You Will Have Data About Whether The Record You Need To Purchase Is Significant csgo commends bot

    ReplyDelete
  47. Contribution of children in computerized gaming is an aftereffect of numerous huge changes in the way of life and culture of the advanced society. mobile games

    ReplyDelete
  48. I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! ufabet เว็บตรง

    ReplyDelete
  49. birthday wishes for colleagues . Hope these birthday wishes for colleagues and coworkers will help you to write a sweet birthday message and images.

    ReplyDelete
  50. Generally it is quite hard in order to particularly categorize companies in to particular support dependent designs Exact api. This really is due to the fact lots of companies often include various systems as well as methods to the real formula from the company structure.

    ReplyDelete
  51. You're more awful than any privateer cruising the high oceans of warez. Or if nothing else, that is the thing that distributers need us to think. Regardless of whether you reserve the privilege to sell the items you have bought is unimportant: the offer of utilized games is harming the games business. play retro bowl

    ReplyDelete
  52. Minecraft APK Free Download. All ever-released versions of Minecraft Pocket and Bedrock Edition are available here to download.

    ReplyDelete
  53. Another effective way in controlling pests is using the biological method. This is the method of using pest's natural enemies to control them. Spiders, centipedes, ground beetles and ants are some of the beneficial bugs. This method is not harmful to people in any means and can be implemented effectively. убиване на дървеници

    ReplyDelete
  54. They additionally give an outlet to deliver hostility and dissatisfaction, subsequently helping in diffusing pressure. A few games additionally include actual work, for example, Nintendo Wii boxing helping children to enga. minecraft server list

    ReplyDelete
  55. We have sell some products of different custom boxes.it is very useful and very low price please visits this site thanks and please share this post with your friends. dofollow

    ReplyDelete
  56. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also hcf minecraft servers 100

    ReplyDelete
  57. A few years back, a game named Minecraft was launched. Soon, it became one of the most popular games and tons of people from across the world became fan of it. Minecraft Servers

    ReplyDelete
  58. This is the perfect post. It helped me a lot. If you have time, I hope you come to my site and share your opinions. Have a nice day. 바카라사이트

    ReplyDelete
  59. I have been looking for articles on these topics for a long time. I don't know how grateful you are for posting on this topic. Thank you for the numerous articles on this site, I will subscribe to those links in my bookmarks and visit them often. Have a nice day 토토사이트

    ReplyDelete
  60. I am looking for and I love to post a comment that "The content of your post is awesome" Great work! minecraft account generator

    ReplyDelete
  61. My name is Asim Hameedi and I am a board-certified best cardiologist in New York, Practicing non-invasive and interventional cardiology since 2003. My undergraduate degree is from St. John’s University, Queens, NY. Doctor of Medicine is from SUNY Downstate Health Science Center, Brooklyn, NY.

    ReplyDelete
  62. A few years back, a game named Minecraft was launched. Soon, it became one of the most popular games and tons of people from across the world became fan of it. Minecraft Server List

    ReplyDelete
  63. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. Minecraft Server List

    ReplyDelete
  64. You've heard your message, but you don't know very well what Manga is or why your family are so attracted to it? Get the lowdown from someone that knows what Manga concerns and offers us five things you'll love about it. 4anime

    ReplyDelete
  65. Dissertation Pros offer reasonable, custom services to students who need them. We provide multiple warranties, like refunds and zero-plagiarism, to serve as proof of our reliability (we will include plagiarism reports if you request!). and many people are struggling in finance dissertation so that's why we are providing the cheap finance dissertation writing service

    ReplyDelete
  66. Perhaps a game has a touch of savagery. That doesn't make it awful; it simply makes it some unacceptable kind of game for a seven year old.Please check my site

    ReplyDelete
  67. Many students are willing to pay to do assignments, But they are not sure which website is providing the best service for assignment help. UK Assignments Help is a premier source of help and guidance for students seeking academic help services. Our experts diligently work on your project, bringing you top-notch quality work every time. Get the best do my assignment UK services from us.

    ReplyDelete

  68. If you are looking for the best essay writing service then the UK essay writing service is the best option for you. We are of the top UK essay writing companies. Our coursework help online includes professional and best editing teams who scan the paper thoroughly. When the cheap coursework help online returns the project, it is not only unique and informative but also an error-free project

    ReplyDelete
  69. Now a days many students are disturb from academic projects. So, we are here with the solution. We at British Assignments Help write students' assignments according to their specifications and make every effort not to miss a single detail. Our professional assignment writers UK provides plagiarism free assignment written as per instructions, customised and integrated for success.


    ReplyDelete
  70. Very neat article post. Really looking forward to read more. Will read on...
    minecraft servers list

    ReplyDelete
  71. Game.Guide is focused on providing the best mobile & PC gaming guides. We cover games such as Minecraft, Roblox & Gacha mobile games.

    ReplyDelete