How can I check for a specific item in my main hand?

Started by JopRillos2001 on Sat, 10/19/2019 - 17:59

Topic category: Help with MCreator modding

Last seen on 15:08, 20. Oct 2019
Joined Sep 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
How can I check for a specific item in my main hand?
Sat, 10/19/2019 - 22:34 (edited)

Im making a mod where you can store bananas in a crate. Right clicking an empty crate with a banana change it to a filled crate, but no matter where my banana is in my inventory, it still fills it. I dont want this to be the case. The crate should only fill when holding the banana. How can I check for a banana in my main hand?

img

Edited by JopRillos2001 on Sat, 10/19/2019 - 22:34
Last seen on 15:08, 20. Oct 2019
Joined Sep 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I edited the question by…
Sat, 10/19/2019 - 22:34

I edited the question by adding an image

Last seen on 23:54, 11. Nov 2019
Joined May 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
You use "if item in entity´s…
Sat, 10/19/2019 - 22:44

You use "if item in entity´s main hand"

Last seen on 15:08, 20. Oct 2019
Joined Sep 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Thank you! That worked…
Sun, 10/20/2019 - 10:04

Thank you! That worked perfectly