How to play a vanilla music disc track with a procedure

Started by SirPogsalot on

Topic category: Help with Minecraft modding (Java Edition)

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.

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 

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"