# setMusicState

<p class="callout info">An eventCall to change the state of the specified [`idMusicEntity`](https://wiki.eternalmods.com/books/entities-custom-encounters/page/idmusicentity "idMusicEntity") in an idEncounterManager.</p>

## Usage

```
item[0] = {
	eventCall = {
		eventDef = "setMusicState";
		args = {
			num = 3;
			item[0] = {
				entity = ""; // target
			}
			item[1] = {
				decl = {
					soundstate = ""; // stateDecl
				}
			}
			item[2] = {
				string = ""; // designComment
			}
		}
	}
}
```

- `target` is the [`idMusicEntity`](https://wiki.eternalmods.com/books/entities-custom-encounters/page/idmusicentity "idMusicEntity") to change the state of.
- `stateDecl` is the path to the decl for the `idSoundState` you want to change it to.

## Example Usage

```
item[0] = {
	eventCall = {
		eventDef = "setMusicState";
		args = {
			num = 3;
			item[0] = {
				entity = "sound_sound_musicentity_1"; // target
			}
			item[1] = {
				decl = {
					soundstate = "music_ghost_states/main_heavy"; // stateDecl
				}
			}
			item[2] = {
				string = "Change music state to heavy combat music"; // designComment
			}
		}
	}
}
```

## See Also

- [idMusicEntity](https://wiki.eternalmods.com/books/entities-custom-encounters/page/idmusicentity "idMusicEntity")