how to detect when a player left clicks?

Started by Mecho on

Topic category: Help with modding (Java Edition)

Last seen on 06:38, 6. May 2024
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how to detect when a player left clicks?

im making a mod that need to detect when you left click (attack) with a weapon, for the most time 'on player swing item' was sufficient until it was activating when interacting with things like buttons, crafting tables and item frames. can anyone help me? 

Last seen on 12:43, 12. May 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think if you search well…
Fri, 05/03/2024 - 15:12

I think if you search well enough in the trigger list when you create a procedure, there is a "on player left click" or something like that.

Then you just have to check if the player is holding the right item in his main hand. If you need more information just tell me

Last seen on 08:49, 9. May 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can also use a keybind,…
Sat, 05/04/2024 - 00:13

You can also use a keybind, but it's probably a bit over the top.