Skip to content

Adding A Custom Sound Reward

Turkey2349 edited this page Mar 14, 2019 · 20 revisions

Before you add a sound reward, you need to have the basic reward setup. If you have not done that already, you need to head here to set up the base for the reward.

Fields:

Field Name Type Default Field Description
sound String The name of the sound to play
delay Integer 0 The delay for the sound to wait after the Chance Cube is broken before being played
serverWide Boolean False If the sound should be played to all players on the server
range Integer 16 Range that all players that are with in will receive the sound (if not server wide)
volume Float 1.0 The volume of the sound to be played at. Range 0.0 to 1.0
pitch Float 1.0 The pitch of the sound to be played at. Range 0.0 to 1.0
playAtPlayersLocation Boolean False If the sound should be played at the player's location and not the block

Example:

{
	"Sound_Reward": 
	{
		"chance": 0,
		"Sound":
		[
			{"sound":"entity.tnt.primed", "volume":1.0, "pitch":1.0, "playAtPlayersLocation":true, "serverWide": false, "range":25, "delay": 5}
		]
	}
}

Config Tutorial:

The sound reward is a fairly easy reward to setup. The first step is adding this sound reward type identifier of

"Sound": []

after either the chance value or the last reward that you added. Once that is done simply add

{"sound":"soundName"}

between the square brackets of the sound reward. After that simply replace soundName with your desired sound and viola! You have added a sound reward! Here is what an example sound reward will look like in the config

//TODO: Replace Sound-Type.png
Failed to load image: Sound-Type.png

Custom Sounds

Chances Cubes does support a system to allow people to add their own sounds to be triggered when opening a Chance Cube. There are a few things that you need todo, however, before this sound can be added to a reward. First, the sound file needs to be in an ogg file format. Second, the sound needs to be placed in the sounds folder which can be found in Custom Rewards in the Chance Cubes config folder. If this is on a server, then EVERY client needs to have this sound in that same folder or else they will not be able to have the sound played. Lastly, in the reward json file, follow the steps above to add a sound reward, but for the sound name, put "chancecubes.(soundfilename)", or if you are in 1.12, just put the "(soundfilename)"and viola! Your custom sound reward should now work!

Also note for 1.12 and on, Sound file names must also be all lower case.