itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.55k stars 1.55k forks source link

How do we use forge mods? Mods not reflecting #1086

Closed ruanbekker closed 3 years ago

ruanbekker commented 3 years ago

Hello, first off, great project, its super useful!

Perhaps i'm doing it wrong but how do we use forge mods on the server so that all the players can use the mods? As far as I am aware, the mods are being installed on the server, then the players need to use the forge client in their launcher and they should be able to view the mods? Which is not what im seeing :(

  1. Attempt one:

  2. Attempt two (using forge client):

image

  1. Attempt three (using forge client and use the mods locally):
    • TYPE is set to Forge
    • Download the mini-map mod under data/mods as well as placing them under my local installation .minecraft/mods - using (https://media.forgecdn.net/files/3491/662/Xaeros_Minimap_21.19.0_Forge_1.17.1.jar)
    • Installed the forge client (forge-1.17.1-37.0.103-installer.jar) and set the launcher to forge, connect to the server
    • Now I can see the mods, but other players can't as the mods is locally, which I feel defeats the purpose of a modded server.

Below is my config:

version: "3.8"

services:
  minecraft-server:
    image: itzg/minecraft-server:latest
    #image: itzg/minecraft-server:java16
    container_name: minecraft-server
    ports:
      - 25565:25565
    environment:
      SERVER_NAME: "XX-XX"
      MOTD: "Forge Minecraft Server"
      EULA: "TRUE"
      TYPE: "FORGE"
      VERSION: "1.17.1"
      MODE: "survival"
      MEMORY: "1G"
      LEVEL_TYPE: "DEFAULT"
      ENABLE_RCON: "true"
      RCON_PASSWORD: password
      RCON_PORT: 28016
      WHITELIST: "${WHITELISTED_PLAYERS}"
      OPS: "${OPS_PLAYERS}"
      MAX_PLAYERS: 20
      ANNOUNCE_PLAYER_ACHIEVEMENTS: "true"
      SPAWN_ANIMALS: "true"
      SPAWN_MONSTERS: "true"
      PVP: "true"
      LEVEL: "cold"
      TZ: "Africa/Johannesburg"
      GUI: "FALSE"
      ENABLE_WHITELIST: "true"
      MODS_FILE: /extras/mods.txt
      # REMOVE_OLD_MODS: "true"
    restart: unless-stopped
    user: "1002:1002"
    volumes:
      - ./data:/data
      - ./mods.txt:/extras/mods.txt:ro
    logging:
      driver: "json-file"
      options:
        max-size: "1m"

Any help or tips will be much appreciated

itzg commented 3 years ago

2 + 3 is actually the correct approach 😃 Using MODS_LIST is the easiest mod management approach on the server side, but to your initial question: Forge mods need to be installed in both the server and the client. To ease the client pain a bit, I recommend downloading the CurseForge app and creating a custom profile with just the mods you want:

image

What I haven't explored with the CurseForge app is how one can easily share those modpacks without going through the whole publishing process. It looks like you can export

image

and then import

image

ruanbekker commented 3 years ago

Awesome, thanks so much for clarifying.