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

feat: Add primitive support for sound api #1422

Open
wants to merge 2 commits into
base: dev/3.0.0
Choose a base branch
from

Conversation

Timongcraft
Copy link
Contributor

@Timongcraft Timongcraft commented Sep 3, 2024

With this PR, the Adventure-provided sound API is partially implemented.

It adds the ability to play sounds from a player (currently only for itself) and to stop sounds,
while making the methods fail silently if the sound can't played/stopped.

What this PR implements:

  • A method to play back (custom) sounds for a specific player (at/as the player itself) for players with version 1.19.3+
  • A method to stop (custom) sounds for players with version 1.19.3+

What this PR doesn't implement:

  • A method to play back (custom) sounds for a specific player at a position or another entity for players of all versions
  • A method to play back (custom) sounds (globally) at a specific location for players of all versions
  • A easily way to access a list of vanilla sounds
    - A method to play back (custom) sounds for a specific player (at the player itself) for players with version 1.19.2 and below
    - A method to stop (custom) sounds for players with version 1.19.2 and below

Clarification:
This PR only implements a sound API for version 1.19.3+ because only in this version is the server able to play a (vanilla) sound for a player without requiring a version-dependent id for the sound.

@Timongcraft

This comment was marked as resolved.

@Timongcraft Timongcraft marked this pull request as ready for review September 15, 2024 19:08
@nicolube
Copy link

nicolube commented Dec 8, 2024

What is the state of this? I would like to have this feature very much.

@Timongcraft
Copy link
Contributor Author

From my end, it is finished, although I would think it makes more sense to make the methods fail silently again.

fix: implement the correct playSound method
fix: bumped "since" version
@Timongcraft
Copy link
Contributor Author

We could also look into playing sounds from another player, but if so, I think that should be discussed first.

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

Successfully merging this pull request may close these issues.

2 participants