/LiteLoaderBDS

A lightweight plugin loader for Bedorck Dedicated Server(BDS)

Primary LanguageC++GNU General Public License v3.0GPL-3.0

LiteLoaderBDS - New Era Bedrock Dedicated Servers Plugin Loader.

status Discord Telegram
Latest TagGitHub Releases (by Asset)
Donate us(afdian)
Official Forum

English | 简体中文

Logo

LiteLoader 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.

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

🎁 First impression

“Why should I choose LiteLoader?”

Easy to use, intuitive interface!

BlockInstance Actor::getBlockFromViewVector(FaceID& face, bool includeLiquid, bool solidOnly, float maxDistance, bool ignoreBorderBlocks, bool fullOnly) const {
    auto& bs = getRegion();
    auto& pos = getCameraPos();
    auto viewVec = getViewVector(1.0f);
    auto viewPos = pos + (viewVec * maxDistance);
    auto player = isPlayer() ? (Player*)this : nullptr;
    int maxDisManhattan = (int)((maxDistance + 1) * 2);
    HitResult result = bs.clip(pos, viewPos, includeLiquid, solidOnly, maxDisManhattan, ignoreBorderBlocks, fullOnly, nullptr);
    if (result.isHit() || (includeLiquid && result.isHitLiquid())) {
        BlockPos bpos;
        if (includeLiquid && result.isHitLiquid()) {
            bpos = result.getLiquidPos();
            face = result.getLiquidFacing();
        } else {
            bpos = result.getBlockPos();
            face = result.getFacing();
        }
        return Level::getBlockInstance(bpos, bs.getDimensionId());
    }
    return BlockInstance::Null;
}

💎 Advantage

  • 📕 Full access to all classes and functions
  • 💻 Auto-generacted C++ headers
  • 💡 Free and simple coding experience
  • 🔌 APIs of high quality and large quantity
  • 🛡 Fix some vulnerabilities in BDS to ensure the stability and security of your server
  • 🏃 Open-source

💻 Install

For Windows

  1. Download LiteLoader.zip from Releases or Actions, unzip it to BDS directory
  2. Run SymDB2.exe to generate symbol files(bedrock_server.symdb2) and BDS with export symbols bedrock_server_mod.exe(plugins in future may require this version of bds), before you run SymDB2.exe you need to check if the bedrock_server.pdb exists

For Linux

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

Start server: docker container start liteloader

Stop server(uncommended): docker container stop liteloader

Show console: docker attach liteloader

Exit console: press Ctrl + P + Q, if you press Ctrl + C server process will exit If you want to manage server file, use docker volume --help for more details

Installed! Next, you can install what you want LL plugins!

📥AutoUpdate

From version 2.0.0, LL has added an autoupdate function.
If in the same BDS version, LiteLoader update will automatically push, and automatically install the next time the server is started.
The latest features, get the first time! Eliminate the trouble of repeated manual upgrades!

🎯 load plugins

LL plugins are mainly published in MineBBS, please click here to find and download your LL plugins

  1. If the download is a .zip, please unzip
  2. Put all the obtained content directly into the plugins directory
  3. run bedrock_server_mod.exe


📕 LL plugin development

Develop

  1. run SymDB2.exe -def
  2. add bedrock_server.dll to [Properties -> Linker -> Input -> Delay Load DLL]
  3. run llvm-dlltool to generate import library using the following command (Tools/llvm-dlltool-msys2 is recommended)
llvm-dlltool -m i386:x86-64 -d bedrock_server_api.def -l bedrock_server_api.lib
llvm-dlltool -m i386:x86-64 -d bedrock_server_var.def -l bedrock_server_var.lib
  1. use #pragma comment(lib, "path to lib") or any method you like to add those libraries
  2. add SymDBHelper.lib to your project
  3. using headers in SDK/Header/MC and here we go Click Here Check out more open source LL plugins as example plugins.
    You can learn plugin development methods and techniques here

🔨 build project

Go to GitHub Actions to get the latest build artifact

Of course, if you are willing to build the project yourself, or contribute code to LiteLoader, you can build by yourself according to the following instructions

  1. Install newest Microsoft Visual Studio with standard C++ building suite
  2. Install the newest version of Windows SDK
  3. Open LiteLoader.sln project files,Click on Build

🎬 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 LL ,support our development

⭐⭐⭐We welcome your contributions to LiteLoader!⭐⭐⭐


📍 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

LiteLoader GPLv3 with extra restrictions&exceptions
BedrockX GPLv3 with extra restrictions&exceptions
ElementZero GPL v3
ChakraCore MIT License
OpenSSL Apache-2.0 License
SimpleIni MIT License
Nlohmann-Json MIT License
nbt-cpp MIT License

Extra Restrictions & Exceptions

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

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 LiteXLoader with ANY open-source license or even dont publish your source code. but if you modified the framework, or write a new framework based on this framework, you MUST open-source it.

🏆 Thanks

Important Contributors

ShrBox dreamguxiang dreamguxiang 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.