Giter VIP home page Giter VIP logo

baajarmeh / liteloaderbds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liteldev/liteloaderbds

0.0 1.0 0.0 167.96 MB

A lightweight & cross-language plugin loader for Minecraft Bedrock Dedicated Server (BDS)

Home Page: https://www.litebds.com

License: Other

Shell 0.03% JavaScript 0.14% C++ 84.09% Python 0.01% C 15.36% Lua 0.01% Objective-C++ 0.02% HTML 0.03% CMake 0.25% Batchfile 0.07%

liteloaderbds's Introduction

LiteLoaderBDS - Epoch-making & Cross-language Bedrock Dedicated Servers Plugin Loader

status Discord Telegram Latest Tag GitHub Releases (by Asset)
QQ Group: 656669024 QQ Group 2: 850517473

English | 简体中文

LiteLoaderBDS

LiteLoaderBDS is an unofficial plugin loader that provides basic API support for Bedrock Dedicated Server, with a massive API, lots of packed utility interfaces, a rich event system and powerful basic interface support.

LiteLoader provides a massive API, a powerful event system and a large number of encapsulated development infrastructure interfaces, providing a solid foundation for extending the Bedrock Edition BDS with more gameplay and functionality. With plugins, it is easy to extend the functionality of BDS, the associated development is easy to learn, and the development approach is flexible.

Writing plugins in C++,Golang,JavaScript,Lua,Python and other languages, which allows developers to easily extend and customize BDS functionality, making it easy to learn and extremely flexible.


🎁 First impression

  • “Why should I choose LiteLoader?”

  • They have interface that is easy to use and intuitive!!

C++ language sample plugin

// Template project: https://github.com/LiteLDev/PluginTemplate
// More examples: https://github.com/LiteLDev/LiteLoaderPlugins
#include <EventAPI.h>
#include <LoggerAPI.h>
#include <LLAPI.h>
#include <MC/Player.hpp>
#include <MC/Actor.hpp>
Logger logger("AttackLog");

void PluginInit()
{
    logger.info("Plugin xxx has been loaded.");
    // Subscribe Player-Attack Event
    Event::PlayerAttackEvent::subscribe([](const Event::PlayerAttackEvent& ev) {
        Player* player = ev.mPlayer;
        Actor* actor = ev.mTarget;
        logger.info("Player:{} attacks {} | at {} in Dimension {}", 
         player->getRealName(), actor->getTypeName(), actor->getPos().toString(),
            std::to_string(actor->getDimensionId()));
        return true;
    });
}

Script language sample plugin (Use Js as an example)

// Register for shutdown command
mc.listen("onServerStarted", () => {
    const cmd = mc.newCommand("stopsvr", "close server", PermType.GameMasters);
    cmd.overload();
    cmd.setCallback((_cmd, ori, out, _res) => {
        const pl = ori.player;
        out.success("stop command executed successfully");
        mc.broadcast(
            `Player${pl.realName}Execute the stop command. The server will be shut down after 5 seconds`
        );

        // Execute stop command
        setTimeout(() => {
            mc.runcmd("stop");
        }, 5000);
    });
    cmd.setup();
});

💎 Advantage

  • 💻 Support for developing plugins in many different languages, Keeping the API uniform
Supported languages C++JavaScriptLuaGolang.Net
Upcoming supported languages PythonRubyTypeScript
  • 📕 Smooth development experience with great compatibility

    • Auto-generated C++ headers, access to all BDS classes and functions, full toolchain support and evolving features
    • For scripting language plugins, a multi-language code completion library, a powerful VSCode plugin, a hot-loading system ...... Many tools to help you write every line of code more efficiently
    • When a version is updated, the API is guaranteed to be largely backward compatible and the plugin requires little or no code changes with the version update. With the LiteLoader series' unique symbol lookup technology, cross-version auto-adaptation is no longer a dream
  • 📋 Well documented and explained in detail

  • 🎈 Numerous well-packaged interfaces

    • Numerous game APIs support: players, entities, cubes, items, containers, NBTs, server systems ......
    • Up to 50+ game events to listen to, no matter what happens, the first to respond
  • 🛡 Secure, stable and versatile

    • Fixes a number of vulnerabilities in BDS to ensure the stability and security of your server
    • Extensive use of the seh exception protection framework to minimise the risk of server crashes
    • Supports running on Linux, MacOS platforms via Wine, bringing a free plugin experience to other platforms as well: write once, share on multiple platforms.
  • 🏆 Sound app ecosystem

    • A large number of existing plugins, mature publishing platform, instantly 👉Go to MineBBS👈 to find and download your favorite LL plugins
  • 🏃 Open Source & Community Building

    • The project is licensed under the AGPL-3.0 open source license and will never be charged for or released as a commercial version.
    • The design philosophy is decentralised and you can be assured of a free plugin loading framework!

💻 Install

For Windows

  1. Download the latest LiteLoader-version.zip from Releases or Actions,
  2. Unzip everything into the directory of bedrock_server.exe. If you are prompted with conflicting files during the decompression process, just select Overwrite.
  3. Ensure that the bedrock_server.pdb file exists. Run LLPeEditor.exe to generate the BDS with the exported symbols (bedrock_server_mod.exe)
  4. When the console output Press any key to continue. . . , press any key to close the window
  5. Execute bedrock_server_mod.exe and enjoy it !

For Linux

Installation script(Ubuntu)

wget https://github.com/LiteLDev/LiteLoaderBDS/raw/beta/Scripts/install.sh
chmod +x install.sh
./install.sh

Docker

Enter the following lines in your terminal:

docker pull shrbox/liteloaderbds
docker create --name liteloader -p 19132:19132/udp -i -t shrbox/liteloaderbds

Start server: docker container start liteloader
Force stop server(not recommended): docker container stop liteloader
Enter console: docker attach liteloader
Exit console: Press Ctrl + P + Q. If you press Ctrl + C, the server process will exit.
If you want to manage server files, use docker volume --help for more details.

Everything's done! Next, you can install LiteLoader plugins!


🎯 Find & Install plugins

Plugin downloads

LiteLoader main plugin distribution channels.

Plugin installation

  1. If you downloaded a zip file, unzip it
  2. Place all the obtained contents directly into the plugins directory
  3. Run bedrock_server_mod.exe to start the service

For more installation and usage guides, come to 👉LiteLoader documentation👈 to view


📕 LiteLoader plugin development

Developing plugins with C++

  1. Go to the LiteLoader plugin template repository to download project templates, or create your own project repository based on the templates and download the code locally
  2. Open the Template.sln project file
  3. Start writing the plugin code in Plugin.cpp
  4. Compile, and select the appropriate PDB file as prompted to generate the dependency libs
  5. Copy the plugin to the plugins directory for testing

For plugins development examples and guidance, please come to 👉LiteLoader documentation👈
If you have a revision request or need to add an API, please contact the author or post an Issue

Developing plugins using scripting Languages

  1. Create the file
  2. Write the code
  3. Copy the plugin to the plugins directory for testing

Please come to 👉LiteLoader documentation👈 for detailed API documentation and plugin development tutorial.
If you have a revision request or need to add an API, please feel free to contact the author or post an Issue

Example Plugins

Click here for more open source LiteLoader plugins as sample plugins. You can use them directly in production environments You can also learn plugin development methods and tips here

Development Aids - VSCode Development Aids & Complementary Libraries

Use the LiteLoader development helper plugin developed by Moxicat
Helps you do better with script plugins!
Code hint, auto-completion, auto-documentation, error alert, runtime debugging and so on

Click here View more description and introduction of this extension
VSCode extension store search LLScriptHelper, install LLScriptHelper and experience it instantly!

Development Aids - Blockly-LXL Graphical Development Kit

No programming foundation? Tired of complex language rules?
Have you ever thought that BDS plug-in development could be as easy as a puzzle?

Here it is! The Blockly-LXL graphical development kit from pa733 takes the plugin development experience to a new level!

Click here View related installation and usage instructions

🔨 Build project

Go to GitHub Actions to get the latest build artifact

Of course, if you prefer to build the project yourself, or contribute code to LiteLoader, you can build the project yourself by following these instructions

  1. install the latest Microsoft Visual Studio and the standard C++ desktop development suite
  2. Install the latest Windows SDK.
  3. Open the LiteLoader.sln project file and click on the Batch Generation item in the Generation menu
  4. Bring up the batch generation dialog, check all the generation checkboxes on the right side of the dialog
  5. When you have finished selecting, click the Generate button in the dialog box to perform batch generation
  6. After successful compilation, go back to the project root directory and execute the PackRelease.cmd script in the Scripts folder.
    After execution, the contents of the RELEASE folder in the root directory will be the complete LiteLoader environment and all dependencies.

🎬 Participate in contribution

You can use the following methods to contribute to the LiteLoader project

  1. Contribute code, maintain symbols
  2. Help us modify and optimize development documents
  3. Write the new API that you want in the format and submit a PR, or make good suggestions
  4. Help us promote LiteLoader, support our development

We welcome your contributions to LiteLoader!

If you are interested in contributing to LiteLoaderBDS, feel free to come to 👉LiteLoader documentation👈 to view Project Maintenance and Support Documentation



📍 LICENSE

You must accept the Minecraft EULA.

  • It means DO NOT MAKE COMMERCIAL USE OF ANYTHING which breaks the EULA.
  • Accepting this LICENSE means you ACCEPTED Minecraft EULA too.
  • If you violate the EULA, any legal liability is IRRELEVANT to the developers.
  • NO WARRANTY.
Project License
LiteLoader AGPLv3 with extra restrictions&exceptions
BedrockX GPLv3 with extra restrictions&exceptions
ElementZero GPLv3
ScriptX Apache License Version 2.0
OpenSSL Apache-2.0 License
SimpleIni MIT License
Nlohmann-Json MIT License
nbt-cpp MIT License
Hash GPLv3
ThreadPool Zlib License
LightWebSocketClient MIT License
magic_enum MIT License
dyncall ISC license
vcproxy MIT License
RawPDB BSD 2-Clause License

Extra Restrictions & Exceptions

If you provide a server hosting service,you can use this framework for free, but you SHOULD NOT make PRIVATE changes to this framework or as a selling point. If you fixed or tweaked the code, please pull request, instead of making it private or using it for commercial propose.

Do not do evil.

Although we expected to build an open-source community, but forcing everything open-source will ruin this community. So you can write plugins based on LiteLoader with ANY open-source license or even don't publish your source code. but if you modified the framework, or write a new framework based on this framework, you MUST open-source it.

If you want to reproduce and distribute this framework, you have to get our authorization!


🏆 Acknowledgement

Important Contributors

ShrBox dreamguxiang WangYneos wzy xiaoqch yqs112358 Sysca11 RimuruChan
@ShrBox @dreamguxiang @WangYneos @wzy @xiaoqch @yqs112358 @Sysca11 @RimuruChan

Thanks to JetBrains for allocating free open-source licences for IDEs such as CLion.

liteloaderbds's People

Contributors

acx66 avatar allcontributors[bot] avatar dofes avatar dreamguxiang avatar ipad54 avatar jasonzyt avatar kawaiinahida avatar lazulikao avatar mcbepluginmoder avatar moorcorpa avatar noahbpeterson avatar oeotyan avatar pa733 avatar pd233 avatar protectoryt364 avatar redbeanw44602 avatar rimuruchan avatar shishkevichd avatar shrbox avatar starsdream00 avatar triplecamera avatar twoone-3 avatar vincentwang0905 avatar wzyyyyyyy avatar xiaoqch avatar yqs112358 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.