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 seeds and entity sound emitters #6131

Merged
merged 17 commits into from
Jul 1, 2024
Merged

Conversation

TheLimeGlass
Copy link
Collaborator

@TheLimeGlass TheLimeGlass commented Oct 17, 2023

Description

This pull request adds the ability to;

  • Play a sound from entities themselves.
  • Select the sound seed, which allows you to opt out of using the default randomization.
    • When you play a sound, some sounds have a random variation of the sound by default in Minecraft. (See provided video)

Notes:

  • The entities is supported by Spigot, the EffPlaySound just never supported it.
  • Sound seed requires Paper 1.19.4+ or Adventure API 4.12.0+. I built the implementation of this so that a user can install a plugin with the latest Adventure API to get the benefits of this on any Minecraft version.
  • Maintained the @FunctionalInterface as it's beneficial to be using when the methods of World::playSound are the same as Player::playSound
  • Removed the duplicate method references, as we only need the strings of the sounds.

Example of how it sounds:
https://youtu.be/kPwegFywgm8

on script load:
	loop all armor stands in radius 100 around spawn of world "world":
		set {_stand} to loop-value
	while {_stand} is valid:
		wait 5 ticks
		if {test} is not set:
			play sound "ENTITY_EXPERIENCE_ORB_PICKUP" in jukebox category at volume 0.5 on {_stand}
		else if {test} is 1:
			play sound "BLOCK_AMETHYST_BLOCK_RESONATE" in jukebox category on {_stand}
		else if {test} is 2:
			play sound "BLOCK_AMETHYST_BLOCK_RESONATE" with seed 1 in jukebox category on {_stand}

Requirements: Paper 1.19.4+ or Adventure API 4.12.0+
Related Issues: none

@TheLimeGlass TheLimeGlass added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Oct 17, 2023
@TheLimeGlass TheLimeGlass marked this pull request as draft October 17, 2023 05:59
@TheLimeGlass TheLimeGlass marked this pull request as ready for review October 17, 2023 07:09
@TheLimeGlass TheLimeGlass changed the title Sound seeds and entity emitters Sound seeds and entity sound emitters Oct 17, 2023
Copy link
Contributor

@kiip1 kiip1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@sovdeeth sovdeeth added the 2.8 Targeting a 2.8.X version release label Dec 30, 2023
@sovdeeth sovdeeth added 2.9 Targeting a 2.9.X version release and removed 2.8 Targeting a 2.8.X version release labels Jan 5, 2024
@APickledWalrus APickledWalrus added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Jul 1, 2024
@sovdeeth sovdeeth merged commit 422b2db into dev/feature Jul 1, 2024
6 checks passed
@TheLimeGlass TheLimeGlass mentioned this pull request Aug 21, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 Targeting a 2.9.X version release enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants