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:



 



No comments:

Post a Comment