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 have generated a blockstate .json file in src/generated/resources/assets/multicolored_dragon_mod/blockstates/multicolored_enderdragon_egg.json . My registration code in MyMod.java is as follows:

public static final DeferredRegister<Block> BLOCKS
    = DeferredRegister.create(ForgeRegistries.BLOCKS, Constants.MODID);
public static final DeferredRegister<Item> BLOCK_ITEMS
    = DeferredRegister.create(ForgeRegistries.ITEMS, Constants.MODID);
public static RegistryObject<Block> DRAGON_EGG_BLOCK
    = BLOCKS.register(Constants.EGG_ID, ColoredEggBlock::new);
public static RegistryObject<Item> DRAGON_EGG_BLOCK_ITEM
    = BLOCK_ITEMS.register(Constants.EGG_ID,
    () -> new BlockItem(
        DRAGON_EGG_BLOCK.get(),
        new Item.Properties().rarity(Rarity.RARE)
    )
);

// ...

public MyMod() {
// ...
    EntityRenderers.register(EntityType.ENDER_DRAGON, ColoredDragonRenderer::new);
    MinecraftForge.EVENT_BUS.register(this);
  
    BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
    BLOCK_ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());

    FMLJavaModLoadingContext.get().getModEventBus()
        .addListener(ModPacketHandler::register);
}

Yet I get the following FileNotFoundException warning on load:

[05:21:54] [Worker-Main-14/WARN]: Exception loading blockstate definition: multicolored_dragon_mod:blockstates/multicolored_dragon_egg.json: java.io.FileNotFoundException: multicolored_dragon_mod:blockstates/multicolored_dragon_egg.json


Looking with a debugger, I found that in SimpleReloadableResourceManager::getResources, this.namespacedPacks doesn't contain multicolored_dragon_mod, which is very strange... any help would be appreciated.

Edited by Will Bradley
Changed dummy to real world variables

you didn't make the blockstate json. X.x

Just because you register a block, doesn't mean Minecraft generates those model & blockstate files.

src/main/resources/assets/MODID/blockstates/my_blockstate.json

why aren't you using this one?ย  ย  I personally tend to do my own support files, and this location, from within the main folder.ย 

Are your other blocks working?ย  also, I don't see the name of the 'block' that you the file is meant to match.

  • Author

Sorry, I tried to anonymize it by replacing my real names with dummy variables, but I wrote it at 5 AM so it was all screwy. My bad.

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.