Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
add everything new
  • Loading branch information
Trollhunters501 authored Aug 16, 2023
1 parent 0a90abf commit 2e93d08
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
# ModLoader
# JSEngineNK
Nukkit plugin, enable to load javascript! very simple create systems!!
Nukkit plugin - Allows you to load Javascript modules!
# How to use?
- Create javascript archive, example: mod.js
- Drop archive in plugins/ModLoader/mod.js
- Drop archive in plugins/JSEngineNK/mod.js
- Create your code!
- Start your server! Instantly run

- examples can be found (here)[https://github.com/RedstoneAlmeida/ModLoader/tree/master/examples]
- examples can be found (here) [https://github.com/Trollhunters501/JSEngineNK/tree/master/examples]

# Basic JavaScript API loaded!
- Global Variables:
```javascript
var server; return getServer();
var plugin; return ModLoader Plugin MainClass;
var global; return ModLoader Plugin MainClass;
var self; return ModLoader Plugin MainClass;
Object.entries; it's a small polyfill
Object.assign; it's a small polyfill
var manager; return FunctionManager Class, Using to create Commands e Loops
var script; return A class that registers scripts and events
var logger; return Console Logger Input
var console; return Console Logger Input
var window; return Console Logher Input
var fetch; return Fetch API by Creadores Program


var players; return All Online Players
```

Expand Down Expand Up @@ -52,12 +62,10 @@ function taskloop(currentTick){

- Run Events:
```javascript
function PlayerJoinEvent(event){
script.addEventListener("PlayerJoinEvent", function(event){
var player = event.getPlayer();
player.sendMessage("welcome to Server!");
}

// function BlockBreakEvent(event){}
});
// ready, start your server and test!
```

Expand All @@ -68,3 +76,16 @@ var config = manager.createConfig(manager.getFile("folder", "archive"), 2); // 2
config.set("key", "value");
config.save();
```

- Register Script
```javascript
script.registerScript({
name: "TestScript",
version: "1.0",
description: "The Test!",
website: "https://github.com/Trollhunters501/JSEngineNK/",
authors: ["Creadores Program & RedstoneAlmeida"]
});
//You can register your script so that it appears in the list of scripts with the command /scripts or also with the command /version or /ver
//The mandatory parameters are: author or authors, name, version and description optional: website
```

0 comments on commit 2e93d08

Please sign in to comment.