Jump to content

[Solved][1.7.10] [1.6.4] custom record will not play sound


Recommended Posts

Posted

[solved this problem I put the answer in in earlier  thread

 

 

I know I am probably doing something really, really , really dumb, but I have been working on this for days and I would subject myself to ridicule from the forum and be anyone's whipping boy if they can set my on the right path. 

 

My custom record seems to be called no problem but no matter WHAT i do I absolutely cannot get it to play...it does not play in either 1.6.4 or 1.7.10, I have tried it in BOTH versions there is not that much code difference but to no avail in either.

 

My record is : Wolf_Howl.ogg in the package assets.glistremod.sounds

 

My sounds.json is in assets/glistremod

 

This forum has some brilliant people could anyone help?

package glistremod.items;
import glistremod.Main;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockJukeBox;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemRecord;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.client.event.sound.PlayStreamingEvent;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;


public class MusicDisc extends ItemRecord {
private static final Map records = new HashMap();

public final String recordName;

public MusicDisc(int ItemID, String recordName)
{
super(ItemID, recordName);
this.setCreativeTab(CreativeTabs.tabMisc);
this.recordName = recordName;
this.maxStackSize = 1;
records.put(recordName, this);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("glistremod:" + recordName);
}

@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
{
if (world.getBlockId(x, y, z) == Block.jukebox.blockID && world.getBlockMetadata(x, y, z) == 0)
{
if (world.isRemote)
return true;
else
{
((BlockJukeBox)Block.jukebox).insertRecord(world, x, y, z, itemStack);
//world.playAuxSFX(1005, x, y, z, this.itemID);
world.playAuxSFXAtEntity((EntityPlayer)null, 1005, x, y, z, this.itemID);
--itemStack.stackSize;
return true;
}
} 
else
return false;
}
/**
* allows items to add custom lines of information to the mouseover description
*/
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add(this.getRecordTitle());
}
/**
* Return the title for this record.
*/
@Override
public String getRecordTitle()
{
return StatCollector.translateToLocal(this.getUnlocalizedName() + ".desc");

}
/**
* *Possibly returns record titles from Vanilla minecraft
*/
/* public String getRecordTitle()
{
return "C418 - " + this.recordName;
}*/
@Override
public EnumRarity getRarity(ItemStack itemStack)
{
return EnumRarity.rare;
}
/**
* Return the record item corresponding to the given name.
*/
public static MusicDisc getRecord(String recordName)
{
return (MusicDisc)records.get(recordName);
}

public ResourceLocation getRecordResource(String name)
{
return new ResourceLocation("glistremod:sounds/Wolf_Howl.ogg");
}

public String getSoundFile()
{
return ("glistremod:sounds/Wolf_Howl.ogg");
}
@ForgeSubscribe 
public void onSound(SoundLoadEvent event)
{
event.manager.soundPoolStreaming.addSound("glistremod:sounds/Wolf_Howl");

}

// event.manager.soundPoolSounds.addSound("x/sound2.ogg", mod_ModName.class.getResource("/x/sound2.ogg"));
public void onPlayStreaming(PlayStreamingEvent event) {
boolean isCont;
isCont = event.name.contains("Wolf_Howl");
if (!isCont) {
FMLClientHandler.instance().getClient().sndManager.playStreaming("glistremod"+ ":" + event.name, event.x + 0.5F, event.y + 0.5F, event.z + 0.5F);
}
}
}

 

sounds.json file:

 {
"record_Glistre": {
"category":"master",
"sounds": [
{
"name": "Wolf_Howl",
"stream": true
}
]
}
}

 

my main file before preInit:

  public static ItemRecord record_Glistre; 

 

my main file in the preInit method:

// LOAD RECORD
record_Glistre=(ItemRecord) new MusicDisc(2003, "Wolf_Howl").setUnlocalizedName("Wolf_Howl").setCreativeTab(MyCreativeTab_1);
GameRegistry.registerItem(record_Glistre, "Wolf_Howl");
// MinecraftForge.EVENT_BUS.register(new SoundEvent());

Posted

for 1.7.10 you need to use json file, you have it but names in json file should be same as disc name. If you use 1.8 I can give you my code, it works for 1.8 but I didn't try it for 1.7.10

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • [13:02:36] [main/ERROR]:Mixin config fabric-item-api-v1.client.mixins.json does not specify "minVersion" property [13:02:36] [main/ERROR]:Mixin config entity_model_features.mixins.json does not specify "minVersion" property [13:02:37] [main/ERROR]:Mixin config beautifulcampfires.mixins.json does not specify "minVersion" property [13:02:37] [main/ERROR]:Mixin config portablespawner.mixins.json does not specify "minVersion" property [13:02:37] [main/ERROR]:Mixin config celestisynth.mixins.json does not specify "minVersion" property [13:02:37] [main/ERROR]:Mixin config fabric-item-group-api-v1.mixins.json does not specify "minVersion" property [13:02:37] [main/ERROR]:Mixin config fabric-item-group-api-v1.client.mixins.json does not specify "minVersion" property [13:02:37] [main/ERROR]:Mixin config fabric-data-attachment-api-v1.mixins.json does not specify "minVersion" property [13:02:37] [main/ERROR]:Mixin config fabric-data-attachment-api-v1.client.mixins.json does not specify "minVersion" property [13:02:37] [main/ERROR]:Mixin config pipeorgans.mixins.json does not specify "minVersion" property [13:02:42] [main/ERROR]:com.electronwill.nightconfig.core.io.ParsingException: Invalid TOML data: entry "[fastfurnace]" defined twice in its table. [13:02:42] [main/ERROR]:com.electronwill.nightconfig.core.io.ParsingException: Invalid TOML data: entry "[fastfurnace]" defined twice in its table.
    • Temu  bunch of Coupon Codes for Temu  to get FTemuREE GIFTS, DISCOUNTS, SAVINGS, and MORE. Check out below and download the Temu  app now !!! Temu  Coupon Code ( acy240173) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code ( acy240173 ). Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173) at checkout!!   Temu  coupon codes for New users 100€ Off - acy240173 Temu  discount code for New customers- acy240173 Temu  100€ coupon code- acy240173 what are Temu  codes - acy240173  does Temu  give you €300- acy240173 Yes Verified Temu  coupon code October2025- acy240173 Temu  New customer offer acy240173 Temu  discount code2025 acy240173 100 off coupon code Temu  acy240173 Temu  100 off any order acy240173 100 dollar off Temu  code acy240173 Temu  Coupon Code ( acy240173 ) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code (acy240173 ) or ( acy240173 ). Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173 ) at checkout!! Temu  coupon code for First Order - {acy240173} Temu  coupon code for New Users- {acy240173} Temu  coupon code for Existing Users- {acy240173} Temu  coupon code 100€ Off- {acy240173} Temu  coupon 30% Off code - {acy240173} - Temu  new user coupon code: acy240173 - Free gift on Temu : acy240173 - Temu  90% discount coupon code: acy240173 - Temu  100€ coupon code for first order: acy240173   Is the Temu  100€ Coupon Legit?  Yes, there are several legit Temu  coupon codes [ acy240173] available for 100€ off. Here are the options you can use: Code [acy240173]: This code provides a 100€ discount legit on your first order when you register and is reported to work effectively during checkout. Code [acy240173]: New users can also use this code to receive a 100€ discount on purchases over €249. Code [acy240173]: This code is available for both new and existing users, offering a 100€ discount on your order. Code [acy240173]: Another option for both new and existing users, this code allows you to save 100€ on your purchase.   Temu  Coupon code 100€ off for this month For October2025, several active Temu  coupon codes can help you save on your purchases: 40% Off Site-Wide: Use code "acy240173" to get 40% off everything. This code is widely used and verified for site-wide discounts on orders over €20. 40€ Off for New Customers: New customers can receive a €20 voucher by downloading the Temu  app and participating in an H5 page game. This voucher can be redeemed using a specific coupon “acy240173”. 40% Off Selected Items: There is also a 40% off coupon “acy240173” available for select items on the Temu  website. Remember to check the specific terms and conditions for each coupon, such as minimum purchase requirements and applicable product categories.   Temu  coupon code 100€ off for new and existing customer Temu  90% OFF promo code "acy240173 " will save you 100€ on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu  offers 100€ off coupon code [acy240173] Temu  Coupon code [acy240173 ] for existing users can get up to 50% discount on product during checkout. Temu  Coupon Codes for Existing Customers-[acy240173 ] Temu  values its loyal customers and offers various promo codes, including the Legit Temu  Coupon Code [acy240173 ] or [acy240173 ], which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.   Temu  Coupon Code 100€ Off for all users  There are specific Temu  coupon codes [acy240173] mentioned for South Africa in the provided search results. The results focus on general Temu  coupon codes [acy240173] and discounts, as well as codes for other countries like the Germany, UK, Canada, Mexico, Kuwait, Austria, Italy, Australia, France , Switzerland, Poland, Saudi Arabia, Germany, Sweden, Portugal, New Zealand, UAE, Belgium, Germany, and France.   Temu  Coupon Code 30% Off: acy240173 Temu  Coupon Code 100€ Off: acy240173 Temu  Coupon Code 100€ Off United States : acy240173 Temu  Coupon Code 100€ Off Germany: acy240173 Temu  Coupon Code 100€ Off Sweden : acy240173 Temu  Coupon Code 100€ Off Finland : acy240173 Temu  Coupon Code 50% : acy240173 Temu  Coupon Code 100€ Off United Kingdom : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Italy : acy240173 Temu  Coupon Code  100€ Off : acy240173 Temu  Coupon Code 100€ Off Austria : acy240173 Temu  Coupon Code 100€ Off Belgium : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Canada : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Estonia : acy240173 Temu  Coupon Code 100€ Off Switzerland : acy240173 Temu  Coupon Code  100€ Off : acy240173 Temu  Coupon 30% Off + Free Shipping & More There are a bunch of Coupon Codes for Temu  to get FREE GIFTS, DISCOUNTS, SAVINGS, and MORE. Check out below and download the Temu  app now !!! Temu  Coupon Code ( acy240173) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code (acy240173) \ Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173) at checkout!!Temu  Coupon Code Mexico : acy240173 Temu  Coupon Code 100€ Off Ireland : acy240173 Temu  Coupon Code 100€ Off Norway: acy240173 Temu  Coupon Code 100€ Off New Zealand : acy240173 Temu  Coupon Code 100€ Off Poland : acy240173 Temu  Coupon Code 100€ Off Serbia : acy240173 Temu  Coupon Code 100€ Off Armenia : acy240173 Temu  Coupon Code 100€ Off Austria : acy240173 Temu  Coupon Code 100€ Off Greece : acy240173 Temu  Coupon Code 100€ Off Japan : acy240173 Temu  Coupon Code 100€ Off Iceland : acy240173 Temu  Coupon Code 100€ Off Bahrain : acy240173 Temu  Coupon Code 100€ Off Philippines : acy240173 Temu  Coupon Code 100€ Off Portugal : acy240173 Temu  Coupon Code 100€ Off Romania: acy240173 Temu  Coupon Code 100€ Off Slovakia : acy240173 Temu  Coupon Code 100€ Off Malta: acy240173 Temu  Coupon Code 100€ Off France  : acy240173 Temu  Coupon Code 100€ Off South Africa : acy240173 Temu  Coupon Code 100€ Off Hungary : acy240173 Temu  Coupon Code 100€ Off Brazil : acy240173 Temu  Coupon Code 100€ Off Finland : acy240173 Temu  Coupon Code 100€ Off Morocco : acy240173 Temu  Coupon Code 100€ Off Kazakhstan : acy240173 Temu  Coupon Code 100€ Off Colombia : acy240173 Temu  Coupon Code 100€ Off Chile : acy240173 Temu  Coupon Code 100€ Off Israel : acy240173 Temu  Coupon Code 100€ Off Qatar: acy240173 Temu  Coupon Code 100€ Off Slovenia : acy240173 Temu  Coupon Code 100€ Off Uruguay : acy240173 Temu  Coupon Code 100€ Off Latvia: acy240173 Temu  Coupon Code 100€ Off Jordan : acy240173 Temu  Coupon Code 100€ Off Ukraine : acy240173 Temu  Coupon Code 100€ Off Moldova : acy240173 Temu  Coupon Code 100€ Off Oman: acy240173 Temu  Coupon Code 100€ Off Mauritius : acy240173 Temu  Coupon Code 100€ Off Republic of Korea : acy240173 Temu  Coupon Code 100€ Off Dominican Republic: acy240173 Temu  Coupon Code 100€ Off Czech Republic : acy240173 Temu  Coupon Code 100€ Off United Arab Emirates : acy240173 Temu  Coupon Code 100€ Off Peru : acy240173 Temu  Coupon Code 100€ Off Azerbaijan : acy240173 Temu  Coupon Code 100€ Off Saudi Arabia : acy240173 Temu  Coupon Code 100€ Off Croatia : acy240173   Conclusion The Temu  Coupon Code 100€ Off "acy240173" provides a significant discount of 100€ for users in Bahrain. This offer is available for both new and existing customers, allowing them to save substantially on their purchases.In addition to the 100€ discount, customers can also enjoy a 50% off on their orders. To redeem this coupon, simply sign up for a Temu  account, add items worth 100€ or more to your cart, and enter the code during checkout to apply the discounts automatically.   FAQs about the 100€ Off Coupon Code Q1: Who can use the 100€ off coupon? A: The coupon is available for both new and existing users, although different codes may apply to each group. Q2: Can multiple coupon codes be used at once? A: Generally, only one coupon code can be applied per transaction. However, some codes may offer bundled benefits. Q3: Do these coupons expire? A: Many Temu  coupons do not have an expiration date, making them convenient for users to redeem at their leisure. Q4: Are there specific conditions for using these coupons? A: Yes, some coupons may require a minimum purchase amount or specific item categories to be eligible for the discount. Q5: How can I find the latest Temu  Coupon Code 100€ Off 100€ Offs? A: Users can check within their account under "Coupons & offers" or look for updates on promotional websites and forums.
    • You could try this script: https://inconnu-plugins.de/tutorial/server-auto-restart
    • I have already tried other versions of MCP, from 2841 to 2860.
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.