Class ModSounds

java.lang.Object
net.kamkeyke.example.registry.ModSounds

@Internal public class ModSounds extends Object
Example registry class for all sound events of the mod.

This class also acts as the single source of truth for SoundEntry, which are later consumed by AutoSoundProvider to automatically generate sounds.json.

Recommended pattern: Create helper methods in this class (such as singleSound(), variedSound() and customPaths()) to keep sound registration and datagen synchronized while avoiding duplicated information.

Example:


 public static final RegistryObject<SoundEvent> VINE_BOOM =
     singleSound("vine_boom", "sfx/misc/vine_boom");

 public static final RegistryObject<SoundEvent> FIRE_CRACKLING =
     variedSound("fire_crackling", "sfx/fire_cracklings/fire_crackling", 5);
 

These helpers both register the corresponding SoundEvent and add the matching SoundEntry to SOUND_ENTRIES. The list is later consumed by AutoSoundProvider to generate sounds.json, ensuring that both the registry and datagen remain synchronized without duplicating information.


This class was not registered in the ModEventBus and therefore will not appear in-game.

It serves only as an example.

  • Field Details

    • SOUND_ENTRIES

      public static final List<SoundEntry> SOUND_ENTRIES
    • SOUND_EVENTS

      public static final net.minecraftforge.registries.DeferredRegister<net.minecraft.sounds.SoundEvent> SOUND_EVENTS
    • VINE_BOOM

      public static final net.minecraftforge.registries.RegistryObject<net.minecraft.sounds.SoundEvent> VINE_BOOM
  • Constructor Details

    • ModSounds

      public ModSounds()
  • Method Details

    • register

      public static void register(net.minecraftforge.eventbus.api.IEventBus eventBus)