# ResourcePack

{% hint style="info" %}
If you are unsure how to reference a ResourcePack-file in a config-file [FAQ](/general-usage/faq.md#how-do-i-reference-a-resourcepack-file-in-a-config)
{% endhint %}

***

## 🗂️ ResourcePack-Structure

The ResourcePack in Nexo follows the vanilla structure but also letting you import and automatically merge full ResourcePacks\
This is in an effort to make importing third-party ResourcePacks a lot easier.\
Below is an example of the new structure.

{% code title="" %}

```
📁Nexo
└── 📁pack
    └── 📁assets
    │    ├── 📁minecraft
    │    │    ├── 📁models
    │    │    │    ├── 📁item
    │    │    │    │    └── 📑paper.json
    │    │    │    └── 📑custom_model.json
    │    │    └── 📁textures
    │    │         └── 🖼️something.png
    │    └── 📁custom_namespace
    │        └── 📁models
    │            └── 📑custom.json
    │  
    └── 📁external_packs
        ├── 📁DefaultPack.zip
        ├── 📁custom_resourcepack.zip
        └── 📁custom_resourcepack2
            └── 📁assets
                └── 📁custom_namespace2
```

{% endcode %}

Goal is to let users merge resourcepacks in via either ZIPs or directories, outside of the normal assets folder.\
This would dynamically merge in any conflicting files, like a paper.json or sounds.json, instead of migrating it to Nexo-configs to be generated.\
Meaning that pack-import instructions on your end now boils down to:\
Put `my_pack.zip` inside `Nexo/pack/external_packs`

***

## 🎭 Obfuscation

Nexo has a built-in way to "obfuscate" the content of your resource-pack.\
This is done by randomizing all file-names in an attempt to make it very hard and annoying to try and take stuff from it for pirates.\
It comes with three modes, `NONE`, `SIMPLE`, `FULL`\
\
**NONE** - Self-explanatory, does not obfuscate pack in any way\
**SIMPLE** - Obfuscates filenames only\
`namespace:model/path.json` -> `namespace:bba2d60b-8e3e-4051-9734-fef92766777f`\
**FULL** - Obfuscates namespace & filename;\
`namespace:model/path.json` -> `c491303e-ba1e-4037-a59d-62b5fdfb6bb8:bba2d60b-8e3e-4051-9734-fef92766777f`

***

## 📦 PackSquash-Integration

Nexo allows you to run PackSquash on the resourcepack without manually reuploading the pack.\
Simply download the latest [PackSquash](https://github.com/ComunidadAylas/PackSquash/releases) build and drop it in `plugins/Nexo/pack/packsquash` .\
Then drop your **packsquash.toml** in the same directory, an example can be found [here](https://gist.github.com/Boy0000/92149d2704b6086473fccb4d771c42b4).\
If you want it in another location, you can specify a path for the binary & settings

```yaml
Pack:
 generation:
    packsquash:
      enabled: true
      executable_path: plugins/Nexo/pack/packsquash/packsquash
      settings_path: plugins/Nexo/pack/packsquash/packsquash.toml
```

To enable Nexo's PackSquash-integration simply enable `Pack.generation.packsquash.enabled` in settings.yml. Then when the pack generates, it will start the PackSquash process. If it suceeds you should see somehting like the below.

<figure><img src="/files/2W3wmcvlakpp87xQixcv" alt=""><figcaption><p>Example of successful PackSquash process</p></figcaption></figure>

If it failed you should see some detailed info about which file and a reason for it.\
If Nexo's debug-mode is enabled, it will output info about all successful files aswell

{% hint style="info" %}
Depending on your TOML-configuration & ResourcePack size & complexity, the PackSquash process might take some time. Nexo will cache the output so that if the ResourcePack does not change, the PackSquash process will not need to be ran again
{% endhint %}

***

## 🌐 PackServer

Nexo supports several ways to upload & dispatch the ResourcePack it generates.\
Set the type via `Pack.server.type` in `settings.yml`.

### NONE

Does not send any ResourcePack to players. Use this on backend servers that should not dispatch a pack.

### POLYMATH

A dedicated upload server hosted by the Nexo team (Germany). The pack is uploaded and served automatically.

```yaml
Pack:
  server:
    type: POLYMATH
    polymath:
      server: atlas.nexomc.com
      secret: nexomc
```

### SELFHOST

Hosts the ResourcePack directly from your server machine. Requires an open port and a reachable public address.

```yaml
Pack:
  server:
    type: SELFHOST
    selfhost:
      port: 8082
      public_address: "http://your.ip.or.domain"
      dispatch_threads: 10
```

### LOBFILE

Uploads the pack to [LobFile](https://lobfile.com/). Requires an API key.

```yaml
Pack:
  server:
    type: LOBFILE
    lobfile:
      api_key: YOUR-API-KEY
```

### S3

Uploads the pack to any S3-compatible object storage (AWS S3, Cloudflare R2, Hetzner Object Storage, etc.).

```yaml
Pack:
  server:
    type: S3
    s3:
      public_url: "https://fsn1.your-objectstorage.com"
      endpoint_url: "https://fsn1.your-objectstorage.com"
      region: eu-central-1
      bucket: nexo-storage
      access_key: ACCESS
      secret_key: SECRET
      url_expiration: 7d
      path_style: false
      chunked_encoding: true
```

### Custom PackServer

The `NexoPackServer` interface can be implemented by third-party plugins and registered via `PackServerRegistry`, allowing you to add your own upload/dispatch logic.

***

## 🔗 Cross-Server/Proxy ResourcePacks

For Velocity proxy networks, use [NexoProxy](/addons/nexo-proxy.md) — a Velocity plugin that blocks duplicate ResourcePack sends when players switch between backend servers.

***

## 📥 Importing

Nexo lets you import Third-Party ResourcePacks in several ways.\
The recommended one is shown above, by adding a directory or .zip to `plugins/Nexo/pack/external\_packs`\
There is also `Plugin.import.from_location` in settings.yml, letting you specify a directory/zip relative to your plugins folder\
There is also `Plugin.import.from_url` in settings.yml, letting you specify any url that Nexo will download a directory/zip from and include


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nexomc.com/configuration/resourcepack.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
