Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.7.2] Custom Music Discs
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
burnner

[1.7.2] Custom Music Discs

By burnner, May 21, 2014 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

burnner    2

burnner

burnner    2

  • Tree Puncher
  • burnner
  • Members
  • 2
  • 21 posts
Posted May 21, 2014

Hello,

how do you add custom music discs? The old ways don't work anymore thanks to

new sound system.

 

best regards

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6692

diesieben07

diesieben07    6692

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6692
  • 45730 posts
Posted May 21, 2014

Use

getRecordResource

in your record item.

  • Quote

Share this post


Link to post
Share on other sites

burnner    2

burnner

burnner    2

  • Tree Puncher
  • burnner
  • Members
  • 2
  • 21 posts
Posted May 21, 2014

where? I don't find a getrecordresource

 

I used:

 

itsHerobrine = new ItemHDisc("herobrinemod:records.seeherobrine").setUnlocalizedName("seeherobrine").setTextureName("herobrinemod:record_seeherobrine");

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6692

diesieben07

diesieben07    6692

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6692
  • 45730 posts
Posted May 21, 2014

It is a method you override.

Please, learn basic java.

  • Quote

Share this post


Link to post
Share on other sites

burnner    2

burnner

burnner    2

  • Tree Puncher
  • burnner
  • Members
  • 2
  • 21 posts
Posted May 21, 2014

No.  And it won't work eather since I already have this function in my custom disc class. It has something to do with the sound.json

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6692

diesieben07

diesieben07    6692

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6692
  • 45730 posts
Posted May 21, 2014

Then your question is not related to music discs...

  • Quote

Share this post


Link to post
Share on other sites

sequituri    118

sequituri

sequituri    118

  • Dragon Slayer
  • sequituri
  • Forge Modder
  • 118
  • 669 posts
Posted May 22, 2014

Look at ItemRecord.class as Diesieben suggests. It has methods to do what you want when overridden,

  • Quote

Share this post


Link to post
Share on other sites

burnner    2

burnner

burnner    2

  • Tree Puncher
  • burnner
  • Members
  • 2
  • 21 posts
Posted May 22, 2014

I know that you have to extend the ItemRecord class, but don't you have to make your own Sounds.json file for this work proper?

  • Quote

Share this post


Link to post
Share on other sites

burnner    2

burnner

burnner    2

  • Tree Puncher
  • burnner
  • Members
  • 2
  • 21 posts
Posted May 23, 2014

Well I made it

 

1. The sounds.json has to be located in your mods asset folder.

2. You can but the records in yourmodname/sounds/records/

3. You have to add the soundfiles to your sounds.json like this:

 

{
  "itsherobrine": {
    "category": "record",
    "sounds": [
      {
        "name": "sounds/records/itsherobrine",
        "stream": true
      }
    ]
  }
}

 

4. Make your own Record class that extends from ItemRecord (because the constructor is invisible)

5. The name of your record has to be: yourmodname:yourrecordname

  • Quote

Share this post


Link to post
Share on other sites

daafganggdg    3

daafganggdg

daafganggdg    3

  • Creeper Killer
  • daafganggdg
  • Members
  • 3
  • 141 posts
Posted June 20, 2014

hey, I know the problem seems to be already solved, however, I thought you have to override   

    
public ResourceLocation getRecordResource(String name)
    {
        return new ResourceLocation(name);
    }

so it leads minecraft to your own folder, i tried to override it in my own class

    
@Override
public ResourceLocation getRecordResource(String name)
    {
        return new ResourceLocation("MyModName:" + name);
    }

 

I'v put the wait.ogg in assets.mymodname.sounds.records and open the class in my modfile with

	public static Item record = new Record("wait");

soooooooooooooooooo, unfortunatly I get an error:

[14:38:24] [Client thread/WARN]: Unable to play unknown soundEvent: mymodname:records.wait

What am I doing wrong?

(I'm pretty new to Java and mc modding so don't cry if i made any horrible mistakes  ;) )

  • Quote

Share this post


Link to post
Share on other sites

coolboy4531    66

coolboy4531

coolboy4531    66

  • Dragon Slayer
  • coolboy4531
  • Members
  • 66
  • 584 posts
Posted June 20, 2014

That means it's looking at sounds/record/records.wait (which isn't valid)

  • Quote

Share this post


Link to post
Share on other sites

daafganggdg    3

daafganggdg

daafganggdg    3

  • Creeper Killer
  • daafganggdg
  • Members
  • 3
  • 141 posts
Posted June 20, 2014

so where exactly do I have to make the package for my sound file now?  :-\

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • TomPlayzs
      [ solved ] - HUD images (exp bar, health, hunger, etc.) glitching out.

      By TomPlayzs · Posted 19 minutes ago

      I have this problem too! How do i fix it?
    • Oliviafrostpaw
      [1.14.4] Injecting into Existing Loot Tables, Blocks

      By Oliviafrostpaw · Posted 30 minutes ago

      Making it easier for showing the code, please see GitHub repository that I ideally should have set up to begin with so that I would have known when exactly all of this broke Github Link
    • DragonITA
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA · Posted 1 hour ago

      i think whoever's bugging me in the HorseEntity Class is, here: private static final String[] HORSE_TEXTURES = new String[]{"textures/entity/horse/horse_white.png", "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png"};  
    • DragonITA
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA · Posted 1 hour ago

      package net.batonfack.fantasymod.client.models; import net.minecraft.client.renderer.entity.model.EntityModel; import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.ModelBox; import net.minecraft.entity.LivingEntity; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class ModelUnicornWitoutAbstracHorse<T extends LivingEntity> extends EntityModel<T> { protected final RendererModel field_217127_a; protected final RendererModel field_217128_b; private final RendererModel CornGroup; private final RendererModel Corn1; private final RendererModel Corn2; private final RendererModel Corn3; public ModelUnicornWitoutAbstracHorse(float p_i51065_1_) { this.field_217127_a = null; this.field_217128_b = null; this.textureWidth = 128; this.textureHeight = 64; CornGroup = new RendererModel(this); CornGroup.setRotationPoint(0.0F, 0.0F, 0.0F); Corn1 = new RendererModel(this, 64, 0); Corn1.setRotationPoint(1.5F, -5.0F, -15.0F); this.Corn1.setRotationPoint(0.5409F, 0.0F, 0.0F); CornGroup.addChild(Corn1); Corn1.cubeList.add(new ModelBox(Corn1, 52, 57, -3.0F, -3.0F, -4.0F, 3, 4, 3, 0.0F, true)); Corn2 = new RendererModel(this, 64, 28); Corn2.setRotationPoint(1.5F, -5.0F, -15.0F); this.Corn2.setRotationPoint(0.5409F, 0.0F, 0.0F); CornGroup.addChild(Corn2); Corn2.cubeList.add(new ModelBox(Corn2, 0, 0, -2.4F, -5.3F, -3.6F, 2, 3, 2, 0.0F, true)); Corn3 = new RendererModel(this, 96, 32); Corn3.setRotationPoint(1.5F, -5.0F, -15.0F); this.Corn3.setRotationPoint(0.5409F, 0.0F, 0.0F); CornGroup.addChild(Corn3); Corn3.cubeList.add(new ModelBox(Corn3, 0, 0, -1.8F, -8.1F, -3.2F, 1, 3, 1, 0.0F, true)); } protected void func_199047_a(RendererModel p_199047_1_) { RendererModel renderermodel = new RendererModel(this, 19, 16); renderermodel.addBox(0.55F, -13.0F, 4.0F, 2, 3, 1, -0.001F); RendererModel renderermodel1 = new RendererModel(this, 19, 16); renderermodel1.addBox(-2.55F, -13.0F, 4.0F, 2, 3, 1, -0.001F); p_199047_1_.addChild(renderermodel); p_199047_1_.addChild(renderermodel1); } }  
    • DragonITA
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA · Posted 1 hour ago

      package net.batonfack.fantasymod.entities; import net.batonfack.fantasymod.init.FantasyModEntities; import net.minecraft.entity.EntityType; import net.minecraft.entity.passive.horse.HorseEntity; import net.minecraft.world.World; public class UnicornEntity extends HorseEntity { @SuppressWarnings("unchecked") public UnicornEntity(EntityType<? extends HorseEntity> type, World worldIn) { super((EntityType<? extends HorseEntity>) FantasyModEntities.UNICORN_ENTITY, worldIn); } }  
  • Topics

    • WinneonSword
      2
      [ solved ] - HUD images (exp bar, health, hunger, etc.) glitching out.

      By WinneonSword
      Started August 31, 2013

    • Oliviafrostpaw
      8
      [1.14.4] Injecting into Existing Loot Tables, Blocks

      By Oliviafrostpaw
      Started December 8

    • DragonITA
      40
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA
      Started Monday at 10:06 AM

    • DarkZapato
      2
      Optifine 1.14.4 U HD F4 crash froge

      By DarkZapato
      Started Thursday at 04:09 PM

    • troyvs
      0
      [1.12.2]help me to attach capability to player

      By troyvs
      Started 1 hour ago

  • Who's Online (See full list)

    • TolgacanM
    • Choonster
    • Misterboy64
    • Yanny7
    • ricoc90
    • Oliviafrostpaw
    • TomPlayzs
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.7.2] Custom Music Discs
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community