So I want to search a player's whole inventory for a specific item client-side. I have the following class:
Which extends off of some other classes, like
And I can use the inventory (InventoryPlayer) property from that class to get the player's inventory. I tried two things and I don't really get the correct results:
// entity is an instance of EntityOtherPlayerMP
// inventory is InventoryPlayer
// This only returns true when the entity is holding a stone block (ID 1)
// Expected result: returns true regardless if the player is holding a stone block or not.
// like before, entity is an instance of EntityOtherPlayerMP, and inventory is InventoryPlayer...
// mainInventory is just supposed to be a ItemStack
// Returns an array of null, 36 nulls. [null, null, null, ...]
Does this mean that no, client-side you cannot get another player's (full) inventory, or am I doing something wrong?