{
    "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
    "meta": {
        "version": "PTDL_v2",
        "update_url": "https://lightpaper.site/downloads/egg-lightpaper.json"
    },
    "exported_at": "2026-11-04T00:00:00+00:00",
    "name": "Lightpaper",
    "author": "eggs@lightpaper.site",
    "description": "Lightpaper 1.0.0: a free, lightweight Paper egg for Minecraft: Java Edition. Tuned Paper settings in three profiles (feather, balanced, faithful), memory sized to the container, SHA-256 verified downloads, automatic Paper updates within your Minecraft version and safety checks on every boot. Co-engineered with Tozter.site. Docs: https://lightpaper.site/docs",
    "features": [
        "eula",
        "java_version",
        "pid_limit"
    ],
    "docker_images": {
        "Java 25": "ghcr.io/pterodactyl/yolks:java_25",
        "Java 21": "ghcr.io/pterodactyl/yolks:java_21",
        "Java 17": "ghcr.io/pterodactyl/yolks:java_17",
        "Java 16": "ghcr.io/pterodactyl/yolks:java_16",
        "Java 11": "ghcr.io/pterodactyl/yolks:java_11",
        "Java 8": "ghcr.io/pterodactyl/yolks:java_8"
    },
    "file_denylist": [],
    "startup": "java -Xms128M -XX:MaxRAMPercentage=80.0 -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 $(bash .lightpaper/boot.sh) -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}} --nogui",
    "config": {
        "files": "{\n    \"server.properties\": {\n        \"parser\": \"properties\",\n        \"find\": {\n            \"server-ip\": \"0.0.0.0\",\n            \"server-port\": \"{{server.build.default.port}}\",\n            \"query.port\": \"{{server.build.default.port}}\"\n        }\n    }\n}",
        "startup": "{\n    \"done\": \")! For help, type \"\n}",
        "logs": "{}",
        "stop": "stop"
    },
    "scripts": {
        "installation": {
            "script": "#!/bin/ash\n# Lightpaper installer 1.0.0 (https://lightpaper.site), co-engineered with Tozter.site.\n#\n# Runs when the server is created and on every reinstall. It downloads Paper straight from PaperMC,\n# checks the file against PaperMC's SHA-256, and writes Lightpaper's tuned settings for files that\n# don't exist yet. Worlds, plugins and settings you already have are never changed, unless\n# \"Reset configs on reinstall\" is on: then the old files are backed up to .lightpaper/backups first.\n# The Minecraft EULA is never accepted for you.\n\nLP_VERSION=\"1.0.0\"\nUA=\"Lightpaper/${LP_VERSION} (+https://lightpaper.site)\"\nAPI=\"https://fill.papermc.io/v3/projects/paper\"\n\nsay()  { printf '\\033[38;5;222m[lightpaper]\\033[0m %s\\n' \"$*\"; }\nwarn() { printf '\\033[38;5;215m[lightpaper] %s\\033[0m\\n' \"$*\"; }\ndie()  { printf '\\033[38;5;210m[lightpaper] %s\\033[0m\\n' \"$*\"; exit 1; }\nget()  { curl -fsSL --retry 3 --retry-delay 2 --connect-timeout 10 --max-time 60 -A \"$UA\" \"$@\"; }\non()   { case \"${1:-}\" in 1|true|TRUE|True|yes|on) return 0 ;; *) return 1 ;; esac; }\n\nmkdir -p /mnt/server && cd /mnt/server || die \"Can't open the server folder.\"\nmkdir -p .lightpaper\nrm -f .lightpaper/paper.download\n\nsay \"Lightpaper ${LP_VERSION}: installing Paper\"\n\n# ---------- Which Minecraft version and build ----------\nVERSION=\"${MINECRAFT_VERSION:-latest}\"\nBUILD=\"${BUILD_NUMBER:-latest}\"\n[ -z \"$VERSION\" ] && VERSION=latest\n[ -z \"$BUILD\" ] && BUILD=latest\necho \"$VERSION\" | grep -qE '^[0-9A-Za-z._-]{1,32}$' || die \"\\\"${VERSION}\\\" doesn't look like a Minecraft version.\"\necho \"$BUILD\" | grep -qE '^(latest|LATEST|[0-9]{1,6})$' || die \"Build Number must be \\\"latest\\\" or a number.\"\n[ \"$BUILD\" = \"LATEST\" ] && BUILD=latest\n\nPROJECT_JSON=$(get \"$API\") || die \"Couldn't reach PaperMC (fill.papermc.io). Check the node's internet connection and reinstall.\"\n\nif [ \"$VERSION\" = \"latest\" ] || [ \"$VERSION\" = \"LATEST\" ]; then\n  VERSION=\"\"\n  # The newest full release (no pre-releases or release candidates) that has a stable build.\n  for v in $(echo \"$PROJECT_JSON\" | jq -r '.versions | to_entries[] | .value[]' | grep -viE 'pre|rc|snapshot|-'); do\n    n=$(get \"$API/versions/$v/builds?channel=STABLE\" | jq -r 'length' 2>/dev/null)\n    if [ -n \"$n\" ] && [ \"$n\" -gt 0 ] 2>/dev/null; then VERSION=\"$v\"; break; fi\n  done\n  [ -n \"$VERSION\" ] || die \"PaperMC has no stable release to install right now. Try again later.\"\n  say \"Latest stable Minecraft version: ${VERSION}\"\nelse\n  echo \"$PROJECT_JSON\" | jq -e --arg v \"$VERSION\" '[.versions[][]] | index($v) != null' >/dev/null \\\n    || die \"Paper has no Minecraft ${VERSION}. Pick another version on the Startup page (or \\\"latest\\\") and reinstall.\"\nfi\n\nif [ \"$BUILD\" = \"latest\" ]; then\n  BUILD_JSON=$(get \"$API/versions/$VERSION/builds?channel=STABLE\" | jq -c '.[0] // empty')\n  if [ -z \"$BUILD_JSON\" ]; then\n    BUILD_JSON=$(get \"$API/versions/$VERSION/builds/latest\") || die \"Couldn't read Paper's builds for ${VERSION}.\"\n    warn \"Minecraft ${VERSION} has no stable Paper build yet, so the newest test build is used.\"\n  fi\nelse\n  BUILD_JSON=$(get \"$API/versions/$VERSION/builds/$BUILD\") || die \"Paper ${VERSION} has no build ${BUILD}. Use \\\"latest\\\" or another number.\"\nfi\n\nBUILD_ID=$(echo \"$BUILD_JSON\" | jq -r '.id')\nCHANNEL=$(echo \"$BUILD_JSON\" | jq -r '.channel // \"UNKNOWN\"')\nURL=$(echo \"$BUILD_JSON\" | jq -r '.downloads.\"server:default\".url // empty')\nSHA=$(echo \"$BUILD_JSON\" | jq -r '.downloads.\"server:default\".checksums.sha256 // empty')\nJAVA_MIN=$(get \"$API/versions/$VERSION\" | jq -r '.version.java.version.minimum // empty' 2>/dev/null)\n\ncase \"$URL\" in https://fill-data.papermc.io/*|https://api.papermc.io/*|https://fill.papermc.io/*) ;; *) die \"PaperMC sent an unexpected download address, so nothing was downloaded.\" ;; esac\necho \"$SHA\" | grep -qE '^[0-9a-f]{64}$' || die \"PaperMC sent no checksum for this build, so nothing was downloaded.\"\n\n# ---------- Download and verify ----------\nJAR=\"${SERVER_JARFILE:-server.jar}\"\necho \"$JAR\" | grep -qE '^[A-Za-z0-9._-]+\\.jar$' || die \"Server Jar File must be a plain file name ending in .jar.\"\n\nsay \"Downloading Paper ${VERSION} build ${BUILD_ID} (${CHANNEL})\"\ncurl -fsSL --retry 3 --retry-delay 2 --connect-timeout 10 --max-time 600 -A \"$UA\" -o .lightpaper/paper.download \"$URL\" \\\n  || { rm -f .lightpaper/paper.download; die \"The Paper download failed. Reinstall to try again.\"; }\nGOT=$(sha256sum .lightpaper/paper.download | cut -d' ' -f1)\nif [ \"$GOT\" != \"$SHA\" ]; then\n  rm -f .lightpaper/paper.download\n  die \"The download didn't match PaperMC's SHA-256 checksum, so it was deleted. Reinstall to try again.\"\nfi\nmv -f .lightpaper/paper.download \"$JAR\"\nsay \"Checksum verified (SHA-256 ${SHA})\"\n\n# ---------- Settings ----------\nPROFILE=\"${LP_PROFILE:-balanced}\"\ncase \"$PROFILE\" in faithful|balanced|feather) ;; *) die \"Profile must be faithful, balanced or feather.\" ;; esac\nRESET=0; on \"${LP_RESET_CONFIGS:-0}\" && RESET=1\nSTAMP=$(date -u +%Y%m%d-%H%M%S)\nBACKUP=\".lightpaper/backups/${STAMP}\"\nWROTE=\"\"; KEPT=\"\"\n\nbackup() {\n  mkdir -p \"$BACKUP/$(dirname \"$1\")\" && cp -p \"$1\" \"$BACKUP/$1\"\n}\n# put <file>: writes stdin to the file when it doesn't exist yet, or when resetting (after a backup).\nput() {\n  if [ -e \"$1\" ]; then\n    if [ \"$RESET\" != 1 ]; then cat >/dev/null; KEPT=\"$KEPT $1\"; return 0; fi\n    backup \"$1\"\n  fi\n  mkdir -p \"$(dirname \"$1\")\"\n  cat > \"$1\"\n  WROTE=\"$WROTE $1\"\n}\n# server.properties: a new server gets all of Lightpaper's settings. A reset only puts back the\n# profile's performance settings, so your MOTD, whitelist, online mode and RCON choices stay yours.\nRESET_KEYS=\"view-distance simulation-distance pause-when-empty-seconds network-compression-threshold\"\nput_props() {\n  if [ ! -e server.properties ]; then cat > server.properties; WROTE=\"$WROTE server.properties\"; return 0; fi\n  if [ \"$RESET\" != 1 ]; then cat >/dev/null; KEPT=\"$KEPT server.properties\"; return 0; fi\n  backup server.properties\n  while IFS= read -r line; do\n    case \"$line\" in \\#*|\"\") continue ;; esac\n    key=\"${line%%=*}\"\n    case \" $RESET_KEYS \" in *\" $key \"*) ;; *) continue ;; esac\n    if grep -q \"^${key}=\" server.properties; then\n      awk -v k=\"$key\" -v l=\"$line\" 'index($0, k \"=\") == 1 { print l; next } { print }' server.properties > .lightpaper/props.tmp \\\n        && mv -f .lightpaper/props.tmp server.properties\n    else\n      echo \"$line\" >> server.properties\n    fi\n  done\n  WROTE=\"$WROTE server.properties(performance)\"\n}\n\n# Paper's own YAML settings are written for Minecraft 1.21 and newer, where Lightpaper is tested.\nMAJ=$(echo \"$VERSION\" | cut -d. -f1 | sed 's/[^0-9].*//')\nMIN=$(echo \"$VERSION\" | cut -d. -f2 | sed 's/[^0-9].*//')\nMODERN=0; LAYOUT=old\nif [ \"${MAJ:-0}\" -ge 26 ] 2>/dev/null; then MODERN=1; LAYOUT=new\nelif [ \"${MAJ:-0}\" = 1 ] && [ \"${MIN:-0}\" -ge 21 ] 2>/dev/null; then MODERN=1\nfi\n\ncase \"$PROFILE\" in\nfaithful)\nput_props <<'LP_EOF'\n#Lightpaper faithful profile: vanilla gameplay with safe defaults\nmotd=A Lightpaper server\nonline-mode=true\nenforce-secure-profile=true\nwhite-list=true\nenforce-whitelist=true\nenable-rcon=false\nenable-query=false\naccepts-transfers=false\nmax-players=20\nspawn-protection=16\nnetwork-compression-threshold=256\nview-distance=10\nsimulation-distance=10\npause-when-empty-seconds=-1\nLP_EOF\nput bukkit.yml <<'LP_EOF'\n# Lightpaper faithful profile. Only security settings differ from Paper's defaults.\nsettings:\n  # Don't list your plugins to anyone who queries the server.\n  query-plugins: false\n  connection-throttle: 4000\nLP_EOF\nput spigot.yml <<'LP_EOF'\n# Lightpaper faithful profile.\nsettings:\n  # Write the player name cache only when the server stops, not on every join.\n  save-user-cache-on-stop-only: true\ncommands:\n  # Hide \"plugin:command\" duplicates from tab completion. Typed commands still work.\n  send-namespaced: false\nLP_EOF\nif [ \"$MODERN\" = 1 ]; then\nput config/paper-world-defaults.yml <<'LP_EOF'\n# Lightpaper faithful profile. Gameplay stays vanilla; only protections are added.\nanticheat:\n  anti-xray:\n    # Hides ores that players can't see yet, so x-ray clients find nothing. Mode 1 is the cheap one.\n    enabled: true\n    engine-mode: 1\nchunks:\n  # Caps what one chunk may save, so lag machines and \"chunk bans\" can't build up.\n  entity-per-chunk-save-limit:\n    arrow: 16\n    ender_pearl: 16\n    experience_orb: 16\n    fireball: 8\n    small_fireball: 8\n    snowball: 8\nLP_EOF\nput config/paper-global.yml <<'LP_EOF'\n# Lightpaper faithful profile. Paper's own defaults here; written so that switching away from\n# the feather profile with a reset puts these back.\nchunk-loading-basic:\n  player-max-chunk-generate-rate: -1.0\nmisc:\n  max-joins-per-tick: 5\nLP_EOF\nfi\n;;\nbalanced)\nput_props <<'LP_EOF'\n#Lightpaper balanced profile: lighter, with gameplay kept close to vanilla\nmotd=A Lightpaper server\nonline-mode=true\nenforce-secure-profile=true\nwhite-list=true\nenforce-whitelist=true\nenable-rcon=false\nenable-query=false\naccepts-transfers=false\nmax-players=20\nspawn-protection=16\nnetwork-compression-threshold=256\nview-distance=8\nsimulation-distance=6\npause-when-empty-seconds=120\nLP_EOF\nput bukkit.yml <<'LP_EOF'\n# Lightpaper balanced profile.\nsettings:\n  # Don't list your plugins to anyone who queries the server.\n  query-plugins: false\n  connection-throttle: 4000\nspawn-limits:\n  monsters: 50\n  animals: 10\n  water-animals: 5\n  water-ambient: 10\n  water-underground-creature: 5\n  axolotls: 5\n  ambient: 5\nticks-per:\n  water-ambient-spawns: 20\n  ambient-spawns: 20\nLP_EOF\nput spigot.yml <<'LP_EOF'\n# Lightpaper balanced profile.\nsettings:\n  save-user-cache-on-stop-only: true\ncommands:\n  send-namespaced: false\nworld-settings:\n  default:\n    merge-radius:\n      item: 2.5\n      exp: 3.0\n    arrow-despawn-rate: 600\n    entity-activation-range:\n      animals: 24\n      monsters: 28\n      raiders: 48\n      misc: 12\n      water: 12\n      villagers: 24\n      flying-monsters: 32\n    entity-tracking-range:\n      players: 96\n      animals: 64\n      monsters: 64\n      misc: 32\n      display: 96\n      other: 48\nLP_EOF\nif [ \"$MODERN\" = 1 ]; then\nput config/paper-world-defaults.yml <<'LP_EOF'\n# Lightpaper balanced profile.\nanticheat:\n  anti-xray:\n    enabled: true\n    engine-mode: 1\nchunks:\n  entity-per-chunk-save-limit:\n    arrow: 16\n    ender_pearl: 16\n    experience_orb: 16\n    fireball: 8\n    small_fireball: 8\n    snowball: 8\n  # Stop players from walking into chunks that aren't loaded yet (a common cause of lag spikes).\n  prevent-moving-into-unloaded-chunks: true\ncollisions:\n  max-entity-collisions: 4\nentities:\n  armor-stands:\n    do-collision-entity-lookups: false\n  spawning:\n    creative-arrow-despawn-rate: 60\n    non-player-arrow-despawn-rate: 60\n    despawn-ranges:\n      monster:\n        hard: 96\n        soft: 32\nenvironment:\n  optimize-explosions: true\n  treasure-maps:\n    find-already-discovered:\n      loot-tables: true\n      villager-trade: true\nfixes:\n  fix-items-merging-through-walls: true\nmisc:\n  redstone-implementation: ALTERNATE_CURRENT\ntick-rates:\n  grass-spread: 4\n  behavior:\n    villager:\n      validatenearbypoi: 60\n  sensor:\n    villager:\n      secondarypoisensor: 80\nLP_EOF\nput config/paper-global.yml <<'LP_EOF'\n# Lightpaper balanced profile. Paper's own defaults here; written so that switching away from\n# the feather profile with a reset puts these back.\nchunk-loading-basic:\n  player-max-chunk-generate-rate: -1.0\nmisc:\n  max-joins-per-tick: 5\nLP_EOF\nfi\n;;\nfeather)\nput_props <<'LP_EOF'\n#Lightpaper feather profile: as light as possible, for small servers\nmotd=A Lightpaper server\nonline-mode=true\nenforce-secure-profile=true\nwhite-list=true\nenforce-whitelist=true\nenable-rcon=false\nenable-query=false\naccepts-transfers=false\nmax-players=20\nspawn-protection=16\nnetwork-compression-threshold=256\nview-distance=6\nsimulation-distance=4\npause-when-empty-seconds=60\nLP_EOF\nput bukkit.yml <<'LP_EOF'\n# Lightpaper feather profile.\nsettings:\n  # Don't list your plugins to anyone who queries the server.\n  query-plugins: false\n  connection-throttle: 4000\nspawn-limits:\n  monsters: 35\n  animals: 8\n  water-animals: 3\n  water-ambient: 5\n  water-underground-creature: 3\n  axolotls: 3\n  ambient: 2\nticks-per:\n  monster-spawns: 4\n  water-spawns: 4\n  water-ambient-spawns: 40\n  water-underground-creature-spawns: 4\n  axolotl-spawns: 4\n  ambient-spawns: 40\nLP_EOF\nput spigot.yml <<'LP_EOF'\n# Lightpaper feather profile.\nsettings:\n  save-user-cache-on-stop-only: true\ncommands:\n  send-namespaced: false\nworld-settings:\n  default:\n    merge-radius:\n      item: 3.5\n      exp: 4.0\n    item-despawn-rate: 4000\n    arrow-despawn-rate: 300\n    entity-activation-range:\n      animals: 16\n      monsters: 24\n      raiders: 48\n      misc: 8\n      water: 8\n      villagers: 16\n      flying-monsters: 32\n      tick-inactive-villagers: false\n    entity-tracking-range:\n      players: 64\n      animals: 48\n      monsters: 48\n      misc: 32\n      display: 64\n      other: 32\nLP_EOF\nif [ \"$MODERN\" = 1 ]; then\nput config/paper-world-defaults.yml <<'LP_EOF'\n# Lightpaper feather profile.\nanticheat:\n  anti-xray:\n    enabled: true\n    engine-mode: 1\nchunks:\n  entity-per-chunk-save-limit:\n    arrow: 16\n    ender_pearl: 16\n    experience_orb: 16\n    fireball: 8\n    small_fireball: 8\n    snowball: 8\n  prevent-moving-into-unloaded-chunks: true\ncollisions:\n  max-entity-collisions: 2\nentities:\n  armor-stands:\n    do-collision-entity-lookups: false\n    tick: false\n  spawning:\n    creative-arrow-despawn-rate: 60\n    non-player-arrow-despawn-rate: 60\n    despawn-ranges:\n      monster:\n        hard: 72\n        soft: 28\n    alt-item-despawn-rate:\n      enabled: true\n      items:\n        cobblestone: 300\n        cobbled_deepslate: 300\n        netherrack: 300\n        dirt: 300\n        gravel: 300\n        sand: 300\n        red_sand: 300\n        andesite: 300\n        diorite: 300\n        granite: 300\n        tuff: 300\nenvironment:\n  optimize-explosions: true\n  treasure-maps:\n    find-already-discovered:\n      loot-tables: true\n      villager-trade: true\nfixes:\n  fix-items-merging-through-walls: true\nhopper:\n  ignore-occluding-blocks: true\nmisc:\n  redstone-implementation: ALTERNATE_CURRENT\n  update-pathfinding-on-block-update: false\ntick-rates:\n  grass-spread: 4\n  behavior:\n    villager:\n      validatenearbypoi: 60\n  sensor:\n    villager:\n      secondarypoisensor: 80\nLP_EOF\nput config/paper-global.yml <<'LP_EOF'\n# Lightpaper feather profile.\nchunk-loading-basic:\n  # Limit how fast one player can make the server generate new chunks (elytra flights, mostly).\n  player-max-chunk-generate-rate: 40.0\nmisc:\n  max-joins-per-tick: 3\nLP_EOF\nfi\n;;\nesac\n\nif [ \"$MODERN\" = 1 ]; then\n  LEVEL=$(sed -n 's/^level-name=//p' server.properties 2>/dev/null | tail -n1 | tr -d '\\r')\n  echo \"$LEVEL\" | grep -qE '^[A-Za-z0-9 _.-]{1,64}$' && ! echo \"$LEVEL\" | grep -q '\\.\\.' || LEVEL=world\n  if [ \"$LAYOUT\" = new ]; then\n    NETHER=\"$LEVEL/dimensions/minecraft/the_nether/paper-world.yml\"; END=\"$LEVEL/dimensions/minecraft/the_end/paper-world.yml\"\n  else\n    NETHER=\"${LEVEL}_nether/paper-world.yml\"; END=\"${LEVEL}_the_end/paper-world.yml\"\n  fi\n  # Paper treats a dimension folder that already exists as an existing world, so these folders must\n  # never be created here. The templates wait in .lightpaper/dimensions, and the boot script fills\n  # in each dimension's paper-world.yml once Paper has made it, only while it is still untouched.\n  mkdir -p .lightpaper/dimensions\n  cat > .lightpaper/dimensions/nether.yml <<'LP_EOF'\n# Lightpaper: anti-xray tuned for the Nether.\nanticheat:\n  anti-xray:\n    enabled: true\n    engine-mode: 1\n    max-block-height: 128\n    hidden-blocks:\n    - ancient_debris\n    - nether_gold_ore\n    - nether_quartz_ore\nLP_EOF\n  cat > .lightpaper/dimensions/end.yml <<'LP_EOF'\n# Lightpaper: the End has no ores, so anti-xray is switched off here to save work.\nanticheat:\n  anti-xray:\n    enabled: false\nLP_EOF\n  DIMS=pending\n  if [ \"$RESET\" = 1 ]; then\n    for pair in \"$NETHER|nether\" \"$END|end\"; do\n      f=\"${pair%|*}\"; t=\"${pair#*|}\"\n      [ -f \"$f\" ] || continue\n      backup \"$f\"\n      v=$(grep -m1 '^_version:' \"$f\")\n      { [ -n \"$v\" ] && echo \"$v\"; cat \".lightpaper/dimensions/$t.yml\"; } > \"$f.lp\" && mv -f \"$f.lp\" \"$f\"\n      WROTE=\"$WROTE $f\"\n    done\n  fi\nelse\n  DIMS=none\n  warn \"Minecraft ${VERSION} is older than 1.21, so only server.properties, bukkit.yml and spigot.yml were tuned.\"\nfi\n\n# ---------- Boot script and state ----------\ncat > .lightpaper/boot.sh <<'LP_BOOT_EOF'\n#!/bin/bash\n# Lightpaper boot script. https://lightpaper.site\n#\n# The startup command runs this on every start, just before Java. It prints the Lightpaper banner,\n# checks the server's safety settings, keeps Paper up to date within your Minecraft version, and works\n# out how much memory Java may use.\n#\n# Everything it shows goes to the console. The only thing it hands back to the startup command is a\n# few extra Java flags (the heap size, and compact object headers on Java 25+). If this file is\n# missing or fails, the server still starts with the flags already in the startup command.\n#\n# The installer writes this file. A reinstall puts back a fresh copy, so edits here don't last.\n\nLP_VERSION=\"1.0.0\"\n\n# Anything printed by mistake must never end up inside the Java command, so stdout is set aside\n# (fd 3) and only the final flags are written to it.\nexec 3>&1 1>&2\n\ncd /home/container 2>/dev/null || true\nSTATE=\".lightpaper/state\"\nAPI=\"https://fill.papermc.io/v3/projects/paper\"\nUA=\"Lightpaper/${LP_VERSION} (+https://lightpaper.site)\"\nJAR=\"${SERVER_JARFILE:-server.jar}\"\n\nstate() { [ -f \"$STATE\" ] && sed -n \"s/^$1=//p\" \"$STATE\" 2>/dev/null | head -n1; }\nset_state() {\n  [ -f \"$STATE\" ] || return 0\n  { grep -v \"^$1=\" \"$STATE\" 2>/dev/null; printf '%s=%s\\n' \"$1\" \"$2\"; } > \"$STATE.tmp\" 2>/dev/null && mv -f \"$STATE.tmp\" \"$STATE\" 2>/dev/null\n}\nprop() { [ -f server.properties ] && sed -n \"s/^$1=//p\" server.properties 2>/dev/null | tail -n1 | tr -d '\\r'; }\nis_on() { case \"${1:-}\" in 1|true|TRUE|True|yes|on) return 0 ;; *) return 1 ;; esac; }\n\ne=$'\\e'; r=\"${e}[0m\"; b=\"${e}[1m\"\ndim=\"${e}[38;5;245m\"; val=\"${e}[1;97m\"; acc=\"${e}[38;5;222m\"\nok=\"${e}[38;5;150m\"; warn=\"${e}[38;5;215m\"; bad=\"${e}[38;5;210m\"\ngrad=(\"${e}[38;5;230m\" \"${e}[38;5;223m\" \"${e}[38;5;222m\" \"${e}[38;5;221m\" \"${e}[38;5;215m\")\n\nnotes=()   # lines shown under the banner, already coloured\nnote() { notes+=(\"$1\"); }\n\n# ---------- Java ----------\njava_full=\"\"\ncommand -v java >/dev/null 2>&1 && java_full=$(java -version 2>&1 | sed -n 's/.*version \"\\([^\"]*\\)\".*/\\1/p' | head -n1)\njava_major=\"${java_full%%.*}\"\n[ \"$java_major\" = \"1\" ] && { java_major=\"${java_full#1.}\"; java_major=\"${java_major%%.*}\"; }\ncase \"$java_major\" in ''|*[!0-9]*) java_major=0 ;; esac\n\nmc=$(state mc_version); build=$(state build); java_min=$(state java_min)\ncase \"$java_min\" in ''|*[!0-9]*) java_min=0 ;; esac\nif [ \"$java_min\" -gt 0 ] && [ \"$java_major\" -gt 0 ] && [ \"$java_major\" -lt \"$java_min\" ]; then\n  note \"${bad}✗${r} Paper ${mc} needs Java ${java_min}, but this server has Java ${java_major}.\"\n  note \"  ${dim}Fix: Startup page > Docker Image > pick Java ${java_min}, then start again.${r}\"\nfi\n\n# ---------- Paper updates (same Minecraft version, stable builds only) ----------\nupdated=\"\"\njar_sha=\"\"\n[ -f \"$JAR\" ] && jar_sha=$(sha256sum \"$JAR\" 2>/dev/null | cut -d' ' -f1)\nupdate_paper() {\n  is_on \"${LP_AUTO_UPDATE:-1}\" || return 0\n  case \"${BUILD_NUMBER:-latest}\" in latest|LATEST|\"\") ;; *) return 0 ;; esac\n  # A jar the owner put there themselves (or a missing one) is theirs: never replace it.\n  [ -n \"$jar_sha\" ] && [ \"$jar_sha\" = \"$(state jar_sha256)\" ] || return 0\n  case \"$mc\" in ''|*[!0-9A-Za-z._-]*) return 0 ;; esac\n  case \"$build\" in ''|*[!0-9]*) return 0 ;; esac\n  local now last json id channel seg sha url got\n  now=$(date +%s); last=$(state last_check)\n  case \"$last\" in ''|*[!0-9]*) last=0 ;; esac\n  # At most one check every 30 minutes, so a crash loop doesn't hammer PaperMC.\n  [ $((now - last)) -lt 1800 ] && return 0\n  set_state last_check \"$now\"\n\n  json=$(curl -fsS --connect-timeout 4 --max-time 8 -A \"$UA\" \"$API/versions/$mc/builds/latest\" 2>/dev/null) || {\n    note \"${dim}·${r} Couldn't reach PaperMC to look for updates. Starting the installed build.\"\n    return 0\n  }\n  id=$(printf '%s' \"$json\" | grep -o '\"id\" *: *[0-9]*' | head -n1 | grep -o '[0-9]*$')\n  channel=$(printf '%s' \"$json\" | grep -o '\"channel\" *: *\"[A-Z]*\"' | head -n1 | grep -o '[A-Z]*\"$' | tr -d '\"')\n  [ \"$channel\" = \"STABLE\" ] || return 0\n  case \"$id\" in ''|*[!0-9]*) return 0 ;; esac\n  [ \"$id\" -gt \"$build\" ] || return 0\n\n  seg=\"${json#*\\\"server:default\\\"}\"\n  sha=$(printf '%s' \"$seg\" | grep -o '\"sha256\" *: *\"[0-9a-f]\\{64\\}\"' | head -n1 | grep -o '[0-9a-f]\\{64\\}')\n  url=$(printf '%s' \"$seg\" | grep -o '\"url\" *: *\"[^\"]*\"' | head -n1 | sed 's/.*\"\\([^\"]*\\)\"$/\\1/')\n  # Only ever download from PaperMC, over HTTPS.\n  case \"$url\" in https://fill-data.papermc.io/*|https://api.papermc.io/*|https://fill.papermc.io/*) ;; *) return 0 ;; esac\n  [ \"${#sha}\" -eq 64 ] || return 0\n\n  printf \"  ${acc}↻${r} Paper ${mc} build ${id} is out. Downloading it…\\n\"\n  rm -f .lightpaper/paper.download\n  if ! curl -fsS --connect-timeout 5 --max-time 240 -A \"$UA\" -o .lightpaper/paper.download \"$url\" 2>/dev/null; then\n    rm -f .lightpaper/paper.download\n    note \"${warn}!${r} The Paper update didn't download. Starting build ${build} for now.\"\n    return 0\n  fi\n  got=$(sha256sum .lightpaper/paper.download 2>/dev/null | cut -d' ' -f1)\n  if [ \"$got\" != \"$sha\" ]; then\n    rm -f .lightpaper/paper.download\n    note \"${bad}✗${r} The Paper download didn't match PaperMC's checksum, so it was thrown away.\"\n    return 0\n  fi\n  mv -f .lightpaper/paper.download \"$JAR\" || return 0\n  set_state build \"$id\"; set_state jar_sha256 \"$sha\"; jar_sha=\"$sha\"\n  updated=\"${build} → ${id}\"; build=\"$id\"\n}\nupdate_paper\n\n# ---------- Nether and End settings ----------\n# The installer can't create dimension folders (Paper would think the world already exists), so each\n# dimension's paper-world.yml gets Lightpaper's settings here, once Paper has made it. A file that has\n# anything besides Paper's own \"_version\" line is left alone: those are someone's settings.\napply_dimensions() {\n  [ \"$(state dims)\" = \"pending\" ] || return 0\n  local level nether end f t v all=1\n  level=$(prop level-name)\n  case \"$level\" in ''|*..*|*/*) level=world ;; esac\n  if [ \"$(state layout)\" = \"new\" ]; then\n    nether=\"$level/dimensions/minecraft/the_nether/paper-world.yml\"; end=\"$level/dimensions/minecraft/the_end/paper-world.yml\"\n  else\n    nether=\"${level}_nether/paper-world.yml\"; end=\"${level}_the_end/paper-world.yml\"\n  fi\n  for pair in \"$nether|nether\" \"$end|end\"; do\n    f=\"${pair%|*}\"; t=\"${pair#*|}\"\n    if [ ! -f \"$f\" ]; then all=0; continue; fi\n    [ -f \".lightpaper/dimensions/$t.yml\" ] || continue\n    grep -vE '^[[:space:]]*(#.*)?$|^_version:' \"$f\" | grep -q . && continue\n    v=$(grep -m1 '^_version:' \"$f\")\n    { [ -n \"$v\" ] && echo \"$v\"; cat \".lightpaper/dimensions/$t.yml\"; } > \"$f.lp\" 2>/dev/null && mv -f \"$f.lp\" \"$f\"\n  done\n  [ \"$all\" = 1 ] && set_state dims applied\n}\napply_dimensions\n\n# ---------- Checks ----------\nchecks=()\ncheck() { checks+=(\"$1\"); }\n\nif [ ! -f \"$JAR\" ]; then\n  note \"${bad}✗${r} ${JAR} is missing. Reinstall the server to download Paper again.\"\nelse\n  want=$(state jar_sha256)\n  if [ -n \"$want\" ]; then\n    have=\"$jar_sha\"\n    if [ \"$have\" = \"$want\" ]; then check \"${ok}✓${r} jar verified\"\n    else note \"${warn}!${r} ${JAR} isn't the file Lightpaper installed, so it won't be auto-updated. Fine if you swapped it on purpose.\"\n    fi\n  fi\nfi\n\nproxy=\"\"\ngrep -qE '^[[:space:]]*bungeecord:[[:space:]]*true' spigot.yml 2>/dev/null && proxy=\"BungeeCord\"\nvelocity=$(awk '/^  velocity:/{f=1;next} f&&/^  [^ ]/{f=0} f&&/^    enabled:/{print $2; exit}' config/paper-global.yml 2>/dev/null)\nis_on \"$velocity\" && proxy=\"Velocity\"\n\nif [ \"$(prop online-mode)\" = \"false\" ]; then\n  if [ -n \"$proxy\" ]; then\n    check \"${ok}✓${r} ${proxy} forwarding\"\n    if [ \"$proxy\" = \"Velocity\" ] && [ -z \"${PAPER_VELOCITY_SECRET:-}\" ] \\\n       && ! grep -qE \"^    secret: *['\\\"]?[^'\\\" ]\" config/paper-global.yml 2>/dev/null; then\n      note \"${bad}✗${r} Velocity is on but has no secret. Add it in the Velocity secret variable.\"\n    fi\n    [ \"$proxy\" = \"BungeeCord\" ] && note \"${warn}!${r} BungeeCord forwarding can be faked. Only the proxy should reach this port.\"\n  else\n    note \"${bad}✗${r} online-mode is off: anyone can join with any name, even an op's.\"\n    note \"  ${dim}Turn online-mode back on unless a proxy (Velocity) sits in front of this server.${r}\"\n  fi\nelse\n  check \"${ok}✓${r} online mode\"\nfi\n\n[ \"$(prop enforce-secure-profile)\" = \"false\" ] || check \"${ok}✓${r} secure chat\"\n\nif [ \"$(prop enable-rcon)\" = \"true\" ]; then\n  pw=$(prop rcon.password)\n  if [ \"${#pw}\" -lt 12 ]; then note \"${bad}✗${r} RCON is on with a short or empty password. Use 12+ characters, or turn it off.\"\n  else note \"${dim}·${r} RCON is on. Keep its password private.\"\n  fi\nelse\n  check \"${ok}✓${r} RCON off\"\nfi\n[ \"$(prop enable-query)\" = \"true\" ] && note \"${dim}·${r} Query is on, so anyone can read the player list.\"\n\nif [ \"$(prop white-list)\" = \"true\" ]; then\n  note \"${dim}·${r} Whitelist is on. Let friends in with ${val}whitelist add <name>${r} in this console.\"\nelse\n  note \"${dim}·${r} Whitelist is off: anyone with the address can join.\"\nfi\n\ngrep -qiE '^eula=true' eula.txt 2>/dev/null || \\\n  note \"${acc}▸${r} First start: accept the Minecraft EULA when the panel asks (aka.ms/MinecraftEULA).\"\n\nprofile=$(state profile)\nwanted=\"${LP_PROFILE:-}\"\nif [ -n \"$profile\" ] && [ -n \"$wanted\" ] && [ \"$profile\" != \"$wanted\" ]; then\n  note \"${dim}·${r} Profile is set to ${wanted}, but ${profile} is applied. Turn on Reset configs and reinstall to switch.\"\nfi\n\n# ---------- Memory ----------\nlimit_mb=0\nif [ -r /sys/fs/cgroup/memory.max ]; then\n  v=$(cat /sys/fs/cgroup/memory.max 2>/dev/null)\n  case \"$v\" in ''|max|*[!0-9]*) ;; *) limit_mb=$((v / 1048576)) ;; esac\nelif [ -r /sys/fs/cgroup/memory/memory.limit_in_bytes ]; then\n  v=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null)\n  case \"$v\" in ''|*[!0-9]*) ;; *) [ \"${#v}\" -le 15 ] && limit_mb=$((v / 1048576)) ;; esac\nfi\nplan_mb=\"${SERVER_MEMORY:-0}\"\ncase \"$plan_mb\" in ''|*[!0-9]*) plan_mb=0 ;; esac\n[ \"$limit_mb\" -le 0 ] && limit_mb=\"$plan_mb\"\n\nheap=0\nif is_on \"${LP_SMART_MEMORY:-1}\" && [ \"$limit_mb\" -gt 0 ]; then\n  # Java needs room outside the heap too (metaspace, threads, network buffers, the GC itself).\n  # Keep 300 MB + 8% for it (at most 1.5 GB), so the container is not killed for memory.\n  reserve=$((limit_mb * 8 / 100 + 300))\n  [ \"$reserve\" -lt 300 ] && reserve=300\n  [ \"$reserve\" -gt 1536 ] && reserve=1536\n  heap=$((limit_mb - reserve))\n  [ \"$heap\" -lt 256 ] && heap=$((limit_mb * 60 / 100))\n  [ \"$heap\" -lt 64 ] && heap=0\nfi\ngb() { awk -v m=\"$1\" 'BEGIN { if (m >= 1024) { s = sprintf(\"%.1f\", m / 1024); sub(/\\.0$/, \"\", s); print s \" GB\" } else print m \" MB\" }'; }\nshown_mb=\"$plan_mb\"; [ \"$shown_mb\" -le 0 ] && shown_mb=\"$limit_mb\"\nif [ \"$shown_mb\" -gt 0 ]; then mem=\"$(gb \"$shown_mb\")\"; else mem=\"unlimited\"; fi\n[ \"$heap\" -gt 0 ] && mem=\"${mem} · heap $(gb \"$heap\")\"\n[ \"$shown_mb\" -gt 0 ] && [ \"$shown_mb\" -lt 900 ] && note \"${warn}!${r} Under 1 GB of memory: Paper will be tight. The feather profile helps.\"\n\ncpu=\"unlimited\"\nif [ -r /sys/fs/cgroup/cpu.max ]; then\n  read -r q p < /sys/fs/cgroup/cpu.max\n  [ \"$q\" != \"max\" ] && cpu=$(awk -v q=\"$q\" -v p=\"$p\" 'BEGIN { c = q / p; s = sprintf(\"%.2f\", c); sub(/0+$/, \"\", s); sub(/\\.$/, \"\", s); print s (c == 1 ? \" core\" : \" cores\") }')\nfi\n\n# ---------- Banner ----------\npaper=\"Paper ${mc:-?}\"; [ -n \"$build\" ] && paper=\"${paper} · build ${build}\"\ncase \"$profile\" in faithful) pname=\"Faithful\" ;; balanced) pname=\"Balanced\" ;; feather) pname=\"Feather\" ;; *) pname=\"${profile:-?}\" ;; esac\nid=\"${P_SERVER_UUID:-unknown}\"; id=\"${id:0:8}\"\nwhen=$(date -u '+%Y-%m-%d %H:%M UTC')\n\nart=(\n\"██     ██  ████  ██  ██ ██████ █████   ████  █████  ██████ █████\"\n\"██     ██ ██     ██  ██   ██   ██  ██ ██  ██ ██  ██ ██     ██  ██\"\n\"██     ██ ██ ███ ██████   ██   █████  ██████ █████  █████  █████\"\n\"██     ██ ██  ██ ██  ██   ██   ██     ██  ██ ██     ██     ██ ██\"\n\"██████ ██  ████  ██  ██   ██   ██     ██  ██ ██     ██████ ██  ██\"\n)\nline=\"${dim}  ─────────────────────────────────────────────────────────────────${r}\"\nrow() { printf \"  ${dim}%-8s${r} ${val}%-24s${r} ${dim}%-8s${r} ${val}%s${r}\\n\" \"$1\" \"$2\" \"$3\" \"$4\"; }\n\n# Clear the console (screen and scrollback) so the banner starts on a clean page.\nprintf '\\033[H\\033[2J\\033[3J\\n'\nfor i in 0 1 2 3 4; do printf '  %s%s%s\\n' \"${grad[$i]}\" \"${art[$i]}\" \"$r\"; done\nprintf \"  ${acc}${b}LIGHTPAPER.SITE${r}  ${dim}·${r}  ${val}Co-engineered with Tozter.site${r}\\n\"\necho \"$line\"\nrow \"Server\" \"$paper\" \"Profile\" \"$pname\"\nrow \"Java\" \"${java_full:-unknown}\" \"Memory\" \"$mem\"\nrow \"CPU\" \"$cpu\" \"Port\" \"${SERVER_PORT:-?}\"\nrow \"ID\" \"$id\" \"Started\" \"$when\"\necho \"$line\"\n[ -n \"$updated\" ] && printf \"  ${ok}↻${r} Updated Paper build ${updated} (checksum verified)\\n\"\nif [ \"${#checks[@]}\" -gt 0 ]; then\n  printf \"  ${dim}Guard${r}   \"\n  n=0\n  for c in \"${checks[@]}\"; do\n    if [ \"$n\" -eq 4 ]; then printf \"\\n          \"; n=0; fi\n    printf '%s   ' \"$c\"; n=$((n + 1))\n  done\n  printf '\\n'\nfi\nfor n in \"${notes[@]}\"; do printf '  %s\\n' \"$n\"; done\nprintf \"  ${acc}▸${r} Starting Paper. Friends can join once it says ${val}Done${r}.\\n\"\nprintf \"  ${acc}▸${r} Guides and help: ${val}lightpaper.site/docs${r}\\n\"\necho\n\n# ---------- Java flags for the startup command ----------\nflags=\"\"\n[ \"$heap\" -gt 0 ] && flags=\"-Xmx${heap}M\"\n# Java 25 made compact object headers a normal feature: smaller objects, less memory, less GC work.\n[ \"$java_major\" -ge 25 ] && flags=\"${flags} -XX:+UseCompactObjectHeaders\"\nprintf '%s' \"$flags\" >&3\nLP_BOOT_EOF\nchmod 755 .lightpaper/boot.sh\n\ncat > .lightpaper/README.txt <<'LP_EOF'\nThis folder belongs to Lightpaper (https://lightpaper.site).\n\nboot.sh   runs before Java on every start: banner, safety checks, Paper updates, memory sizing.\nstate     what was installed (Minecraft version, Paper build, checksum, profile).\nbackups/  your old settings, saved whenever \"Reset configs on reinstall\" replaced them.\n\nDeleting this folder is safe: the server still starts, just without Lightpaper's extras.\nReinstalling the server puts it back. Your worlds and settings are not touched by a reinstall.\nLP_EOF\n\ncat > .lightpaper/state <<LP_EOF\negg_version=${LP_VERSION}\nmc_version=${VERSION}\nbuild=${BUILD_ID}\nchannel=${CHANNEL}\njava_min=${JAVA_MIN}\njar=${JAR}\njar_sha256=${SHA}\nprofile=${PROFILE}\ndims=${DIMS}\nlayout=${LAYOUT}\ninstalled=$(date -u +%Y-%m-%dT%H:%M:%SZ)\nlast_check=$(date +%s)\nLP_EOF\n\nsay \"Profile: ${PROFILE}\"\n[ -n \"$WROTE\" ] && say \"Wrote:${WROTE}\"\n[ -n \"$KEPT\" ] && say \"Kept your existing:${KEPT}\"\n[ \"$RESET\" = 1 ] && [ -d \"$BACKUP\" ] && say \"Old settings backed up to ${BACKUP}\"\n[ -n \"$JAVA_MIN\" ] && say \"Paper ${VERSION} needs Java ${JAVA_MIN} or newer. Pick it under Startup > Docker Image if it isn't already.\"\nsay \"Done. Start the server and accept the Minecraft EULA when the panel asks.\"\nexit 0\n",
            "container": "ghcr.io/pterodactyl/installers:alpine",
            "entrypoint": "ash"
        }
    },
    "variables": [
        {
            "name": "Minecraft Version",
            "description": "The Minecraft version to install, like 26.3 or 1.21.11. \"latest\" picks the newest stable release. Takes effect when you reinstall. Back up your world before moving to a newer version: it can't go back.",
            "env_variable": "MINECRAFT_VERSION",
            "default_value": "latest",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|string|max:20",
            "field_type": "text"
        },
        {
            "name": "Build Number",
            "description": "The Paper build to install. \"latest\" picks the newest stable build and lets Lightpaper keep it up to date. A number pins that exact build and turns automatic updates off.",
            "env_variable": "BUILD_NUMBER",
            "default_value": "latest",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|string|max:10|alpha_num",
            "field_type": "text"
        },
        {
            "name": "Server Jar File",
            "description": "The file name Paper is saved as and started from.",
            "env_variable": "SERVER_JARFILE",
            "default_value": "server.jar",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|regex:/^([\\w\\d._-]+)(\\.jar)$/",
            "field_type": "text"
        },
        {
            "name": "Lightpaper Profile",
            "description": "feather: lightest, for small servers. balanced: lighter with near-vanilla gameplay. faithful: vanilla gameplay with only safety settings changed. Applies to new servers, or on reinstall with Reset configs on.",
            "env_variable": "LP_PROFILE",
            "default_value": "balanced",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|string|in:feather,balanced,faithful",
            "field_type": "text"
        },
        {
            "name": "Reset Configs on Reinstall",
            "description": "On: the next reinstall writes the profile's settings again, after backing up your current files to .lightpaper/backups. Off: a reinstall never changes your settings.",
            "env_variable": "LP_RESET_CONFIGS",
            "default_value": "0",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|boolean",
            "field_type": "text"
        },
        {
            "name": "Automatic Paper Updates",
            "description": "On: each start installs the newest stable Paper build for your Minecraft version (never a new Minecraft version), checksum verified. Checks at most every 30 minutes.",
            "env_variable": "LP_AUTO_UPDATE",
            "default_value": "1",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|boolean",
            "field_type": "text"
        },
        {
            "name": "Smart Memory",
            "description": "On: the Java heap is sized to the server's memory with room left for Java itself, so the server isn't killed for using too much. Off: Java uses 80% of the memory.",
            "env_variable": "LP_SMART_MEMORY",
            "default_value": "1",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|boolean",
            "field_type": "text"
        },
        {
            "name": "Velocity Secret",
            "description": "Only for servers behind a Velocity proxy: the forwarding secret from the proxy's forwarding.secret file. Also set proxies.velocity.enabled to true in config/paper-global.yml.",
            "env_variable": "PAPER_VELOCITY_SECRET",
            "default_value": "",
            "user_viewable": true,
            "user_editable": true,
            "rules": "nullable|string|max:128",
            "field_type": "text"
        }
    ]
}
