Error Inventory.offer when inventory is full Beta 239

Hi,
i create a function to give a item to inventory if my player’s inventory is full. The item is added in armor slots.

Exemple :

you can prevent this by querying for the GridInventory

target.getInventory().query(GridInventory.class).offer(itemStack);

I found this solution for give a itemstack (check hotbar + GridInvenotory) but maybe what is the utility of Inventory.offer because all plugins use this function as EssentialsCmd

Its the plugin’s fault then. They need to query for the correct inventory before doing the offer. The Inventory API is a powerful querying framework who doesn’t care WHAT you are offering to, its up to you to do otherwise.

1 Like

OK thanks, I did not know if it was normal or bug