Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi, so I attempted to make a custom music disc, but whenever I attempt to play the disc I always get the error "Unable to play unknown soundEvent: cm:music/Peacock.ogg". I keep the song in assets.cm.music How can I fix this?

 

Music Disc Code

 

package com.crystal.item;

 

import net.minecraft.item.ItemRecord;

import net.minecraft.util.ResourceLocation;

 

import com.crystal.creativetab.CreativeTabsManager;

import com.crystal.lib.StringLibrary;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class RecordPeacock extends ItemRecord {

 

private String setRecordName;

protected RecordPeacock(String p_i45350_1_) {

super(p_i45350_1_);

// TODO Auto-generated constructor stub

}

{

this.setRecordName = "Peacock";

this.maxStackSize = 1;

this.setCreativeTab(CreativeTabsManager.tabI);

this.setUnlocalizedName("Peacock");

}

@SideOnly(Side.CLIENT)

    public String getRecordTitle()

    {

        return "7 Minutes Dead - " + this.recordName;

    }

@Override

public ResourceLocation getRecordResource(String name)

{

return new ResourceLocation(StringLibrary.MODID + ":music/Peacock.ogg");

}

}

 

 

  • Author

I made the sounds.json, but I am still getting the same error. Did I make it wrong?

sounds.json

 

{

"records.peacock": {

    "category": "record",

    "sounds": [

      "cm:music/Peacock",

      "stream": true

    ]

  }

 

  • Author

what exactly do you mean by the resource domain? I thought you were just supposed to add the path to the song.

what exactly do you mean by the resource domain? I thought you were just supposed to add the path to the song.

IIRC, domain is the part of a resource location string preceding the colon. In general, a fully qualified resource location is <domain>:<path within domain>. Resource domain (in this case) is "cm" (and then you need a colon). It's an important part of mod terminology, so remember the concept for all resources in all mods.

 

It can be confusing, figuring out what is needed where. In context, you might need only a path within domain (just the path, or even just a filename), because other parts of the resource location are known. It appears that there is no such context for this file, so the full resource location string would be required.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.