Home Commands Examples Getting Started With Scripts Global Keywords
Generic Recipe Manipulation

Sound

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import mods.botanypotstweaker.potinteraction.Sound;

Implements

Undocumented Interfaces

ISound

Members

static of(data as MapData) as Sound
Convert a MapData object to a Sound object.

Returns: The converted Sound object.

script.zs
// Sound.of(data as MapData) as Sound;
Sound.of(myMapData);

Parameters:

data Type: MapData - The MapData object to convert.

Return Type: Sound

static of(sound as SoundEvent, category as SoundSource, pitch as float, volume as float) as Sound
Create a new Sound object with the given parameters.

Returns: The created Sound object.

script.zs
// Sound.of(sound as SoundEvent, category as SoundSource, pitch as float, volume as float) as Sound;
Sound.of(mySoundEvent, mySoundSource, myFloat, myFloat);

Parameters:

sound Type: SoundEvent - The SoundEvent to use for the sound.
category Type: SoundSource - The SoundSource category of the sound.
pitch Type: float - The pitch of the sound.
volume Type: float - The volume of the sound.

Return Type: Sound