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

Started by JopRillos2001 on

Topic category: Help with modding (Java Edition)

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

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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
Points:

User statistics:

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

I edited the question by adding an image

Last seen on 21:47, 24. Sep 2021
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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
Points:

User statistics:

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

Thank you! That worked perfectly