Skip to content

Nukkit plugin, enable to load javascript! very simple create systems!!

Notifications You must be signed in to change notification settings

RedstoneAlmeida/ModLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ModLoader

Nukkit plugin, enable to load javascript! very simple create systems!! Nukkit plugin - Allows you to load Javascript modules!

How to use?

Basic JavaScript API loaded!

  • Global Variables:
var server; return getServer();
var plugin; return ModLoader Plugin MainClass;
var manager; return FunctionManager Class, Using to create Commands e Loops
var logger; return Console Logger Input
var players; return All Online Players
  • Create Basic Command:
manager.createCommand("name", "description", "functionUsed");


function functionUsed(sender, args){
    if(args.length < 1){ // see args exists
        sender.sendMessage('You used incorrect!');
        return;
    }
    var name = args[0];
    sender.sendMessage("You writer: " + name); // send Message to sender
    // sender.sendMessage(manager.format("You writer: %s", name)); format your message
}
  • Create Basic Tasks:
manager.createTask("tasknormal", 20 * 20);

manager.createLoopTask("taskloop", 20 * 20);

function tasknormal(currentTick){
    print('I tasknormal!');
}

function taskloop(currentTick){
    print('I taskloop');
}
  • Run Events:
function PlayerJoinEvent(event){
    var player = event.getPlayer();
    player.sendMessage("welcome to Server!");
}

// function BlockBreakEvent(event){}
// ready, start your server and test!
  • Create Config
var config = manager.createConfig(manager.getFile("folder", "archive"), 2); // 2 = Config.YAML

config.set("key", "value");
config.save();

About

Nukkit plugin, enable to load javascript! very simple create systems!!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •