How to program / create an inventory for all players but how to create one for only one player
// For all testinv = Bukkit.createInventory (null, 45, "§aTest");
// How only for one?
The inventory is not tied to players. Whether it is for one player or for everyone depends solely on what you do with it and not how you create it.
Sure, but how do I set an item for only one player in this inventory and not for everyone.
Pack inventory in e.g. Hashmaps
You would have to create a new inventory for each player.
It is best to save this with the player in a HashMap so that you can continue to access it later
By letting only one player open this inventory and not everyone.
Ok and how exactly do I create a new inventory for each player?
With every join or whenever you want to use Bukkit.createInventory and save the inventory together with the player in a HashMap
A code example - \ _ (° - °) _ /