Jump to content

Recommended Posts

Posted (edited)

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
Posted

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.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.