Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sound builder #23

Open
Matt-MX opened this issue May 25, 2024 · 0 comments
Open

Sound builder #23

Matt-MX opened this issue May 25, 2024 · 0 comments

Comments

@Matt-MX
Copy link
Owner

Matt-MX commented May 25, 2024

Ability to chain sounds together for more complex sound feedback.

Kotlin

val custom = soundBuilder {
  emitter(self)
  location { player.location.clone().add(0.0, 100.0, 0.0) } 

  play(someSoundKey) volume 1.0 pitch 2.0 relative true
  wait(1.tick)
  play(someOtherSoundKey) volume 2.0 pitch 0.0 emitter self
}

// ...
player.playSound(custom)

Java

SoundBuilder custom = new SoundBuilder()
  .play(Sound.of(someSoundKey).volume(1.0).pitch(2.0).relative())
  .wait(1L)
  .play(Sound.of(someOtherSoundKey).volue(2.0).pitch(0.0).relative());

// ...
custom.playSound(player);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant