MonitoringMinecraft MonitoringMinecraft

ItemsAPI

Плагин BukkitFoliaPaper

ItemsAPI — плагин для серверов Майнкрафт: API управления кастомными предметами с хранением в конфиге.

68 скачиваний 0 подписчиков
Оцените первым

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

  • Save, load, and give items via commands
  • Simple API interface for integration with plugins
  • Items are stored in a configuration file

🔧 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;
    }
}
  • Don't forget to add depend: [ItemsAPI] to your plugin's plugin.yml
  • And also to your build.gradle: compileOnly files('libs/ItemsAPI-1.0.jar')
Смотри также

Похожие подборки плагины — по версиям Майнкрафта, загрузчикам и жанрам.

Сервера Майнкрафт

Играть интереснее на сервере — выбирай в рейтинге серверов Майнкрафт и заходи прямо сейчас.

SkyBars
SkyBars Java + BE
1368 онлайн
1.8 — 26.2 версия
🎮 ВЫЖИВАНИЕ ⚔️ АНАРХИЯ 🚗 ГТА РП 🎤 ГОЛОСОВОЙ ЧАТ 🎁 БЕСПЛАТНЫЙ ДОНАТ 🌟 СМП 💻 ПК+ТЕЛЕФОН
CLOUDWORLD
6 онлайн
1.16.5 — 1.21.11 версия
Пвп, Арены, Дуэли, Кейсы, донаты, /free, приваты, спавн,
Battle Mine
Battle Mine Java + BE
3 онлайн
1.21.4 — 26.2 версия
ОТКРЫТИЕ! 20 + различных ивентов, 10+ различных боссов, много интересных механник
MigosMc
MigosMc Java + BE
1728 онлайн
1.8 — 26.2 версия
🌿 MigosMc.net | Гриферский сервер с войс-чатом | Награды за онлайн ⭐ ВЫЖИВАНИЕ⭐ ОДИНБЛОК⭐ МИНИ-ИГРЫ
MineLauncher
Лаунчер Майнкрафт без лицензии — все версии
Бесплатный лаунчер для ПК и Андроид — все версии 26.2, 1.21.11, 26.1.2, 1.21.8. Fabric, NeoForge, Forge, шейдеры, моды и скины в один клик.
Без лицензии Fabric, NeoForge, Forge Моды, шейдеры, скины Все версии Майнкрафта ПК и Андроид Для слабых ПК Сервера в лаунчере
Скачать бесплатно
Windows и Андроид · Бесплатно · Без лицензии
Наш чат