How to start an event after right clicking entity certain amount of times?

Started by b.ART.ek on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to start an event after right clicking entity certain amount of times?

I want to make an event or rather chain of events that gets triggered after you right click entity with an item certain amount of times. Sadly using do with x% chance caused the events to have a random chance of happening (for example entity plays animation but doesn't despawn). Is there a way to fix it?
If yes, please send me screenshots of correctly made procedure. Thanks!

Here's my procedure btw

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello. You can pull this off…
Sun, 06/04/2023 - 21:37

Hello. You can pull this off by making a global variable called "clicks". If you increase it by 1 every time you click it, then you can just detect if the variable is equal to a certain number