how do i make stuff not repeat in the "on tick update"

Started by MofuMofu on

Topic category: Help with modding (Java Edition)

Last seen on 18:14, 26. Apr 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i make stuff not repeat in the "on tick update"

basically i want my mob to roar before setting the attack, i was able to make it but the mob repeats the sound/animation multiple times since it does the condition everytickupdate.

is there a way to repeat something once?

Last seen on 01:44, 26. Apr 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Put it in a different…
Mon, 03/11/2024 - 02:49

Put it in a different procedure. "On entity tick update" is basically an infinite loop.

Or, you could do a "If pick random number _ to _" = "_" to give it a rarity of sorts.

This will trigger ever tick so you'll want to set the second number higher depending on how often you want it to trigger, then code on from there!