Introduction

SmartInvs

SmartInvs is a modern API for easily using inventories with Bukkit to make awesome GUIs. This book contains a guide on how to use this API to create your own amazing GUIs!

This API requires Java 8 to work.

Features

  • Inventories of any type (workbench, chest, furnace, ...)

  • Customizable size when possible (chest, ...)

  • Custom titles

  • Allows to prevent the player from closing its inventory

  • Custom listeners for the event related to the inventory

  • Iterator for inventory slots

  • Page system

  • Util methods to fill an inventory's row/column/borders/...

  • Actions when player clicks on an item

  • Update methods to edit the content of the inventory every tick

Usage

To use the SmartInvs API, either:

  • Put it in the plugins folder of your server, add it to your dependencies in your plugin.yml (e.g. depend: [SmartInvs]) and add it to the dependencies in your IDE.

  • Put it inside your plugin jar, initialize an InventoryManager in your plugin (don't forget to call the init() method), and add a .manager(invManager) to your SmartInventory Builders.

You can download the latest version on the Releases pagearrow-up-right on Github.

You can also use a build system:

Gradle

Maven

Preview

Here is a simple preview of an inventory.

And there is the result:

If we click on the carrot, we receive the message You clicked on a potato, and if we click on the barrier, the inventory is closed.

The source code is available on Githubarrow-up-right! If you have some issues with the API, please open an issuearrow-up-right on Github.

Last updated