Check number of an Item in inventory

1 post / 0 new
Last seen: 1 year 8 months ago
Joined: 05/09/2015 - 00:15
Gems: 0
Check number of an Item in inventory


I saw in the conditions that we can check if we have a type of item in inventory but not the number, as if we have more than 10 stone block for example.

In the source code it is : if(entity.inventory.hasItem(new ItemStack(Blocks.stone).getItem())){ 

It just check if the item is in inventory not the number.

(If you know it, can you say to me how to delete for example 10 stone block next to check if they is >=10 ?)

Thanks for any answer sorry for my english.