How to detect how long a player has been holding an item

Started by flamearrows1 on

Topic category: Help with modding (Java Edition)

Last seen on 07:58, 7. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to detect how long a player has been holding an item

I'm trying to detect how long a player has been holding a specific item. For example a regular stick. If the player holds it for 100 ticks then a procedure runs. If the player switches from the stick they still keep the ticks they were at before they switch. For example they held the stick for 40 ticks then switched items, then switched back, the timer would resume from tick 40

Last seen on 16:04, 16. Sep 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could also use item in…
Tue, 09/10/2024 - 00:02

You could also use item in hand tick trigger on the item itself.