# Find which mod adds an item, block, or translation key in Minecraft

Find which mod in a Minecraft modpack adds an item or block by its in-game name, or which mod owns a translation key, with jdx from the terminal.

## Quick answer

Search the in-game name or the key with `literals` over the mods folder. Lang files (`assets/<namespace>/lang/*.json`, and `*.lang` before 1.13) are read too, and every row names the jar.

```bash
jdx literals 'Ruby Gem' --jars mods --no-jdk
jdx literals 'item.examplemod.ruby' --jars mods --no-jdk
jdx resources 'assets/examplemod/lang/*.json' --jars mods --no-jdk
```

A name shown in game usually comes from a lang file, not from code. The file maps a translation key such as `item.examplemod.ruby` to the text for one language. jdx reads those files straight from each jar, together with the string constants in the bytecode, so one command answers "which mod is this" without unzipping anything. It needs JDK 21 or later; install it with the [one-line installer](https://mohammadmd1383.github.io/jdx/docs/installation/).

`--jars mods` reads every jar in the folder, including jars in subfolders such as `mods/client/`. Nothing is loaded or run. jdx does not remap: keys and names are searched as stored in each jar.

The docs build has no modpack, so the recipes on this page are bash blocks and are not executed.

## Which mod adds the item called X?

Paste the English name as it appears in game. A lang-file hit is a `lang` row: the jar, then `path#key`, then the text.

```bash
jdx literals 'Ruby Gem' --jars mods --no-jdk
jdx literals 'ruby gem' --ignore-case --jars mods --no-jdk
```

```text
literals matching 'Ruby Gem'
examplemod-1.2.0.jar (1)
  lang assets/examplemod/lang/en_us.json#item.examplemod.ruby  "Ruby Gem"
```

The jar is the mod, and the key's middle part (`examplemod`) is usually its namespace, the mod id. Only `en_us.json` has the English name; for a name shown in another language, paste that text, since every locale file is read.

## Which mod owns this translation key?

Search the key, or a prefix of it, to see every lang file that defines it and every class that loads it as a constant.

```bash
jdx literals 'item.examplemod.ruby' --jars mods --no-jdk
jdx literals 'block.examplemod.' --limit 100 --jars mods --no-jdk
```

`ldc` and `const` rows are code that uses the key as a string. Keys built at runtime (for example from a registry id) are not one constant, so only the lang rows show for those.

## Why does the game show a raw key instead of text?

A raw key such as `item.examplemod.ruby` on screen means no loaded lang file defines it for your language. Search it: a code row with no `lang` row means the mod forgot the entry; a `lang` row only in another locale means the translation is missing for yours.

```bash
jdx literals 'item.examplemod.ruby' --jars mods --no-jdk
jdx resources 'assets/examplemod/lang/*.json' --jars mods --no-jdk
```

## Read a mod's lang file

`resources` lists the files, and `--cat` prints one. A glob without `/` also matches the file name at any depth.

```bash
jdx resources 'en_us.json' --jars mods --no-jdk
jdx resources 'assets/examplemod/lang/en_us.json' --cat --jars mods --no-jdk
```

Two or more matches under `--cat` exit 2 and list `path --in artifact` candidates; narrow with `--in 'examplemod*'`.

## Limits

- Only lang files inside the jars are read. Resource packs and data packs in other folders are not, unless you pass them with `--jars`.
- Lang files in nested jar-in-jar libraries under `META-INF/jars/` are read, and the hit names the outer mod plus the nested path (`mod.jar!META-INF/jars/lib.jar`).
- jdx does not remap, so class names in code rows are the names the mod jar stores.

## FAQ

### How do I find which mod adds an item in a modpack?

Run `jdx literals` with the item's in-game name and `--jars mods`. The `lang` row names the jar and the translation key, for example `item.examplemod.ruby`.

### How do I find which mod a translation key belongs to?

Run `jdx literals` with the key. Each `lang` row names the jar and the lang file that defines it; `ldc` rows name the classes that use it.

### Does jdx read Minecraft lang files?

Yes. `jdx literals` reads every `assets/<namespace>/lang/*.json` file in the jars and matches both keys and text. Non-string values are skipped. Old `.lang` files (Minecraft 1.12 and earlier) are read too: `key=value` lines, with `#` comments and blank lines skipped.

### Does jdx load or run the mods?

No. Lang files are read as text and bytecode is parsed with ASM; no class is loaded.

## Where next

- [Find which mod causes it in a Minecraft modpack](https://mohammadmd1383.github.io/jdx/docs/minecraft-modpack/) — log messages, duplicate classes, mixins, implementors.
- [Inspect a Minecraft mod jar](https://mohammadmd1383.github.io/jdx/docs/minecraft-mods/) — members, source, and a decompiled method.
- [Command catalogue](https://mohammadmd1383.github.io/jdx/docs/reference/) — every flag.
