Wednesday, 7 April 2021

Whack a block Pixel Art

 

#colours

# Orange

# Pink / Skin

# Green

# White

# Red

# Sky blue / cyan

# Brown

# DARK GREEN

# Black


#faces


#@kari lawlor

Creeper = [

[DG, DG, DG, DG, DG, DG, DG, DG],

[DG, BL, BL, DG, DG, BL, BL, DG],

[DG, BL, BL, DG, DG, BL, BL, DG],

[DG, DG, DG, BL, BL, DG, DG, DG],

[DG, DG, BL, BL, BL, BL, DG, DG],

[DG, DG, BL, BL, BL, BL, DG, DG],

[DG, DG, BL, DG, DG, BL, DG, DG],

[DG, DG, DG, DG, DG, DG, DG, DG],

]


#Pig 


#Alex



#print pixel art

#By @KariLawler (Twitter)

def print_PixelArt(List):

    block = 35 # wool

    x, y, z = mc.player.getPos()

    pixel_y = y + len(List) - 1

    pixel_z = z - 6

    for row in List:

        pixel_x = x

        for pixel in row:

            if pixel > -1:

                mc.setBlock(pixel_x, pixel_y, pixel_z, block, pixel)

            pixel_x += 1

        pixel_y -= 1


mc.postToChat("Please hit the TNT block")


while True:


    evs = mc.events.pollBlockHits()

    for e in evs:

        pos = e.pos


        block = mc.getBlock(pos.x, pos.y, pos.z)


        if block == 46:#TNT

            mc.postToChat("Creeper")

            print_PixelArt(Creeper)

        elif block == 20:#glasselse:

            mc.postToChat("Other block")


        


Tuesday, 29 December 2020

Rainbow Road

   



Rainbow Road

In order to get the below code you will need to follow these blogs in order to get started:

Setting up the server link

My first code link

In this code you will use the following skills:

+Import code from libraries

+Create a connection to the Minecraft server(local on this pc only)

+Create a procedure to draw/drop a rainbow road beneath your feet every time that you move

Coding key skills

Selection

Iteration

Sequence

Data Structures(Lists)

Variables

Data Structures(2D arrays)

Input

Output

Logical Operators

Mathematical operators

String manipulation

Functions

Procedures

File handling

 

 

Instructions:

 Follow the steps below and you will get there pretty quickly:

1.Open Idle

2.Click on “File” > “New File”

3.Type out the following code

In the Adventures with Minecraft folder click on “Start Server”



5.At this point press enter and the following should happen….






7. Next press enter...then this should happen.....









 9. Next on Minecraft select “Multiplayer”.









9.Then type in "local host"









10.Type in local host and hit the “join server” button.


11. Press “Esc” on the keyboard to allow yourself to quickly pop back to IDLE so you can save and run your code.

12. In IDLE “File” >> “Save As” >> Call it “Rainbow road.py”

13. For it to work you will need to save it in a specific folder which is:

“AIMStarterKitPC\AdventuresInMinecraft-PC\MyAdventures”

Like I have here:














14. Still in IDLE select “Run” >> “Run Module”

15. Head back to Minecraft and you should see your code in action:

16. To kill the code / stop I from working you will need to press “Esc” >>> find this window in IDLE then close it down. See below:



 

Sunday, 20 December 2020

Forcefield

  



Forcefield

Before we go any further this code was originally created by Elton Lane(@piinthesky2015) a few years back as part of a Minecraft coding resource pack that I curated called the "hackpack" see link. He has kindly said that he doesn't mind me reusing this code for this Java coding retake on Minecraft Python coding. This code will allow you to bore big chunks out of the landscape. See the demo video at the bottom for a demo of it in use.   

In order to get the below code to work you will need to follow these blogs in order to get started:

Setting up the server link

My first code link

In this code you will use the following skills:

+Import code from libraries

+Create a connection to the Minecraft server(local on this pc only)

+Create a procedure to draw a air "forcefield"

+ Using parameters 

+Conditional statements 


Coding key

Selection

Iteration

Sequence

Data Structures(Lists)

Variables

Data Structures(2D arrays)

Input

Output

Logical Operators

Mathematical operators

String manipulation

Functions

Procedures

File handling

 

 

Instructions:

 Follow the steps below and you will get there pretty quickly:

 

1.Open Idle

2.Click on “File” > “New File”

3.Type out the following code


4.In the Adventures with Minecraft folder click on “Start Server”




5.At this point press enter and the following should happen….






7. Next press enter...then this should happen.....









 9. Next on Minecraft select “Multiplayer”.









9.Then type in "local host"









10.Type in local host and hit the “join server” button.


11. Press “Esc” on the keyboard to allow yourself to quickly pop back to IDLE so you can save and run your code.

12. In IDLE “File” >> “Save As” >> Call it “Forcefield.py”

 

13. For it to work you will need to save it in a specific folder which is:

“AIMStarterKitPC\AdventuresInMinecraft-PC\MyAdventures”

Like I have here you can see three example programs:














14. Still in IDLE select “Run” >> “Run Module”

15. Head back to Minecraft and you should see your code in action:

 


16. To kill the code / stop I from working you will need to press “Esc” >>> find this window in IDLE then close it down. See below:



 



Tuesday, 24 November 2020

25 Hacks of Christmas 2020

 



Source to above image: link
Over the next month I shall be recycling existing blogs and maybe a few new ones to look at 25 different coding experiments with Minecraft and code, across a range of platforms and formats. At least 5-7 new blogs from 2020 and more to come.


Day 1: Minecraft Education Edition: MakeCode Getting started........Link

Day 2: Day Getting started with Minecraft Java edition coding. link 

Day 2.5: (Test it out :)): Day My first code with Minecraft Java Edition and Python .... link

Day 3: Getting started with BitIO and Minecraft....... Link

Day 4: BitIO and Minecraft 'Tilting Rainbow Road'......... Link

Day 5: EduBlocks  and Minecraft getting started............ Link

Day 6: EduBlocks  and Minecraft ...........Amen to walking blocks............Link


Day 7: BitIO  and Minecraft 'Touching pins takes you places'...........Link


Day 8: Edublocks / BitIO and Minecraft..........The Liverpool Makefest Minecraft Pixel art Twitter bot........... Link


Day 9: BitIO and MInecraft  ''Minecraft CPU temperature graphing" link

Day 10: Whack a block,  with Minecraft Java Edition and Python link


Day 11: Minecraft Education Edition My First Command Block.......Link

Day 12: BitIO and Minecraft : PixelCraft.......Link

Day 13: Minecraft Education Edition: Give inventory and changing weather.......Link
 


Day 14: Day Walking Random blocks with Minecraft Java Edition and Python link

Day 15: M:EE MakeCode 'Get coding'........Link
 


Day 16: BitIO and Minecraft 'Scalable Housing'..........Link

Day 17: 
Minecraft Education Edition:MakeCode 'Wool Wall'........Link

Day 18: Raspberry Pi and Minecraft: Pixel Cakes(RPI big birthday weekend resource)
...................link

Day 19: 
Raspberry Pi and Minecraft: Pixel Craft 2.0......Link

Day 20: 
Raspberry Pi and Minecraft: Experiments with GPIO triggers and Minecraft
.......Link

Day 21: 
Minecraft Education Edition: Vertical farming ......Link 

Day 22: 
Raspberry Pi and Minecraft: GPIO zero Minecraft "Whack on board Led's"
........Link

Day 23: Forcefield, 
with Minecraft Java Edition and Python link

Day 24: Rainbow Road with Minecraft Java Edition and Python link

Day 25: TBA 

Monday, 19 October 2020

Walking random blocks

 

Walking Random blocks

In order to get the below code you will need to follow these blogs in order to get started:

Setting up the server link

My first code link

In this code you will use the following skills:

+Import code from libraries

+Create a connection to the Minecraft server(local on this pc only)

+Store 16 block ID's in a list

+ Create two procedures 1) drop a random wool block 2)drop a glass block

+Use a basic while loop (iteration)

+Call a named procedure, select a random number from a list and then drop that colour block

+Wait for 0.1 seconds

 Coding key skills 

Selection

Iteration

Sequence

Data Structures(Lists)

Variables

Data Structures(2D arrays)

Input

Output

Logical Operators

Mathematical operators

String manipulation

Functions

Procedures

File handling

 

 

Instructions:

 Follow the steps below and you will get there pretty quickly:

 

1.Open Idle

2.Click on “File” > “New File”

3.Type out the following code















 






4.In the Adventures with Minecraft folder click on “Start Server”




5.At this point press enter and the following should happen….






7. Next press enter...then this should happen.....









 9. Next on Minecraft select “Multiplayer”.









9.Then type in "local host"









10.Type in local host and hit the “join server” button.


11. Press “Esc” on the keyboard to allow yourself to quickly pop back to IDLE so you can save and run your code.

12. In IDLE “File” >> “Save As” >> Call it “Drop blocks.py”

 

13. For it to work you will need to save it in a specific folder which is:

“AIMStarterKitPC\AdventuresInMinecraft-PC\MyAdventures”

Like I have here:














14. Still in IDLE select “Run” >> “Run Module”

15. Head back to Minecraft and you should see your code in action:


 












16. To kill the code / stop I from working you will need to press “Esc” >>> find this window in IDLE then close it down. See below:



 

Sunday, 11 October 2020

Whack a block

 


Coding skills covered

Selection

Iteration

Sequence

Data Structures(Lists)

Variables

Data Structures(2D arrays)

Input

Output

Logical Operators

Mathematical operators

String manipulation

Functions

Procedures

File handling

 

 


Whack a block

To keep this one simple we will stick to the old trusty “Hello world”. Follow the steps below and you will get there pretty quickly:

 

1.Open Idle

2.Click on “File” > “New File”

3.Type out the following code




4.In the Adventures with Minecraft folder click on “Start Server”










5. Press enter.








6. At this point press enter and the following should happen….




 

 






8. Next on Minecraft select “Multiplayer”.





 






9. Next press direct connect..


 










10.Type in local host and hit the “join server” button.




 







11. Press “Esc” on the keyboard to allow yourself to quickly pop back to IDLE so you can save and run your code.

 

12. In IDLE “File” >> “Save As” >> Call it “Whack a block.py”

 

13. For it to work you will need to save it in a specific folder which is:

“AIMStarterKitPC\AdventuresInMinecraft-PC\MyAdventures”

Like I have here:
















14. Still in IDLE select “Run” >> “Run Module”

15. Head back to Minecraft and you should see your code in action:


 

16. To kill the code / stop I from working you will need to press “Esc” >>> find this window in IDLE then close it down. See below:








Next up try Walking random blocks link



Minecraft Java edition: experiments with code

 


Python coding :

1. Getting started with Minecraft Java edition coding. link


2. My first code .... link

Selection

Iteration

Sequence

Data Structures(Lists)

Variables

Data Structures(2D arrays)

Input

Output

Logical Operators

Mathematical operators

String manipulation

Functions

Procedures

File handling

 

 

3.Whack a block link

Selection

Iteration

Sequence

Data Structures(Lists)

Variables

Data Structures(2D arrays)

Input

Output

Logical Operators

Mathematical operators

String manipulation

Functions

Procedures

File handling

 

 

4. Walking Random blocks link

Selection

Iteration

Sequence

Data Structures(Lists)

Variables

Data Structures(2D arrays)

Input

Output

Logical Operators

Mathematical operators

String manipulation

Functions

Procedures

5.Forcefield link

Selection

Iteration

Sequence

Data Structures(Lists)

Variables

Data Structures(2D arrays)

Input

Output

Logical Operators

Mathematical operators

String manipulation

Functions

Procedures

File handling

 

 

6. Rainbow Road link

Coding key skills

Selection

Iteration

Sequence

Data Structures(Lists)

Variables

Data Structures(2D arrays)

Input

Output

Logical Operators

Mathematical operators

String manipulation

Functions

Procedures

File handling

 

 


Command blocks: