HomeJavaModsItemsAPI
ItemsAPI
ModsJava

ItemsAPI

by Map4yk · on Modrinth

A Minecraft server plugin that provides an API for managing custom items and storing them in the configuration.

⬇ Download on Modrinth
ItemsAPI — screenshot 1ItemsAPI — screenshot 2ItemsAPI — screenshot 3

ItemsAPI (1.16.5-1.21.8)

A plugin for Minecraft servers that provides an API for managing custom items and storing them in the configuration.

📦 Features

🔧 Commands

Command Description Permission
/items give <player> <item> Give a saved item to the specified player ItemsAPI.use
/items add Save all items from your inventory ItemsAPI.use

💻 API for Developers

// Getting an instance of the API:
@Override
public void onEnable() {
    itemsAPI = ItemsAPIProvider.getAPI();
}

// Getting and giving an ItemStack:
ItemStack needItem = itemsAPI.getItem("CRUSHER_TALISMAN");

// Get all saved items
Map<String, ItemStack> allItems = api.getAllItems();

⭐ Example Usage in a Menu

public class MenuPlugin extends JavaPlugin implements CommandExecutor {
    private ItemsAPIInterface itemsAPI;
    private final MiniMessage mm = MiniMessage.miniMessage();

    @Override
    public void onEnable() {
        itemsAPI = ItemsAPIProvider.getAPI();
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("menu").setExecutor(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) { return true; }

        Inventory inv = Bukkit.createInventory(player, 3*9, mm.deserialize("<blue>API Example</blue>"));
        inv.setItem(13, itemsAPI.getItem("CRUSHER_TALISMAN"));
        player.openInventory(inv);
        
        return true;
    }
}
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more