Here's an example of how to register a sounditem:
Code: Select all
sounditems.register("partyhorn", {
description = S("Party Horn"),
inventory_image = "sounditems_partyhorn.png",
sound = {name = "sounditems_partyhorn", length = 4.6, gain = 3},
})
`name`: The name of the sound in the `sounds` directory of the mod
`length`: How long the sound is allowed to play for before being stopped
`gain`: Loudness of the noise
By default, the `max_hear_distance` is set to 100 blocks, but it's possible to make that customizable if required.
Download: https://github.com/An0n3m0us/sounditems ... master.zip
Browse code: https://github.com/An0n3m0us/sounditems
Version: 1.0