Minecraft Pocket Edition - now with carrot cake.

Since discovering that you can play Minecraft on your phone, one thing has been bothering me. You can take flour, eggs, milk, and sugar to make a cake, or flour and cocoa beans to make chocolate chip cookies, or even pumpkin, egg, and sugar to make a pumpkin pie, and yet despite having a perpetual surfeit of carrots, there is no way for me to craft a carrot cake - the best cake that there is.

Delightfully, even though this is a phone app, there are various ways to add your own items and patches. On Android, I used BlockLauncher Pro (£2.54, or the identical free version, which has ads). This allows you to add custom texture packs and little scripts in ModPE. It was difficult to find a comprehensive tutorial or documentation, so I used other people's scripts, this useful function list, and trial and error to work out how to create my cake.

I started by making an icon for the cake. It needs to be a 16 x 16 PNG.

Large pixel art carrot cake

This is the image that will be shown in the inventory, and will be held in the player's hand.

To tell Minecraft PE to use it, you need to zip it up in the correct folder structure. The path to the image is 'images/items-opaque/carrot_cake_0.png'. In the root of the folder is a meta-data file called 'pack.mcmeta'. This contains the description of your image pack:

{
  "pack": {
    "pack_format": 1,
    "description": "Carrot cake!"
  }
}

I put these all together into Carrot Cake Texture.zip. To install this, download the file, then open up BlockLauncher and click on the spanner at the top of the screen. Then go to 'Texture Pack', 'Select', and pick the file out of your Downloads folder. This step doesn't do anything particularly exciting, but it comes into its own when we add some javascript.

In a new file, called 'carrot_cake.js', we can define the new item.

ModPE.setFoodItem(501,"carrot_cake","carrot_cake",6,"Carrot Cake");

ModPE.setFoodItem is the command to add a new edible object. Each item in Minecraft has a unique ID. I picked 501 for the carrot cake, because it hasn't been used yet. "carrot_cake" is the name of the picture to use from the texture pack - this is defined by taking 'carrot_cake_0.png' and removing '_0.png'. 6 is the number of half hunger points you gain by eating the carrot cake. Finally we define the name that is shown to the user, 'Carrot Cake'.

Next, we want to make the cake available in the inventory in Creative Mode, by using its ID of 501:

Player.addItemCreativeInv(501,1,0);

Next, I wanted to be able to make a cake out of carrots, wheat, egg, and sugar. You can look up the item IDs of items in Minecraft to do this step. Carrot is 391, sugar is 353, egg is 344, and wheat is 296.
Item.addCraftRecipe(501, 1, 0, [391, 2, 0, 353, 1, 0, 344, 1, 0, 296, 1, 0]);

To use this, download carrot_cake.js and open up BlockLauncher, then click on the spanner and go to 'Manage ModPE Scripts'. Press 'import' and find the file in your Downloads folder. Now if you go back to the main menu and open up your game, you should be able to make yourself a lovely cake!

...

Ada Lovelace Hackathon


Image courtesy of Sydney Padua

Ada Augusta Byron was born on December 10th, 1815, daughter of Lord and Lady Byron (yes, that Lord Byron). After her parents' separation, her mother, determined that Ada stay as far away from poetry as possible, encouraged her interest in mathematics and logic.

During her childhood, Ada developed an interest in flying, and took to studying the mathematics of 'Flyology', creating wings based on the proportions of birds.

Through her tutor, Mary Somerville, Ada met the inventor Charles Babbage. Babbage was obsessed with building a calculating machine called the Analytical Engine, which, had it ever been built, would have been the first computer. Babbage and Lovelace became great friends and corresponded about the Engine and other mathematical topics.

An Italian mathematician, Luigi Menabrea, wrote a description of the workings of the Analytical Engine. Being an accomplished linguist, Ada set about translating this work into English. She added a few notes of her own to the translation – the notes ended up being longer than the original text, and contained what is commonly thought of as the first ever computer program.

Lovelace's legacy goes beyond her groundbreaking code – she also thought deeply about the scope for computation in everyday life, predicting mathematical music, and neuronal modelling.

Back in November, the folks at the Oxford Hackspace kindly hosted our hackathon to celebrate the life and works of Ada Lovelace.

Continue reading Ada Lovelace Hackathon

...

Arguably pointless things that I have made

An app for counting rows while you knit

I find counting rows annoying - I have to put down a needle and pick up a pencil to mark a tally, or to twirl something on a row gadget. What I really want is to be able to increment without having to put anything down. This app means that I can just touch my phone's screen to keep track.

It's a simple interface - touch the blue circle to add one to the number, or touch the arrow to reset the count to zero. It started out as a webpage, but I wanted it for offline use so I used the MIT App Inventor (which is AMAZING, by the way) to quickly make it into an app. You can download it here. To install it, copy it to your phone and open it in file explorer. You'll need to approve installation of apps from unknown sources, which can be a security risk if you go installing things willy-nilly, but in this case is safe to do. Knit strong and prosper!

2D glasses for the cinema

OK, so a few years ago if you went to the cinema to see a 3D film, sometimes the 3D would be terrible. It would totally take away from the experience because it looked like flat cardboard layers placed a little apart rather than real life. A little while ago I had the idea of making special 2D glasses so that I could watch a 3D film as if it were an old-fashioned, honest to goodness 2D film.

To do this, you take the left lens from one pair of 3D glasses and swap it with the right lens from another pair of glasses. If you flip it backwards, you can wriggle the thin plastic back into the slots in the glasses - if that's too difficult, you can stick it on using glue or rubber cement. That way, both of the eyes of the glasses see the same picture, so you don't get a 3D effect. If you had old fashioned red-blue 3D glasses, this would be the same as having two blue or two red lenses.

A very large number of cardboard cat toys

Anyone who follows me on Instagram, or Facebook, or who has met me IRL, will probably have noticed that I have a new kitten. It's been a great excuse to make stupid things out of cardboard, including a very effective scratching pad, lots of mangled toilet roll tubes, and this little puzzle box.

A photo posted by Beth McMillan (@teraspawn) on

I cut a series of holes in the top of a cereal box, each a little smaller than a ping pong ball could fit through, and then put a ping pong ball into the box and taped it up. Sometimes I drop kibbles and smaller toys in there, as well. It can keep her occupied for a very long time.

On a similar note...

An SVG of my cat's face

I don't know why.

...