Skip to content

Commit ba66b49

Browse files
authored
Create README.md
1 parent 14e233a commit ba66b49

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# ModLoader
2+
3+
This is a tool to load mods onto the Linux version of [Bedrock Dedicated Server](https://minecraft.net/download/server/bedrock).
4+
5+
## Usage
6+
- Get `libserver_modloader.so`, either from [releases](https://github.com/minecraft-linux/server-modloader/releases) or [building your own](#compiling-from-source)
7+
- Put your compiled mods in a folder called `mods/` next to your moddable BDS binary
8+
- `LD_PRELOAD=path/to/libserver_modloader.so ./bedrock_server_symbols_moddable.debug`
9+
10+
## Compiling from source
11+
1. `git clone https://github.com/minecraft-linux/server-modloader.git --recursive`
12+
2. `cd server-modloader`
13+
3. `mkdir build && cd build`
14+
4. `cmake ..`
15+
5. `make`
16+
17+
You now have a `libserver_modloader.so` binary.
18+
19+
## Getting mods to work on newer versions (1.16+)
20+
Newer versions of BDS don't have exported symbols anymore, so a little hacking is necessary to modify the binary and make the symbols linkable.
21+
22+
Using [LIEF](https://github.com/lief-project/lief), you can create a patched, moddable BDS from `bedrock_server_symbols.debug` using the following Python script:
23+
24+
```py
25+
import lief
26+
import sys
27+
28+
lib_symbols = lief.parse("bedrock_server_symbols.debug")
29+
for s in filter(lambda e: e.exported, lib_symbols.static_symbols):
30+
lib_symbols.add_dynamic_symbol(s)
31+
lib_symbols.write("bedrock_server_symbols_patched.debug")
32+
```

0 commit comments

Comments
 (0)