Solved Sound compatibility between minecraft versions

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

PheonBest

Member
Jun 8, 2017
31
1
0
22
Hi !
Server's version : 1.12 (spigot) Skript's version: dev29.
I have a server which support 1.8 to 1.12 (with ViaVersion and ViaBackwards), that's why i'm wondering if I have to play the 1.8 version and the 1.12 version of a sound to be sure that all players will be able to hear it. Is there a compatibility between them ?

Have I to do that for exemple ?:
play sound "ui.button.click" with volume 1 with pitch 1 at player's location's location for player
play sound "CLICK" with volume 1 with pitch 1 at player's location's location for player

If it's needed, is there a way to know what's the client version of a player ?

P-S: I hope my english isn't too bad :emoji_stuck_out_tongue:
 
You can use TuSKe to get a player's version:
code_language.skript:
(mc|minecraft) version of %player%
%player%'[s] (mc|minecraft) version

Sadly you will need to map yourself the sounds between 2 versions, but you can make a function to choose between two comparing player's version, an example:
code_language.skript:
function playSound(p: Player, oldSound: String, newSound: String):
    if mc version of {_p} contains "1.8":
        set {_sound} to {_oldSound}
    else:
        set {_sound} to {_newSound}
play sound {_sound} with volume 1 with pitch 1 at {_p} for {_p}
So just call it as:
code_language.skript:
playSound(player, "ui.button.click", "CLICK")
 
  • Like
Reactions: PheonBest
You can use TuSKe to get a player's version:
code_language.skript:
(mc|minecraft) version of %player%
%player%'[s] (mc|minecraft) version

Sadly you will need to map yourself the sounds between 2 versions, but you can make a function to choose between two comparing player's version, an example:
code_language.skript:
function playSound(p: Player, oldSound: String, newSound: String):
    if mc version of {_p} contains "1.8":
        set {_sound} to {_oldSound}
    else:
        set {_sound} to {_newSound}
play sound {_sound} with volume 1 with pitch 1 at {_p} for {_p}
So just call it as:
code_language.skript:
playSound(player, "ui.button.click", "CLICK")

Thank you :emoji_slight_smile: I didn't know i could do that with TuSke !
 
Yes but it makes a little error ^^ (np i can chose a ressource pack according to mc version of %player% now :emoji_grinning:, this topic helps me anyway x)
 
Status
Not open for further replies.