More EMC

More EMC

623 Downloads

More EMC's  EE3 Addon

EE3 Addon which adds some  useful transmutation recipes and commands.

this mod has scripting functionality. you don't have to make your own mod to do some basic stuff.

Scripting tutorial

Prior to scripting, you need background knowledge of javascript and java. 

first you have to create folder with any name you like.
then, create manifest.info in folder that you have just created and paste code below into manifest.info.

//script id
scriptID=Test Script
//name of .js file
fileName=test.js
//event receivers

//listening to preinit event. when preinit event occurs in game, it will propagated to function in your function.
event-receiver=preinit&preinitevent
//side configuration
clientSide=true
serverSide=false
clientSideRequired=false

Let me explain each field one by one.

you can use // to comment out your code. any text after // will get ignored.

field with (optional:default=...) does not have to defined in manifest. 

1,scriptID: scriptID is unique id that your script going to use. scriptID must not get conflicted with other script.

2,fileName: filename of script code. this field must point to .js file.

3,event-receiver: eventID&handlerFunction

4,clientSide: determine whether script load on client side.(optional:default=true)

5,serverSide: determine whether script load on server sidet.(optional:default=true)

6,clientSideRequired: determine weather this script is required to join server. for example, if this field is true and

   server has same script, only client with this script will allowed to join server. (optional:default=false)

Create test.js in your script folder and paste below into test.js

//preinit event(defined in manifest.info)

function preinitevent(event){

    //exit minecraft 

    exitgame(0);

}

 then compress script folder and put .zip into config\MoreEMC\scripts\

Planned

add dynamic event handling mechanism.

implement clientSideRequired correctly.