Package net.kamkeyke.example.registry
Class ModSounds
java.lang.Object
net.kamkeyke.example.registry.ModSounds
Example registry class for all sound events of the mod.
This class was not registered in the ModEventBus and therefore will not appear in-game.
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final List<SoundEntry>static final net.minecraftforge.registries.DeferredRegister<net.minecraft.sounds.SoundEvent>static final net.minecraftforge.registries.RegistryObject<net.minecraft.sounds.SoundEvent> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidregister(net.minecraftforge.eventbus.api.IEventBus eventBus)
-
Field Details
-
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)
-