# ICustomItemManager
> Interface for registering, retrieving, and identifying custom items.
`gg.lode.bookshelfapi.api.manager.ICustomItemManager`
---
## Signature
```java
public interface ICustomItemManager
```
---
## Methods
| Method | Return Type | Description |
|--------|-------------|-------------|
| `register(CustomItem item)` | `void` | Registers a [[CustomItem]]. |
| `unregister(String id)` | `void` | Unregisters a custom item by its ID. |
| `getCustomItem(String id)` | `@Nullable CustomItem` | Returns a custom item by ID, or `null` if not found. |
| `isCustomItem(ItemStack item)` | `boolean` | Checks if the given ItemStack is a registered custom item. |
| `getCustomItem(ItemStack item)` | `@Nullable CustomItem` | Returns the custom item matching the ItemStack, or `null`. |
| `getCustomItems()` | `List<CustomItem>` | Returns all registered custom items. |
### Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
| `item` | `CustomItem` | The custom item instance to register. |
| `id` | `String` | The unique identifier of the custom item. |
| `item` | `ItemStack` | A Bukkit ItemStack to check or look up. |
---
## Usage
```java
ICustomItemManager items = BookshelfAPI.getApi().getCustomItemManager();
items.register(new DiamondSword());
CustomItem found = items.getCustomItem("diamond_sword");
if (found != null) {
player.getInventory().addItem(found.build());
}
if (items.isCustomItem(player.getInventory().getItemInMainHand())) {
// Handle custom item interaction
}
```
---
## Related Pages
- [[IBookshelfAPI]]
- [[CustomItem]]