tModLoader [Solved]Error with making custom music box for my terraria mod

Danimrod

Terrarian
I wanted to add spooky tunes for the season.

I'm pretty new at this, so my usual method for coding terraria stuff involves banging my head against the wall until I get it to work. So far this wall appears to be tougher then my head so any help at all will be massively appreciated. I was able to make the tile and the item for the music box no problem but I can't figure out where to even start with this error code as I've never seen it before and google has basically no results for it.

The error code is this:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Cannot assign music box to vanilla item ID 0
at Terraria.ModLoader.Mod.AddMusicBox(Int32 musicSlot, Int32 itemType, Int32 tileType, Int32 tileFrameY)
at Danismod.Danismod.Load() in Danismod.cs:line 24
at Terraria.ModLoader.ModContent.<>c.<Load>b__38_0(Mod mod)

I can post more of the code involved with this process if it helps.
 
While you haven't supplied any code for us to look at the error suggests that for whatever reason the second parameter of AddMusicBox is 0. Have you set it to the Id of your music box item?
 
I'm a huge idiot. I was being totally dyslexic and didn't realize that I spelt the name of my MusicBox item wrong in the .load file. Thank you so much for responding and allowing me this facepalm moment you actually saved my Halloween <3
 
Back
Top Bottom