Browse sets and pieces
List every set
for (EquipmentSet set : api.sets()) {
sender.sendMessage(set.id() + " - " + set.pieces().size() + " pieces");
}
Get one set
api.set("forest_warden").ifPresent(set -> {
sender.sendMessage("Name: " + set.displayName());
sender.sendMessage("Author: " + set.author().orElse("unknown"));
sender.sendMessage("Pieces: " + set.pieces().size());
});
Get one piece
api.piece("forest_warden", "helmet").ifPresent(piece -> {
sender.sendMessage("Material: " + piece.materialId());
sender.sendMessage("Slot: " + piece.slotKey().orElse("?"));
});
List every piece in every set
for (EquipmentSet set : api.sets()) {
for (EquipmentPiece piece : set.pieces()) {
sender.sendMessage(piece.id().asString() + " -> " + piece.materialId());
}
}
Tab-complete your own command with set names
@Override
public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) {
if (args.length == 1) {
return api.sets().stream()
.map(EquipmentSet::id)
.filter(id -> id.startsWith(args[0].toLowerCase()))
.toList();
}
if (args.length == 2) {
return api.set(args[0])
.map(set -> set.pieces().stream().map(EquipmentPiece::key).toList())
.orElse(List.of());
}
return List.of();
}
What a set gives you
| Call | Returns |
id() | The set id |
displayName() | The name, falling back to the id |
namespace(), description(), author(), version(), website() | Set details from the editor |
pieces() | Every piece in the set |
piece("helmet") | One piece by key, ignoring case |
What a piece gives you
| Call | Returns |
id() | Its EquipmentId |
setId(), key() | The two halves of that id |
materialId(), material() | The vanilla item it's based on |
slot(), slotKey() | Where it's worn — helmet, elytra, wolf… |
displayName() | The name from the editor |
customModelData(), assetId(), layer(), equipSound() | Resource-pack details |
For stats, enchantments and effects, read the ItemStack. EquipmentPiece only carries identity and display information. Call createItem and inspect the resulting item for everything else.