I'm attempting to incorporate some Monstercat tracks in the form of music discs. I have the texture working, the name all set up, but nothing plays when I put it in a jukebox.
Pick apart my code if you wish:
package net.minecraft.src;
import java.io.File;
import net.minecraft.client.Minecraft;
public class mod_monstercatMusic extends BaseMod
{
public static final Item monstercatMusic = new ItemRecord(3567, "monstercatMusic").setUnlocalizedName("record").setMaxStackSize(1);
public mod_monstercatMusic() {
ModLoader.addName(monstercatMusic, "Music Disc");
Minecraft mc = ModLoader.getMinecraftInstance();
mc.installResource("streaming/monstercatMusic.ogg", new File(mc.getMinecraftDir(),"resources/streaming/monstercatMusic.ogg"));
}
@Override
public String getVersion()
{
return "Monstercat Music Mod 1.0";
}
@Override
public void load()
{
// TODO Auto-generated method stub
}
}
Rollback Post to RevisionRollBack
I may have a rock now, but give me 5 hours and I'll have a stack of diamonds!
I'm attempting to incorporate some Monstercat tracks in the form of music discs. I have the texture working, the name all set up, but nothing plays when I put it in a jukebox.
Pick apart my code if you wish:
package net.minecraft.src;
import java.io.File;
import net.minecraft.client.Minecraft;
public class mod_monstercatMusic extends BaseMod
{
public static final Item monstercatMusic = new ItemRecord(3567, "monstercatMusic").setUnlocalizedName("record").setMaxStackSize(1);
public mod_monstercatMusic() {
ModLoader.addName(monstercatMusic, "Music Disc");
Minecraft mc = ModLoader.getMinecraftInstance();
mc.installResource("streaming/monstercatMusic.ogg", new File(mc.getMinecraftDir(),"resources/streaming/monstercatMusic.ogg"));
}
@Override
public String getVersion()
{
return "Monstercat Music Mod 1.0";
}
@Override
public void load()
{
// TODO Auto-generated method stub
}
}
You need to link the sound to the disc. Copy the code from the music disc item class.
The code to play a song must be on the "onItemUse" of the record. On my code I send a packet to make it SMP compatible, but you may be able to use the regular world.playAuxSFXAtEntity method, like itemrecord.
Custom paintings! My latest project, still in BETA.
A small mod to improve your game, but keeping the vanilla flavour. For Minecraft 1.8.
Also check out my Redstone Jukebox mod, now updated to Minecraft 1.7.10!
Pick apart my code if you wish:
You need to link the sound to the disc. Copy the code from the music disc item class.
my code (beware, lots of debug info)
https://github.com/sidben/RedstoneJukebox/blob/master/code/sidben/redstonejukebox/common/ItemCustomRecord.java
Custom paintings! My latest project, still in BETA.
A small mod to improve your game, but keeping the vanilla flavour. For Minecraft 1.8.
Also check out my Redstone Jukebox mod, now updated to Minecraft 1.7.10!
Our mod is going to use music discs as well. I'll let you know how we did it once it's working.