title: Get amount of set item in the player's inventory
body: <p>I am trying to update a mod and it seems that some code has been changed from 1.17 to 1.18, I am trying to find out how many of a specific item the player has in their inventory. The old code for this was something like</p>
  <pre><code>public static int getInventoryItemCount(ItemConvertible item) {  
    MinecraftClient minecraftClient = MinecraftClient.getInstance();  
    PlayerInventory playerInventory = minecraftClient.player.getInventory();  
  
    return playerInventory.count((Item) item);  
  
  }  
  </code></pre>
  <p>I was able to do a temporary fix by just returning a fixed integer for now.</p>