How to play a vanilla music disc track with a procedure

Started by SirPogsalot on

Topic category: Help with modding (Java Edition)

Last seen on 04:15, 27. Mar 2024
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to play a vanilla music disc track with a procedure

So I'm trying to use procedures to play one of the vanilla music disc tracks using procedures, and I know the play sound procedure block already does this, but I need it to play a sound from a textfield in a GUI. So basically there's a textfield in a GUI I've added, and the player will input the name of a song, e.g. wait, stal, blocks, whatever. Then they'll press a button and that song will play.

But I don't seem to be able to add a string block into the sound selector, so I can't make it play whatever they typed. I also tried using the "execute command" block with the /playsound command, but that didn't work either and I'm not sure why.

Last seen on 21:15, 8. Jan 2021
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okey, theres are more…
Fri, 05/15/2020 - 22:06

Okey, theres are more solutions but I only have one in mind right now; you can brute force test for every possibility to enter something and then play it if string matches 

Last seen on 04:15, 27. Mar 2024
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That's true, I suppose I…
Fri, 05/15/2020 - 22:10

That's true, I suppose I could do that...

Last seen on 06:33, 1. May 2023
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
and command had a special…
Tue, 05/26/2020 - 08:56

and command had a special format like block.anvil.fall instead of "sound-effect:anvil fall"