▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/ItemsAPI
ItemsAPI

ItemsAPI

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

18
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

CommandDescriptionPermission
/items give <player> <item>Give a saved item to the specified playerItemsAPI.use
/items addSave all items from your inventoryItemsAPI.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')

Совместимость

Minecraft: Java Edition

1.21.x1.16.x

Поддерживаемые окружения

Сервер

Создатели

Детали

Лицензия:MIT
Опубликован:1 месяц назад
Обновлён:1 месяц назад
Главная