Paper Plugin Guide
File mode0

Tools

Names Lookup

Find the exact Java name for any material, sound, particle, entity, potion effect, enchantment or attribute.

BeginnerTool

Almost every plugin has to say "this exact sword", "that exact sound" or "this potion effect". Java is strict: one wrong letter and your code will not compile. This tool lists every name that works in Paper 26.3, so you can copy it instead of guessing.

What is a name, and why does it have to be exact?

The game has thousands of things: blocks, items, sounds, mobs, potion effects. Paper gives each one a constant, which is a fixed name written in capital letters with underscores, such as Material.DIAMOND_SWORD. The part before the dot is the list (a class or an enum) and the part after the dot is the thing you want.

Every one of these things also has a namespaced key, which is the name the game itself uses in commands and data packs, like minecraft:diamond_sword. The two names are close but not the same: the Java name is in capitals (DIAMOND_SWORD), the key is lowercase with minecraft: in front. This tool shows both and finds either one.

Material.DIAMOND_SWORD

The Names Lookup

Pick a list with the tabs, or just start typing. The search looks in every list at once and tells you how many matches each list has. Press a name to see a short example of how to use it, then copy it with one button.

The Names Lookup is loading. If this message stays, JavaScript is turned off in your browser.

  • A plain word. sword finds every sword, glass pane finds the glass panes, level up finds the level-up sound.
  • The vanilla id. Paste minecraft:totem_of_undying from a command or a data pack and you get the Java name.
  • The Java name. Even Material.DIAMOND_SWORD or DiamondSword works.
  • A small typo. dimond pickaxe still finds DIAMOND_PICKAXE. Letters in the right order also work: dmndswd.

What each list is for

  • Material: make an item, change a block, or check what someone holds. See Items and Blocks.
  • Sound and Particle: play a sound or draw an effect in the world. See Effects, particles and sounds.
  • EntityType: spawn a mob or check what kind of mob something is. See Entities.
  • PotionEffectType, Enchantment and Attribute: give a status effect, enchant an item, or change health and speed. See Players and Items.
  • GameRules, Biome, Statistic and DamageType: change world settings, check the terrain, read counters, or tell why damage happened. See Worlds and locations.
  • Tag and DataComponentTypes: ask "is this any kind of log?" or read the information stored on an item. See Registries and data components.
  • NamedTextColor, boss bars and the ChatColor table: color text, build a boss bar, or turn old &c codes into MiniMessage. See MiniMessage and Titles, action bars and boss bars.
  • GameMode and Difficulty: switch a player's game mode or the world difficulty. See Players.

Using a name in your plugin

  1. Find the name and copy it

    Press Copy Java to copy something like Material.DIAMOND_SWORD. Press Copy example on the right to copy a whole line with the import lines above it.

  2. Paste it where your code needs it

    Most of the time the name goes inside parentheses: ItemStack.of(Material.DIAMOND_SWORD). The example shows you which method wants it.

  3. Let IntelliJ add the import

    If the name shows up red, press Alt+Enter and choose the import. The import lines in the example tell you which one is right when IntelliJ offers several.

Mistakes beginners make with names

  • Writing the key where Java wants the constant. Material.minecraft:diamond is not Java. In code use Material.DIAMOND. Use the minecraft: form only inside strings, such as Material.matchMaterial("minecraft:diamond"), or in commands.
  • Mixing up an item and a block. Some names are only items (you cannot place a DIAMOND_SWORD) and a few are only blocks (you cannot hold WATER). The badges show which.
  • Using a deprecated name. Names marked deprecated still compile, but the authors plan to remove them. The old game rules such as GameRule.DO_DAYLIGHT_CYCLE are the common trap: use GameRules.ADVANCE_TIME instead. The tool hides deprecated names until you ask.
  • Using ChatColor in new code. It is the old way. Use MiniMessage tags such as <red> or the NamedTextColor constants. The ChatColor tab is a translation table for code you find online.
  • Forgetting the extra argument. A few names need more than the name: the statistics MINE_BLOCK and KILL_ENTITY need to know which block or mob, and the particle DUST needs a color and a size. The result row and the example say so.
  • Mixing up the two Sound classes. Adventure also has a class named Sound, in net.kyori.adventure.sound. This tool lists the Bukkit one, org.bukkit.Sound. If IntelliJ offers both, take org.bukkit for player.playSound(location, sound, volume, pitch).

Recap

  • Java names are constants in capitals with underscores, like Material.DIAMOND_SWORD. The game's own key is lowercase, like minecraft:diamond_sword.
  • The tool finds a name from a word, a vanilla id, a Java name or a small typo, and gives you the import and a working example.
  • Prefer modern names: GameRules over GameRule, MiniMessage over ChatColor.
  • Some names need extra information, like which block a statistic counts.

Quick quiz

  1. Which one is the Java constant for the diamond sword?

  2. A tutorial from 2019 uses ChatColor.RED. What do you use in a new Paper 26.3 plugin?

  3. The tool shows a game rule name as deprecated and names a replacement. What should you do?

Try it

Find five names

Use the tool to find the Java name for each of these, and write down the line you would paste:

  • the sound for picking up an experience orb
  • the potion effect that makes you move faster
  • the particle that looks like a heart
  • the game rule that keeps your items when you die
  • the MiniMessage tag for the old &6 color
Hint
Search for one plain word, like orb, speed, heart, inventory or gold. The tab counts show which list has the match.
Show the solution

The answers are Sound.ENTITY_EXPERIENCE_ORB_PICKUP, PotionEffectType.SPEED, Particle.HEART, GameRules.KEEP_INVENTORY, and <gold> (the ChatColor table shows GOLD next to the code &6).

Next steps

Now put the names to work: reward a player in Items, add atmosphere with effects, particles and sounds, or learn where the lists come from in registries and data components. Timing something? Open the Tick Calculator.