HomeJavaModsPapyrus
ModsJava

Papyrus

by nelind · on Modrinth

Which Minecraft do you have?

Every version of the game needs its own build. Pick yours, then download — the wrong build installs fine and then does nothing in the game. This mod is built for Fabric only.

⬇ Download for 1.20.5–1.21.1⬇ Download for 1.18–1.20.4
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

Papyrus

Papyrus provides various named mappings to the Fabric loader MappingResolver. This allows for more developer friendly access to mappings at runtime for example for using named classes in reflection instead of intermediary. Papyrus downloads mappings on the first run on any given version and stores cached mappings in tiny v2 format at ${game_dir}/cache/papyrus/${mapping}_${version}.tiny

Using Papyrus

To use Papyrus just add the maven repository which hosts Papyrus to your gradle build script:

# Kotlin DSL
repositories {
    maven("https://maven.nelind.dk/releases") {
        name = "Nelind Maven"
    }
}

# Groovy DSL
repositories {
    maven {
        name 'Nelind Maven'
        url 'https://maven.nelind.dk/releases'
    }
}

and then include Papyrus JIJ with the standard loom "include" gradle configuration:

# Kotlin DSL
modRuntimeOnly(include("dk.nelind:papyrus:(version)")!!)

# Groovy DSL
modRuntimeOnly include("dk.nelind:papyrus:(version)")

You can also choose to not include Papyrus JIJ in that case make sure to manually add Papyrus as a dependency in your fabric.mod.json. If you need to access Papyrus internals you can also add Papyrus with the modApi configuration instead of the modRuntimeOnly configuration.

Then in your fabric.mod.json you need to tell Papyrus what mappings you need access to and the version thereof:

{
  ...
  "custom": {
    "papyrus": {
      "mappings": [
        "mojmap",
        "yarn:build.1"
      ]
    }
  }
}

Then get and use the MappingResolver with any of the added mapping namespaces:

MappingResolver mappingResolver = FabricLoader.getInstance().getMappingResolver();
String runtimeClassNameFromYarnName = mappingResolver.mapClassName("yarn:build.1", yarnClassName);
String runtimeClassNameFromMojmapName = mappingResolver.mapClassname("mojmap", mojmapClassName);

Usage notes:

Provided mappings

Mappings Namespace used in mapping resolver
Mojang Mappings mojmap
Yarn yarn

Note on versioning

Since Papyrus is almost entirely independent of the version of the game itself. The mod version indicates the java version said build was built against. For example Papyrus x.y.z+java.17 is built against java 17 and as such supports any game version that's also built against java 17 (that being any version from 1.18 to 1.20.4 inclusively).

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more