How to check if there is an object in hand when player clicked on an entity

Started by artanismaratt on

Topic category: Help with modding (Java Edition)

Last seen on 15:00, 29. Dec 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to check if there is an object in hand when player clicked on an entity
Tue, 12/22/2020 - 14:37 (edited)

I wanted to make an item that will kill a certain entity with one hit. To do this, you need to check if the player who clicked on the entity has an item in his hand, but I don't know how to do this. Can anyone help me with this?

Edited by artanismaratt on Tue, 12/22/2020 - 14:37
If item in hand = some item…
Tue, 12/22/2020 - 16:22

If item in hand = some item

I suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei

For procedures, also check https://www.youtube.com/playlist?list=PLAeL-oIFIEngf6S4p5X5CBd4GyWLUVaHA

Last seen on 15:00, 29. Dec 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The problem is that I don't…
Tue, 12/22/2020 - 19:39

The problem is that I don't know where this block is.

MCreator has a procedure…
Wed, 12/23/2020 - 08:01

MCreator has a procedure search bar. More on new features here: https://www.youtube.com/watch?v=wu0TBAzy91c

Also if you checked tutorials I linked, you would learn that there too, so posting this again:

I suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei

Last seen on 15:00, 29. Dec 2020
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you
Mon, 12/28/2020 - 15:41

Thank you