Package net.kamkeyke.example.registry
Class ModSounds
java.lang.Object
net.kamkeyke.example.registry.ModSounds
Example Class of registry for all sound events of the mod.
This class also acts as the single source of truth for SoundEntry,
which are later used by AutoSoundProvider to automatically register all SoundEvents.
Recommended pattern:
To keep your code clean and avoid repetition, create helper methods like
singleSound, variedSound, and customPaths.
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 already register the SoundEvent and add a
corresponding SoundEntry for AutoSoundProvider datagen.
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
-
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)
-