[TUTORIAL] How to make Custom Biome Music

Started by Killer1X2 on

Topic category: User side tutorials

Last seen on 14:47, 22. Apr 2024
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[TUTORIAL] How to make Custom Biome Music
Sun, 01/28/2024 - 16:45 (edited)

INTRODUCTION

Hello! I will be making a tutorial on how to make custom biome music, what I mean is, music that plays in the background while in the biome. It gives a good feeling for the environment depending on what the music is, let’s get right into it.

 

Thanks to @OneHana for the base, I changed most code but it’s almost the same. Link to the code I copied: https://drive.google.com/file/d/1GWg7b6TiMVJpb2oPEAaAlfLGGXeDn70_/view?pli=1. It’s just text, so it will be a bit of a pain to understand

 

VARIABLES: First, we will need 2 string variables: “yourLocation” and “previousLocation”. We need 3 number variables: “MusicTimer”, “TrackLength”, and “TrackNumber”. We now need a single logic variable: “BiomeMusic”. These variables can be named whatever you want, all of them are global variables and are “Player Lifetime”

 

STEP 1: We first need to make the main procedure. Make a new procedure called “BiomeMusicFunction”, you then set it to “On Player Tick Update”.

 

Next, copy this procedure:

 

STEP 2: Make another procedure called “LocationUpdate” and set it to “On Player Tick Update”.

 

After doing all that, you can then copy this procedure:

 

NOTE: You don’t need to copy the whole thing, just add the biomes you want to add music for, it’s just a example if you have many biomes and such. If you want to add 1 music to multiple biomes, you can make a tag and input all the biomes over there

 

STEP 3: You then need ANOTHER procedure, this time, don’t change the event trigger, leave it as is.

 

You can then copy this procedure:

NOTE: The TrackNumber is what will be played, I don't think it needs further explanation. The TrackLength is how long the track is in ticks. Let's say, the music is 20 seconds total, then you will put 400 ticks in the TrackLength, this is to play the music again after it has ended if you're still in the biome it should play at

 

STEP 4: You can make another procedure, this procedure will be for stopping the music.

 

You can then copy this procedure:

 

I’m sorry if there are things you cannot understand, I’m pretty sure you’ll be going through a ton of problems reading this since it’s my first time trying to help, I hope you will be able to understand it tho. If you have any questions, please feel free to ask me. I’ll try to help!

Edited by Killer1X2 on Sun, 01/28/2024 - 16:45
Last seen on 10:38, 22. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Decent tutorial, you've got…
Thu, 01/25/2024 - 13:38

Decent tutorial, you've got the basic idea down! You might want to run the music through a specific audio track and only cancel that audio track though, (say, the voice track, since it isn't used that much.) Otherwise, whenever you stopsound, it's going to stop all the current sounds, which could be weird.  If you just want to stop vanilla music, you can use /stopsound @p music, and run the custom music through a different track, but this'll still sound weird if it's already playing. 

You also don't need two variables for track length, you can just have a music-length player persistent variable that goes down every tick, and, as long as it's set to the duration of the song in ticks, you won't even need to manually stop the music, you can just use it to prevent additional music from playing.

And I'm not sure if you really need the location variable either, it might be easier to just check the player's current biome in the main procedure.

Oh, and you might want to put this in the 'Tutorials' category. 'Help with Modding' is generally just for help requests. But yeah, good luck, keep it up!

Last seen on 14:47, 22. Apr 2024
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for that! I'll try…
Sun, 01/28/2024 - 03:55

Thanks for that! I'll try and do what you recommend!

Last seen on 14:47, 22. Apr 2024
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wait a minute, you're the…
Sun, 01/28/2024 - 03:57

Wait a minute, you're the one who made the Fabulous Fletching mod!! That's amazing, anyways thanks again

Last seen on 14:47, 22. Apr 2024
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Klemen, could you move this…
Sun, 01/28/2024 - 04:40

@Klemen, could you move this to the 'Tutorials' category please? Thanks