Hello!
I've run into a problem when trying to add a fireworks sound to one of my items. Here is the code I'm using:
public ItemStack onItemRightClick(ItemStack par1ItemStack, World world, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
world.playSoundAtEntity(par3EntityPlayer, "fireworks.launch1", 0.5F, 0.4F);
if (!world.isRemote)
{
Vec3 look = par3EntityPlayer.getLookVec();
EntitySDRune wskull = new EntitySDRune(world, par3EntityPlayer, 1, 1, 1);
wskull.setPosition(
par3EntityPlayer.posX,
par3EntityPlayer.posY + 1.620,
par3EntityPlayer.posZ);
wskull.accelerationX = look.xCoord * 0.1;
wskull.accelerationY = look.yCoord * 0.1;
wskull.accelerationZ = look.zCoord * 0.1;
world.spawnEntityInWorld(wskull);
}
return par1ItemStack;
}
This is the line that should add the sound:
world.playSoundAtEntity(par3EntityPlayer, "fireworks.launch1", 0.5F, 0.4F);
fireworks.launch1 is a default minecraft sound (the sound when you launch a fireworks rocket). But for some reason this doesn't work.
Whenever I replace the fireworks.launch1 with random.bow it does play a bowsound.
Does anyone know what I did wrong here? I've been stuck on this londer than I'd like to admit