Trending
UN Summit on HIV/AIDS Shows Incredible Progress in Infection Rates, Deaths, Treatment Acc… is trending now FG, Northern traditional leaders move to close immunisation gaps is trending now FG moves to scale up new malaria prevention strategy – FRCN HQ is trending now Air-stable, ultrathin superconductors developed for more scalable quantum devices is trending now A lesser-known SARS-CoV-2 protein may offer clues to long COVID symptoms is trending now Scientists are certain a wayward SpaceX rocket slammed into the moon as predicted is trending now Cocoa Pod Waste Could Provide a Sustainable Concrete Retarder is trending now UCL Watch: Real Madrid ups offer to Vinícius Júnior amid Arsenal interest is trending now Commonwealth Games Scandal: Four Ugandan boxers go missing, admit asylum plan is trending now Figo: Fifa's Infantino is like the mafia, and Prince Ali exposed him is trending now Super Falcons thrash Egypt 6-2 to reach WAFCON quarter-finals is trending now Egungun gives fans rare look at Davido’s Eko Atlantic mansion under construction is trending now UN Summit on HIV/AIDS Shows Incredible Progress in Infection Rates, Deaths, Treatment Acc… is trending now FG, Northern traditional leaders move to close immunisation gaps is trending now FG moves to scale up new malaria prevention strategy – FRCN HQ is trending now Air-stable, ultrathin superconductors developed for more scalable quantum devices is trending now A lesser-known SARS-CoV-2 protein may offer clues to long COVID symptoms is trending now Scientists are certain a wayward SpaceX rocket slammed into the moon as predicted is trending now Cocoa Pod Waste Could Provide a Sustainable Concrete Retarder is trending now UCL Watch: Real Madrid ups offer to Vinícius Júnior amid Arsenal interest is trending now Commonwealth Games Scandal: Four Ugandan boxers go missing, admit asylum plan is trending now Figo: Fifa's Infantino is like the mafia, and Prince Ali exposed him is trending now Super Falcons thrash Egypt 6-2 to reach WAFCON quarter-finals is trending now Egungun gives fans rare look at Davido’s Eko Atlantic mansion under construction is trending now
Education

Minecraft MakeCode Javascript Workaround

Minecraft MakeCode Javascript Workaround

We’re wrapping up our Coding Mars / Minecraft Mars unit in my middle school computer programming class. It’s one of my favorite units. Students have been programming “agents” (which function like “robots” in Minecraft Education) to mine resources, farm, and build structures in a Mars-themed world. It’s hands-on, it’s creative, and it’s been particularly exciting […]

We’re wrapping up our Coding Mars / Minecraft Mars unit in my middle school computer programming class. It’s one of my favorite units. Students have been programming “agents” (which function like “robots” in Minecraft Education) to mine resources, farm, and build structures in a Mars-themed world. It’s hands-on, it’s creative, and it’s been particularly exciting to do this semester as we watched the successful NASA Artemis II mission unfold.

As we were working through the mining portion of the unit this week, students ran into a wall — not a Minecraft wall, but a coding one.

A pixel-art infographic titled "Minecraft MakeCode Javascript Workaround" is set against a reddish Martian landscape with a habitat dome. A robotic Minecraft Agent stands between a grey interface box with a large red "X" and a green glowing "JS" toggle button. Above the Agent, a speech bubble displays the solution code, agent.collect("raw_iron"), pointing toward a glowing block of iron ore. The bottom corners include the URL "wfryer.me/mars" and the hashtag "#CodingMars".

The Problem: Raw Iron Isn’t in the Dropdown

When the agent destroys an iron ore block in current versions of Minecraft Education, what drops on the ground isn’t “iron ore” — it’s raw iron. That’s been the case since the Caves & Cliffs update (v1.17). Students could see the raw iron sitting there. The agent was picking it up using the “Collect All” block command. But when they tried to use the agent collect block in MakeCode and searched the dropdown for “raw iron”… it wasn’t there. Only “iron ingot” and “iron block” appeared as options.

It turns out the MakeCode visual block palette hasn’t been fully updated to include items introduced in newer versions of the game. Raw iron exists in the world. The agent can collect it. But the block editor doesn’t know it exists yet. This is a documented gap that hasn’t been addressed / fixed yet by the MinecraftEDU developers.

The Fix: Switch to JavaScript and Use the Item’s String Name

I learned in a past semester from students who chose to code their assignments and projects in JAVASCRIPT within Minecraft Makecode that scripting offers more options than block code… And students can readily toggle back and forth between code views.

Every block and item in Minecraft has an internal code name. When the visual dropdown doesn’t list what you need, you can reference items directly by their string name in JavaScript. Instead of picking from a menu, you just type it. According to the MakeCode block-by-name reference, all blocks and items in the game have a code name associated with them that you can use directly in code.

So instead of hunting through a dropdown that doesn’t have what they need, students switch to JavaScript view at the top of MakeCode and write:

javascript

agent.collect("raw_iron")

That’s the whole fix. One line. The agent collects the raw iron that the block editor couldn’t even see.

To try this in your own class: click the JavaScript toggle at the top of the MakeCode editor, find your agent collect block in the code, and replace the item reference with "raw_iron" as a string.

Please Use My Coding Mars Unit

If you’re running a similar mining unit and your students run into this or a similar issue, hopefully our experiences can help. And if you haven’t tried the Minecraft Mars lesson yet, please check it out! I’ve been teaching this unit and sharing about it for four years now, and it just keeps getting better!

AI Attribution: I used Claude AI (by Anthropic) to help draft this post based on notes from our classroom experience, and edited it before publishing.

View original source →

Related

More from Moving at the Speed of Creativity By Wesley Fryer, Ph.D.