Check number of an Item in inventory

Started by Fifoukorki on Sat, 05/23/2015 - 18:48

Topic category: Help with MCreator modding

Last seen on 20:48, 21. Dec 2015
Joined May 2015
User points:


  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Check number of an Item in inventory
Sat, 05/23/2015 - 18:48


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.