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.

Hazza8974

Members
  • Joined

  • Last visited

Everything posted by Hazza8974

  1. but how do i add that to my code because what it says is quite short
  2. 'SoundEvent(net.minecraft.resources.ResourceLocation, float, boolean)' has private access in 'net.minecraft.sounds.SoundEvent' that was the error by the way caused by the soundevent
  3. public class ModSounds { public static final DeferredRegister<SoundEvent> SOUND_EVENTS = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, TutorialMod.MOD_ID); private static RegistryObject<SoundEvent> registerSoundEvent(String name) { ResourceLocation location = new ResourceLocation(TutorialMod.MOD_ID, name); return SOUND_EVENTS.register(name, () -> new SoundEvent(location, SoundSource.MASTER)); } public static void register(IEventBus eventBus) { SOUND_EVENTS.register(eventBus); } } anyone have any ideas i did you chat gpt to attempt to fix it without having to bother someone else about this but it said if the error kept occurring it said to post here so now im here
  4. Error= Caused by: java.lang.IllegalStateException: Cannot register new entries to DeferredRegister after RegisterEvent has been fired. Cause= package net.hazza.hazzasmod.block; import net.hazza.hazzasmod.HazzasMod; import net.hazza.hazzasmod.item.ModItems; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.material.Material; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; import java.util.function.Supplier; public class ModBlocks { public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, HazzasMod.MOD_ID); public static final RegistryObject<Block> YELLOW_WALLPAPER_BLOCK = registerBlock("yellow_wallpaper_block", () -> new Block(BlockBehaviour.Properties.of(Material.WOOD) .strength(3f).requiresCorrectToolForDrops())); private static <T extends Block> RegistryObject<T> registerBlock(String name, Supplier<T> block) { RegistryObject<T> toReturn = BLOCKS.register(name, block); registerBlockItem(name, toReturn); return toReturn; } private static <T extends Block>RegistryObject<Item> registerBlockItem(String name, RegistryObject<T> block) { return ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties())); } public static void register(IEventBus eventBus) { BLOCKS.register(eventBus); } }

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.