(Notes updated September 2015.)
Previous Topic: Connecting to Each Other’s Servers.
Our First Mod: sayhi.js
I’ll show you how to write a very simple one, sayhi.js, and then a more complex one, scraper.js. After that, it’s up to you to figure out what you can do!
In the Canarymod folder, find the folder scriptcraft / plugins, then make a new folder with your name (or any unique folder name).
Using Notepad++, type in the code shown below and save it in a file called sayhi.js. Here are explanations of what everything means:
Try it out in Minecraft and see if it works!
NOTE: Every time you create a new ScriptCraft program or edit one, you have to type /js refresh() in Minecraft to update your changes. If no commands run, make sure you are opped. (In the Canarymod window, type op <your_mincraft_name>).
To run it, type /js sayhi() in Minecraft.
A More Complex Mod: scraper.js
This makes the skyscraper shown above. We will figure out together how it works!