I am trying to open up my inventory whenever I pick up an item. This is in Bukkit.
Here is the event so far, the arguments for player.openInventory
are empty.
@EventHandler
public void blank(PlayerDropItemEvent e){
Player player = e.getPlayer();
player.openInventory();
}
The following are the key elements to a well organized inventory tracking system. Create well designed location names and clearly label all locations where items may be stored. Use well organized, consistent, and unique descriptions of your items, starting with nouns. Keep item identifiers (part numbers, sku's, etc..)
The 4 Types of Inventory Management The types of inventory management are Raw Materials, Works-In-Process, Maintenance, Repair and Operations or MRO and Finished Goods.
In this article we'll dive into the three most common inventory management strategies that most manufacturers operate by: the pull strategy, the push strategy, and the just in time (JIT) strategy.
Try using player.getInventory()
to retrieve their inventory then using player.openInventory(inventory)
to open it.
@EventHandler
public void blank(PlayerDropItemEvent e) {
Player player = e.getPlayer();
Inventory inventory = player.getInventory();
player.openInventory(inventory);
}
To get a player's inventory, you could use:
player.getInventory();
If you wanted to open the player's inventory, you could use:
player.openInventory(player.getInventory());
So, your code could look something like this:
@EventHandler
public void dropItem(PlayerDropItemEvent e){
Player player = e.getPlayer(); //get the player that dropped the item
player.openInventory(player.getInventory()); //open the player's inventory
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With