Sound Overlap

Started by infinit on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sound Overlap

Hello. i wanted to make entity that plays sound when its agressive which i actually did but when i joined the world the loud sound earraped me because of the overlaping. is there any way to fix the overlap problem with the sound?

Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Simple way to do this if…
Thu, 04/16/2026 - 06:44

Simple way to do this

if random integer between 1 and 100 = 5
do 
	play sound entity.aggressive
  • 20 Ticks = 1 Second, so when you make an update tick procedure, the sound is playing 20 times per second. This would play the sound roughly every 5 or so seconds, however, because it is random, still has a chance to overlap and/or repeat more than once in quick succession. I recommend the second option

Second Way to do this

  1. Under Synced Data tab in your Entity element, create a new number entry called Timer and give it a 100-120 tick timer (5-6s timer)
    1. Save the entity before continuing so the synced data can be called by a procedure
  2. On tick update, use the following procedures under on entity tick update
    1. For sound to repeat every 5 seconds
      1. if [For custom entity [Event/target entity] of type [entity type] get integer data parameter [timer] value] > 0
        do
        	For custom entity [Event/target entity] of type [entity type] set integer data parameter [timer] value to [[For custom entity [Event/target entity] of type [entity type] get integer data parameter [timer] value] - [1]]
        	
        else 
        	Play sound
        	For custom entity [Event/target entity] of type [entity type] set integer data parameter [timer] value to [100]
        	
    2. For sound to repeat at random but spaced-out intervals between 5-10 seconds
      1. if [For custom entity [Event/target entity] of type [entity type] get integer data parameter [timer] value] > 0
        do
        	For custom entity [Event/target entity] of type [entity type] set integer data parameter [timer] value to [[For custom entity [Event/target entity] of type [entity type] get integer data parameter [timer] value] - [1]]
        	
        else 
        	Play sound
        	For custom entity [Event/target entity] of type [entity type] set integer data parameter [timer] value to [Random integer between min 100 and max 200]
Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Forgot to add, if your…
Thu, 04/16/2026 - 06:45

Forgot to add, if your entity only makes aggressive sounds when it is targetting someone, use this and out the rest of the procedure inside it

if is event/target entity currently aggressive
do
	[insert one of the two procedures from previous message]