Item Rarity
Rarity mainly affects the in-game color of item names (if the item name color is set explicitly, rarity color will not override it).
Rarity Levels
When using the API, pay attention to your ProbeJS version.
If version is 7.0 or above, import like this: const { $Rarity } = require("packages/net/minecraft/world/item/$Rarity")
If version is below 7.0, import like this: const $Rarity = Java.loadClass("net.minecraft.world.item.Rarity")
| Level | Meaning | Name Color | API Value | String Value |
|---|---|---|---|---|
| Common | Common | White | $Rarity.COMMON | common |
| Uncommon | Uncommon | Yellow | $Rarity.UNCOMMON | uncommon |
| Rare | Rare | Aqua | $Rarity.RARE | rare |
| Epic | Epic | Magenta | $Rarity.EPIC | epic |
Notes
Rarity is shown in these cases:
- Item name in tooltip when selected in inventory
- Item name shown above the hotbar when selected
- Item names shown inside JSON text messages, including death screen messages, chat death messages, and
/tellraw/givetext output
Rarity is not shown in these cases:
- Renamed item names displayed in item frames
- Item names shown in a shulker box tooltip preview
- Item names on the statistics screen