Code Explainer
Paste any Java or Paper code and get every line classified and explained in plain English.
Paste Java code from a plugin, a tutorial or an AI chat and get every line explained in plain English: what it is, what it does, which old parts to replace, and which mistakes to look for.
Explain my code
Press one of the sample buttons to see how it works, or paste your own code into the box and press Explain this code. Nothing is sent anywhere: the explainer runs in your browser and works without internet.
The Code Explainer is loading. If this message stays, JavaScript is turned off in your browser.
How to use it
Copy the code
Select the code in your editor, on a web page or in an AI answer, and press Ctrl+C. A whole file works, and so does a few lines. If you copy only a few lines, the explainer cannot see the rest of the file, so a few explanations stay general.
Paste and press Explain
Click in the box, press Ctrl+V, then press the button or use Ctrl+Enter.
Read the summary first
The box at the top says what kind of code this is, which events it listens to, which commands it adds, and which parts are outdated or look like mistakes. Each warning has line buttons that jump to the line.
Then read line by line
Your code stays on the left. On the right, next to every line, is a short explanation. On a phone the explanation sits right under the line.
Reading the results
- The colored label names the kind of line: an import, a method declaration, a variable, a method call, a decision, a loop and so on.
- The sentence says what the line does. Backticks mark names from your code.
- The small bullets explain each method call on the line, inside out. They also say what type the call gives back, so you can follow a long chain such as
event.getPlayer().getInventory()step by step. - The orange and red boxes are warnings. Orange means old or removed API, or something to be careful about. Red means a likely mistake, such as comparing text with
==. Blue boxes are gentle notes. - The links lead to the chapter that teaches the idea and to the Event Finder for any event the code listens to.
- Closing braces tell you which block they end. Hide them with the check box if you find them noisy.
What it explains
- Every kind of line:
package, imports, classes, interfaces, records, enums, annotation lines, fields, constructors, methods, variables, assignments,ifandelse,switch, loops,return,tryandcatch, lambdas, method references, object creation, and comments. - The special methods of plugins:
onEnable,onDisable,onLoad, event handlers with their event described in plain English,onCommand,BasicCommandmethods and Brigadier command trees. - More than 400 Paper, Adventure, Brigadier and Java methods and classes, plus every one of the 454 Paper events with a one-line description of when it fires.
What it flags
- Old API with the modern replacement:
ChatColor,AsyncPlayerChatEvent,setDisplayName(String),getItemInHand(),scheduleSyncDelayedTask,Attribute.GENERIC_MAX_HEALTH, old enchantment, potion, particle and material names, version-locked server imports, and more. Every replacement was checked against the real Paper 26.3 API. - Handlers that never run: a handler without
@EventHandler, a class withoutimplements Listener, a handler with the wrong parameters, and a listener that nothing registers withregisterEvents. - Handlers that are not public, which Bukkit usually still calls but which is not the normal way to write them.
- Text compared with
==instead ofequals. Thread.sleepand slow file, database or web work that may run on the main thread and freeze the whole server. See Threads, performance and lag.- Empty catch blocks that hide errors, and results that can be null but are used right away.
What it cannot do
- It does not run or compile your code, so it cannot tell you whether the program works. For that, use the Compile Lab. For an error message, use the Error Doctor.
- It reads one pasted text. Methods that live in other files of your project show up as "not in the knowledge base", and some types stay unknown because it cannot see the declaration.
- It is made for Java. Kotlin is recognized and explained roughly, and other languages will mostly come out as general notes.
- The explanations are written by people for beginners, not generated on the fly, so a very unusual method gets a short, general description. Press the learn-more links or look the name up in the API map.