SmartInvs
SmartInvs copied to clipboard
Add arguments while opening inventory
Hi. Is possible to add args while opening inventory? If not, can be this feature added? Thanks.
Hi, you can achieve this by adding fields to your InventoryProvider and passing them in the constructor, for example:
public static SmartInventory getInventory(Player player) {
return SmartInventory.builder()
.provider(new MyProvider(player)) // Here MyProvider will store the Player as a field, so you can use it inside the init/update methods.
.size(3, 9)
.title("Inventory of " + player.getName())
.build();
}