ModLoader

ModLoader 1.0-Beta

Compatible API Versions
1.0.0, 1.0.6
Sourcecode
https://github.com/RedstoneAlmeida/ModLoader
ModLoader

Nukkit plugin, enable to load javascript! very simple create systems!!
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:
JavaScript:
manager.createCommand("name", "description", "functionUsed");

function functionUsed(sender, args){

    if(args.lenght < 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:
JavaScript:
manager.createTask("tasknormal", 20 * 20);



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



function tasknormal(currentTick){

    print('I tasknormal!');

}



function taskloop(currentTick){

    print('I taskloop');

}

R
Run Events:

JavaScript:
function PlayerJoinEvent(event){

    var player = event.getPlayer();

    player.sendMessage("welcome to Server!");

}



// function BlockBreakEvent(event){}

// ready, start your server and test!
  • Create Config
JavaScript:
var config = manager.createConfig(manager.getFile("folder", "archive"), 2); // 2 = Config.YAML



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

config.save();
  • Like
Reactions: Deleted member 1737
Author
RedstoneAlmeida
Downloads
2,516
Views
5,842
First release
Last update
Rating
4.50 star(s) 2 ratings

Latest reviews

The Plugin seems very good to me but there are bugs like if you register an event for example the PlayerJoinEvent in a JavaScript plugin if you register it in another js file only the code that is shown works ran to the end
R
RedstoneAlmeida
I intend to make a beta version, which runs each file separately as is the plugins in the nukkit itself
Very useful plugin!
Even those without knowledge of plugins can help you add simple features!
한국어 사용 할 때 한글이 깨진다면, 파일 저장 할 때 코딩 방식을 UTF-8 말고 ANSI 형식으로 저장하시면 한글이 안깨집니다.
Top