This is the simplest code I could come up with to create a 2D Minecraft. Lots of options to expand this and make it even better. Use W A S D to move around, press f to fill in terrain and Space to remove blocks. Click on the top right corner to change the block type. (This is starter code for you to make your own 2D Minecraft, there are many ways you can expand this.)
Mojang for creating Minecraft