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 keep erros like this 

Exception loading blockstate definition: 'armourandtoolsmod:blockstates/ruby_ore.json' missing model for variant: 'armourandtoolsmod:ruby_ore#facing=north'

I dont know the cause. Here is my block state data gen code

public class ModBlockStateProvider extends BlockStateProvider {
    public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) {
        super(output, MOD_ID, exFileHelper);
    }

    @Override
    public @NotNull String getName() {
        return "Armour and Tools Mod Blockstates";
    }

    @Override
    protected void registerStatesAndModels() {
        normalBlock(BlockInit.RUBY_ORE.get());
        normalBlock(BlockInit.RAINBOW_ORE.get());
        normalBlock(BlockInit.SAPPHIRE_ORE.get());
        normalBlock(BlockInit.GRAPHITE_ORE.get());
        normalBlock(BlockInit.AQUMARINE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_RUBY_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_RAINBOW_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_SAPPHIRE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_GRAPHITE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_AQUMARINE_ORE.get());
        normalBlock(BlockInit.RUBY_BLOCK.get());
        normalBlock(BlockInit.RAINBOW_BLOCK.get());
        normalBlock(BlockInit.SAPPHIRE_BLOCK.get());
        normalBlock(BlockInit.GRAPHITE_BLOCK.get());
        normalBlock(BlockInit.AQUMARINE_BLOCK.get());
    }

    public void normalBlock(Block block) {
        ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block);

        if (name == null) {
            ArmourAndToolsMod.logger.error("Could not find block key for " + block.getName());
            return;
        }

        BlockModelBuilder builder =
                this.models().withExistingParent(name.getPath(), "block/cube_all");
        builder.texture("all", modLoc("block/" + name.getPath()));
        this.simpleBlockItem(block, builder);
        this.simpleBlock(block, builder);
    }
}

 

  • Author

None of generated resource's work


My main class

 

@Mod(MOD_ID)
public class ArmourAndToolsMod {
    public static final Logger logger = LoggerFactory.getLogger(ArmourAndToolsMod.class);
    public static final String MOD_ID = "armourandtoolsmod";

    public ArmourAndToolsMod() {
        var bus = FMLJavaModLoadingContext.get().getModEventBus();
        ItemInit.ITEMS.register(bus);
        BlockInit.BLOCKS.register(bus);

        // Register the item to a creative tab
        bus.addListener(ArmourAndToolsGroup::registerCreativeTab);
        // Register the data generators
        bus.addListener(DataGenerators::gatherData);

        // Register the mod to the event bus
        MinecraftForge.EVENT_BUS.register(this);
        logger.info("Hello from RealYusufismail's Armour and Tools Mod!");
    }
}

 

Edited by yusufgamer

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Quote

Missing metadata in pack

i.e. your resource/datapack metadata

 

You have a invalid space (%20) at the beginning of the file name.

https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/blob/changed_to_java/src/main/resources/ pack.mcmeta

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

  • Author

I tried adding the varient but still get the same error

My gh repo url : https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/tree/changed_to_java/src/main/java/io/github/realyusufismail/armourandtoolsmod

public class ModBlockStateProvider extends BlockStateProvider {
    public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) {
        super(output, MOD_ID, exFileHelper);
    }

    @Override
    public @NotNull String getName() {
        return "Armour and Tools Mod Blockstates";
    }

    @Override
    protected void registerStatesAndModels() {
        normalBlock(BlockInit.RUBY_ORE.get());
        normalBlock(BlockInit.RAINBOW_ORE.get());
        normalBlock(BlockInit.SAPPHIRE_ORE.get());
        normalBlock(BlockInit.GRAPHITE_ORE.get());
        normalBlock(BlockInit.AQUMARINE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_RUBY_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_RAINBOW_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_SAPPHIRE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_GRAPHITE_ORE.get());
        normalBlock(BlockInit.DEEPSLATE_AQUMARINE_ORE.get());
        normalBlock(BlockInit.RUBY_BLOCK.get());
        normalBlock(BlockInit.RAINBOW_BLOCK.get());
        normalBlock(BlockInit.SAPPHIRE_BLOCK.get());
        normalBlock(BlockInit.GRAPHITE_BLOCK.get());
        normalBlock(BlockInit.AQUMARINE_BLOCK.get());
    }

    public void normalBlock(Block block) {
        ResourceLocation name = ForgeRegistries.BLOCKS.getKey(block);

        if (name == null) {
            ArmourAndToolsMod.logger.error("Could not find block key for " + block.getName());
            return;
        }

        String path = name.getPath();

        BlockModelBuilder builder = models().cubeAll(path, modLoc("block/" + path));
        getVariantBuilder(block)
            .forAllStates(state -> ConfiguredModel.builder().modelFile(builder).build());
    }
}

 

Edited by yusufgamer

People that;

* post "it doesn't work" instead of showing the actual error.

* don't include all the information  https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/blob/f8f865ef0c94cfe54d3847d398ee9f533cf94379/src/main/java/io/github/realyusufismail/armourandtoolsmod/core/init/BlockInit.java#L21

* spend less than 30 minutes trying to figure it out for themselves and instead expect others to do their work for them

will usually just be ignored. 

I could try to guess what the problem is, but with such incomplete information I would likely be wrong, so I won't.

 

I've answered a number of your problems recently and the last few were trivial typos in your code which tells me you are putting little effort into trying to debug it for yourself.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

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.