docker-minecraft-bedrock-server icon indicating copy to clipboard operation
docker-minecraft-bedrock-server copied to clipboard

Followed steps, but can't get mods to show up activated

Open ForceConstant opened this issue 3 years ago • 11 comments

Should they actually work with latest server? The do prompt users to download pack, but they do not show up as activated in settings. Any ideas?

ForceConstant avatar Nov 12 '21 20:11 ForceConstant

Personally I have never had any success with bedrock mods, but hopefully someone will see this and give some advice.

itzg avatar Nov 12 '21 20:11 itzg

@itzg Maybe I will try the java server, and use geyser.

ForceConstant avatar Nov 12 '21 21:11 ForceConstant

So I got it to work with the bedrock server, and used a script that I modified from another github. I will post here later.

ForceConstant avatar Nov 14 '21 01:11 ForceConstant

Looking forward to it 😀

itzg avatar Nov 14 '21 02:11 itzg

Ok here it is attached, it was taken from https://github.com/cubeworx/mcbe-server, and slightly modified. Personally I ran it outside of the container, as I have /data linked to a local directory instead of a volume, but ideally it would run as part of container startup. Another nice thing is it would setup addons when you change levels/worlds.

install_addons.sh.txt

ForceConstant avatar Nov 14 '21 12:11 ForceConstant

I would love to see this feature added. I recently started using behavior and resource packs but each update was removing the files to the backup directory. I just tested the modified script provide by @ForceConstant and I think it will work to put the mods back after updates.

1MoreTechGuy avatar Dec 18 '21 01:12 1MoreTechGuy

you can also just put the mods inside your world folder so they are not moved into the backup folder

Patchoulino avatar Sep 20 '22 06:09 Patchoulino

you can also just put the mods inside your world folder so they are not moved into the backup folder

I gave this suggestion a try where I moved the 'behavior_packs' and 'resource_packs' folder and modes into the 'worlds' directory. Unfortunately, the file 'valid_known_packs.json' from /data is still being overwritten so mods are not being found after updates.

1MoreTechGuy avatar Nov 06 '22 19:11 1MoreTechGuy

you can also just put the mods inside your world folder so they are not moved into the backup folder

I gave this suggestion a try where I moved the 'behavior_packs' and 'resource_packs' folder and modes into the 'worlds' directory. Unfortunately, the file 'valid_known_packs.json' from /data is still being overwritten so mods are not being found after updates.

My bad, everything needs to be moved to words/[your world name]/ this is how my volume looks like:

$ ls worlds/*/
behavior_packs  level.dat      levelname.txt   valid_known_packs.json
db              level.dat_old  resource_packs  world_behavior_packs.json

$ cat worlds/*/valid_known_packs.json
[
	
	{
		"file_system" : "RawPath",
		"path" : "behavior_packs/Foxy'sOneP",
		"uuid" : "5f51f7b7-85dc-44da-a3ef-a48d8414e4d5",
		"version" : "3.0.0"
	},
	
	{
		"file_system" : "RawPath",
		"path" : "resource_packs/bedrocktwe",
		"uuid" : "debacc3e-6734-4a94-a41e-40fc38296f8b",
		"version" : "1.0.0"
	}
	
]

$ cat worlds/*/world_behavior_packs.json
[

	{
		"pack_id" : "5f51f7b7-85dc-44da-a3ef-a48d8414e4d5",
		"version" : [ 3, 0, 0 ]
	},
	
	{
		"pack_id" : "debacc3e-6734-4a94-a41e-40fc38296f8b",
		"version" : [ 1, 0, 0 ]
	}
	
]

$ ls worlds/*/*_packs
worlds/server/behavior_packs:
"Foxy'sOneP"

worlds/server/resource_packs:
bedrocktwe

Patchoulino avatar Nov 06 '22 20:11 Patchoulino

@Patchoulino Gotcha! Let me get the valid_known_packs.json setup again and move it over.

1MoreTechGuy avatar Nov 06 '22 20:11 1MoreTechGuy

The comment https://github.com/itzg/docker-minecraft-bedrock-server/issues/194#issuecomment-1304882044 was extremely helpful, thank you! I read it after I got it to work; it seems reasonable to install extensions on a per-world basis like that. I'll consider that in the future. In my case I run 1 container 1 world just to keep it simple (I'm still learning how to manage Minecraft servers).

Preamble: it is helpful if you know how to read JSON. See "Tutorials" https://github.com/burningtree/awesome-json for some good resources, and the "Online Tools" if you need a validator.

I followed the README and it worked well. Here is what I got to work:

First, I'll share my docker-compose.yml so you know how I'm running the server:

My docker-compose.yml

CAUTION! This example worked for me but it may not be "correct" or "best". Refer to the project's documentation.

version: '3'
services:
  minecraft:
    container_name: 'mc'
    image: itzg/minecraft-bedrock-server
    ports:
      - '19132:19132'
      - '19132:19132/udp'
    volumes:
      - './data:/data'
    environment:
      EULA: 'TRUE'
      GAMEMODE: 'creative'
      DIFFICULTY: 'peaceful'
      ALLOW_CHEATS: 'true'
      ALLOW_FLIGHT: 'true'
      ENABLE_COMMAND_BLOCK: 'true'
      INIT_MEMORY: '2G'
      MAX_MEMORY: '4G'
      # 2023-12-15: This works by using xuid
      OPS: '1234'
    restart: always
    stdin_open: true
    tty: true
    deploy:
      resources:
        limits:
          cpus: '3.0'
          memory: 6144M
        reservations:
          cpus: '2'
          memory: 2048M

Second, getting the UUID from the manifest.json requires a few steps.

How to get the UUID

Note: not all downloads are a .zip file, so this may be different for other plugins.

In this case the downloaded file was ops-v4.0.0.zip so I unzip'd that, then inside that directory:

$ cd ops-v4.0.0

$  ls
EULA.txt  ops-v4.0.0.mcaddon  readme.txt

$ cp ops-v4.0.0.mcaddon ops-v4.0.0.mcaddon.zip
'ops-v4.0.0.mcaddon' -> 'ops-v4.0.0.mcaddon.zip'

$ unzip ops-v4.0.0.mcaddon.zip
Archive:  ops-v4.0.0.mcaddon.zip
   creating: bp/
  inflating: bp/manifest.json        
  inflating: bp/pack_icon.png        
   creating: bp/scripts/
  inflating: bp/scripts/index.js     

$ cat bp/manifest.json 
{
    "format_version": 2,
    "header": {
        "description": "v4.0.0 - Pack by FoxyNoTail - Enable one player sleeping on your world or server. - Visit www.foxynotail.com for more packs & add-ons - ©2023, FoxyNoTail",
        "name": "One Player Sleep v4.0.0",
        "uuid": "1bc0be5c-92c1-4890-98b2-7b84fad6c6ef",
        "version": [4, 0, 0],
# more output excluded

And there in the header section you can see the UUID is 1bc... and version 4.0.0.

Finally, with the .mcaddon file and the UUID I was able to install it, and here's what that looks like:

$ ls docker-compose.yml 
docker-compose.yml

$ ls data/behavior_packs/*.mcaddon 
data/behavior_packs/ops-v4.0.0.mcaddon

$ cat data/valid_known_packs.json 
[
        # Note: lots of other lines here I'm omitting, but at the end:
        { 
                "file_system" : "RawPath", 
                "path" : "behavior_packs/ops-v4.0.0.mcaddon", 
                "uuid" : "1bc0be5c-92c1-4890-98b2-7b84fad6c6ef", 
                "version" : "4.0.0" 
        }
]

# Note: I had to create the following file, as per instructions.
$ cat data/worlds/Bedrock\ level/world_resource_packs.json 
[
	{
		"pack_id" : "1bc0be5c-92c1-4890-98b2-7b84fad6c6ef",
		"version" : [ 4, 0, 0 ]
	}
]

$ docker compose up
# Lots of output but then you'll see:
mc  | [2023-12-16 09:50:37:607 INFO] [Scripting] Plugin [One Player Sleep v4.0.0] - promoted [@minecraft/server] from [1.3.0] to [1.7.0] requested by [One Player Sleep v4.0.0 - 1.0.0].

I didn't verify the plugin actually works in-game. I'm really just trying to learn how to install mods and what they are with the hope that eventually I can figure out how to install a OneBlock game, a morphing mod of some kind (turn into animals), or a pre-built world.

Regarding the idea of a mod installer being part of this project I like that it doesn't. This project seems to be a no frills approach to managing a Minecraft server and I REALLY like that simplicity.

josephdpurcell avatar Dec 16 '23 10:12 josephdpurcell