Checking for item in inventory

Started by xXFingamerXx on Sat, 06/18/2016 - 16:31

Topic category: Bugs and solutions

Last seen on 15:44, 10. Apr 2017
Joined Apr 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Checking for item in inventory
Sat, 06/18/2016 - 16:31

I was trying to make an item converter but using the hasPlayerInInventory[Items.porkchop] confinition seems to not work.

Here's the log:

:clean
:deobfCompileDummyTask
:deobfProvidedDummyTask
:sourceApiJava
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava
C:\Pylo\MCreator168\forge\build\sources\main\java\mod\mcreator\mcreator_myGUI.java:322: error: cannot find symbol
if(entity.inventory.hasItem(new ItemStack(Items.porkchop).getItem())){
                   ^
  symbol:   method hasItem(Item)
  location: variable inventory of type InventoryPlayer

1 error
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.