# Items

## What is a GuiItem ?

GuiItem is item used by KapEasyMenu Plugin. It is a useful Item Class to describe its behave with specifics actions.

## Let's see how to create a nomal GuiItem

{% code overflow="wrap" lineNumbers="true" %}

```java
//since 2.0.0
GuiItem myItem(MyPlugin plugin, ItemStack minecraftItem) {
    GuiItem result = new GuiItem(plugin, minecraftItem);
    return result;
}

//since 1.1.1
GuiItem myItem() {
    GuiItem result = new GuiItem(Material.MATERIAL);
    
    return result;
}

//since 1.0.1
GuiItem myItem2(MyPlugin plugin) {
    GuiItem result = new GuiItem(plugin, Material.MATERIAL);
    
    return result;
}
```

{% endcode %}

## Let's set more settings

You can set :&#x20;

* ItemStack amount -> set the amount of items
* Item title -> set your item title
* Item Lores -> set your item lores
* Cancel Event -> cancel the event on your item click (in game)

let's code these modifications

{% code overflow="wrap" lineNumbers="true" %}

```java
GuiItem myItem() {
    GuiItem item = new GuiItem(Material.MATERIAL)
        .setAmount(3)
        .setName("My Item Name")
        .setLore(new String[]{"§7My", "Lores !"})
        .setDisableEvent(true); //with this line the item cannot be move from its slot
    return item;
}
```

{% endcode %}

## Getters

There is severale useful getters :&#x20;

* getItem() -> it returns the ItemStack
* getPlugin() -> it returns the JavaPlugin attached to your item
* isDisableEvent() -> it returns if your item disable InventoryClickEvent
* getLore() -> return lore of your item
* getName() -> return name of your item
* getAction(ItemActions) -> return the lambda you set with an action ([Check doc](https://kap35.gitbook.io/kap-easy-menu-plugin/dev-manual/create-a-menu/items/add-an-action))
