Inventories

How can i add itemstack to a specific location (row,column) in inventory?
How can i edit itemstack nbt?
How can i get title of inventory?
How can i get clicked item from Inventoryclickevent?
Is there api for this kind of stuff?

The implementation of the “Inventory API” hasn’t been completed as of yet, but if you really want to get coding, the source code is available on github for you to look through.

To edit “itemstack nbt” you have to use the Data API introduced by that PR, however, there is a large change to Data API in this PR that simplifies a lot of the data manipulation with everything.

As far as Inventory API, that’s pending the implementation from Mumfrey, which is going to be publicized soon.

1 Like

The inventory must be one that supports rows and columns, it must be a Inventory2D.

Inventory2D inventory = getSomeInventory();
ItemStack itemStack = getSomeItemStack();
inventory.set(SlotPos.of(row, column), itemStack);

What gabizou said above^

Inventory inventory = getSomeInventory();
Translatable name = inventory.getName();

Looks like you can’t at the moment. Note the event is incomplete The JavaDoc states:

/**
 * Represents an event when a viewer has clicked inside an inventory.
 *
 * <p>Note that this event is incomplete.</p>
 */

The inventory API, which I have shown some examples of. The complete description can be found on the GitHub PR