Skip to content

Conditions are the glue of SoundAPI, what makes it powerful and easily adaptable.
With them you can further specify when sounds should and shouldn't be replaced.

When looking to replace a sound, SoundAPI will check the Conditions, if they all are true then the sound is a valid replacement.

Conditions can be placed in 3 specific positions within a replacer. You can only have one Condition in one of these positions.

However logic gate conditions (and, nand, or, nor) have Conditions as properties, so by using logic gate conditions you can mix together multiple Conditions.

(Click for Example)
json5
{
	// This condition governs everything within the replacer
	// If FALSE this file will be skipped
	"condition": {
	},
	"replacements": [
		{
			"matches": "*:ZombieAttackPlayer",
			// this condition governs any sounds within this specific matcher
			// If false the matched sounds will not be replaced
			"condition": {
			},
			"sounds": [
				{
					"sound": "Enemies/Zombie/MyAttackPlayerSound.ogg",
					// This condition governs this sound specifically
					// If false this specific Sound File will not be used
                    //
					// If no other Sound Files are available 
                    // the matcher is effectively disabled
					"condition": {
					}
				}
			]
		}
	]
}