Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Who calls this Minecraft method? Find callers and usages across your mod, Fabric API and the game jar

When I change a mixin or wrap a vanilla method, the first thing I want to know is: who else calls this? Vanilla code, Fabric API, my own sources, maybe another mod I depend on. In an IDE that's "Find Usages". From a terminal, or from an AI coding agent, it usually turns into unzip + javap + grep. jdx answers that question as a command. Here is the workflow I use, with the limits up front. Build a…

When modifying or wrapping vanilla methods in Minecraft, it's essential to know who else calls these methods. This includes vanilla code, Fabric API, your own sources, and potentially other mods that your mod depends on. In an IDE, this is achieved through the "Find Usages" feature, while from a terminal or with AI coding agents, it often involves using unzip, javap, and grep.

Jdx offers a command-line tool that provides an answer to this question. To use it, you first need to build a workspace over the jars you care about. Jdx reads Maven/Gradle dependency caches on its own, but it doesn't automatically discover the Loom-remapped Minecraft jar, so you must pass it explicitly. You can find the remapped jar in the folder containing the Minecraft common jar.

To explore callers, you can use the command "jdx -w mc callers 'net.minecraft.world.item.ItemStack#getMaxStackSize()'". This command is override-aware by default, meaning it will consider calls through supertypes or overrides. If you only want to see calls that bind to exactly that declaration, you can add the "--exact" flag. Bytecode edges carry file and line information from the class's LineNumberTable, allowing you to jump directly to the relevant spot.

The "calls" command in jdx helps you understand what methods a specific method calls. The "usages" command reveals every reference to a type, complete with context. For example, "jdx -w mc usages net.minecraft.world.item.ItemStack --context" will output a short inline snippet for each hit, rather than just a bare list. Commands like these can also be scripted using "--json".

If there's any ambiguity in the name, jdx will exit with a 2 status code and list each candidate as a paste-ready reference instead of making an assumption.

Jdx's functionality is exposed through an MCP server (jdx_callers, jdx_usages, jdx_calls) and can be integrated with the jdx setup command, which allows you to wire it up with various agents like "claude-code". When using jdx, keep in mind that it doesn't remap names; they are presented in the namespace used by the individual jar.

Names are queried using the exact names of the jar. Also, the Loom-remapped jar must be passed through the "--jars" flag, as Maven-style dependencies are not discovered automatically. The "callers" and "usages" commands only perform bytecode navigation based on the classpath provided and do not understand mixin injection targets.

When comparing different game versions, jdx diff only makes sense within the same mapping namespace. Jdx parses bytecode using ASM and never loads or runs the classes, ensuring that inspecting a random mod jar doesn't execute any potentially malicious code. To install jdx, run "curl -fsSL https://raw.githubusercontent.com/MohammadMD1383/jdx/main/install-release.sh | bash", which requires Java 21 or higher and works on Linux, macOS, and Windows.

The tool is licensed under the Apache-2.0 license. For more information, visit the official documentation at https://mohammadmd1383.github.io/jdx/docs/minecraft-mods/.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

More from Saturday, 28 November 2026 →