In a procedure, how do I check if an item is in the main hand? *SOLVED*

Started by theTacocat88 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In a procedure, how do I check if an item is in the main hand? *SOLVED*
Tue, 07/16/2024 - 14:12 (edited)

I am making a mod with a spear in it that you can dash into enemies with when pressing C, but I can't figure out how to make it so that it only works when I have the spear in my MAIN HAND.

This is how I want the keybind to work:

  1. Key is pressed
  2. Player dashes forward
  3. Enemy player dashed at takes damage
  4. Player stops dashing

If anybody could help that would be great!

Thanks!

Edited by theTacocat88 on Tue, 07/16/2024 - 14:12
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There are 2 blocks that…
Mon, 03/18/2024 - 16:35

There are 2 blocks that refer to the Main-Hand specifically (there also exists the same blocks for the off-hand if wanted)