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

I'm trying to create a custom disk for minecraft. Here is what i did:

 

This is my new item (MyItemDisk) :

public static final Item DISK_1 = new MyItemDisk("disk_1", Disks.DISK_1);

 

This is my class MyItemDisk :

public class MyItemDisk extends ItemRecord implements IHasModel { //IHasModel is for rendering
	public MyItemDisk(String name,SoundEvent sound) {
        super(name,sound);

        setRegistryName(name);
        setUnlocalizedName(name+".ctm");
        setCreativeTab(CreativeTabs.SEARCH); //Because I have a custom creative tab with all the items that have ".ctm" in their unlocalized names
      
	ModItems.ITEMS.add(this); //to register the item
	}
  
	@Override //IHasModel
	public void registerModels() {
		Main.proxy.registerItemRenderer(this, 0, "inventory");
	}
	
}

 

Here is Disks.DISK_1 (the SoundEvent) :

public class Disks {
	public static final SoundEvent DISK_1 = new SoundEvent(new ResourceLocation("ctm:records.disk_1")).setRegistryName("disk_1");
}

 

And finally I register the SoundEvent :

 

@SubscribeEvent
	public static void registerSoundEvents(RegistryEvent.Register<SoundEvent> event) {	
		event.getRegistry().register(Disks.DISK_1);		
}

 

And here is my sounds.json :

 

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

 

I checked the other thread that I could found and most of the time, the problem was with a wrong folder name but I don't think that it's my issue, is it ?

 

(ps:the sound is in ogg format in "\src\main\resources\assets\ctm\sounds\records")

 

Here is what my folder looks like :

image.png.b4841ee184c3cc151e0e0ed0b4d7da59.png

 

And the error :

 

Quote

[14:26:06] [main/WARN] [net.minecraft.client.audio.SoundManager]: Unable to play empty soundEvent: ctm:records.disk_1

 

Edited by Cyp86
Solved

20 minutes ago, Cyp86 said:

"name": "records/disk_1",

If I recall correctly a sound name should be prefixed by your modid.

"name": "ctm:records/disk_1"

33 minutes ago, Cyp86 said:

I checked the other thread that I could found and most of the time, the problem was with a wrong folder name but I don't think that it's my issue, is it ?

If the file can't be found the startup log will contain a message that a file at a given resource location could not be found.

  • Author

Thank's that did work, I didn't understood that it was required in the json too.

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.