Package com.cryptomorin.xseries
Class XSound.Record
java.lang.Object
com.cryptomorin.xseries.XSound.Record
- Enclosing class:
- XSound
A class to help caching sound properties parsed from config.
- Since:
- 3.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionatLocation
(org.bukkit.Location location) Plays the sound to all the nearby players (based on the specified volume)forPlayer
(org.bukkit.entity.Player player) Plays the sound only for a single player and no one else can hear it.forPlayerAtLocation
(org.bukkit.entity.Player player, org.bukkit.Location location) Plays the sound only for a single player and no on else can hear it.void
play()
Plays the sound with the given options and updating the player's location.void
play
(org.bukkit.Location updatedLocation) Plays the sound with the updated location.void
Stops the sound playing to the players that this sound was played to.
-
Field Details
-
sound
-
volume
public final float volume -
pitch
public final float pitch -
playAtLocation
public boolean playAtLocation -
player
-
location
-
-
Constructor Details
-
Record
-
-
Method Details
-
forPlayer
Plays the sound only for a single player and no one else can hear it. -
atLocation
Plays the sound to all the nearby players (based on the specified volume) -
forPlayerAtLocation
public XSound.Record forPlayerAtLocation(@Nullable org.bukkit.entity.Player player, @Nullable org.bukkit.Location location) Plays the sound only for a single player and no on else can hear it. The source of the sound is different and players using headphones may hear the sound with a 3D audio effect. -
play
public void play()Plays the sound with the given options and updating the player's location.- Since:
- 3.0.0
-
play
Plays the sound with the updated location.- Parameters:
updatedLocation
- the updated location.- Since:
- 3.0.0
-
stopSound
public void stopSound()Stops the sound playing to the players that this sound was played to. Note this works fine if the sound was played to one specific player, but for location-based sounds this only works if the players were within the same range as the original volume level.If this is a critical issue you can extend this class and add a cache for all the players that heard the sound.
- Since:
- 7.0.2
-