yusufgamer Posted January 15, 2023 Share Posted January 15, 2023 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); } } Quote Link to comment Share on other sites More sharing options...
yusufgamer Posted January 15, 2023 Author Share Posted January 15, 2023 (edited) 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 January 15, 2023 by yusufgamer Quote Link to comment Share on other sites More sharing options...
warjort Posted January 15, 2023 Share Posted January 15, 2023 https://forge.gemwire.uk/wiki/BlockState_JSONs and getVariantBuilder() Quote 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. Link to comment Share on other sites More sharing options...
yusufgamer Posted January 15, 2023 Author Share Posted January 15, 2023 I also get this issue where it says Missing metadata in pack mod:armourandtoolsmod But i have a mods.toml file : https://github.com/RealYusufIsmail/Armour-and-Tools-Mod/tree/changed_to_java/src/main/resources/META-INF Quote Link to comment Share on other sites More sharing options...
warjort Posted January 15, 2023 Share Posted January 15, 2023 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 Quote 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. Link to comment Share on other sites More sharing options...
yusufgamer Posted January 15, 2023 Author Share Posted January 15, 2023 (edited) 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 January 15, 2023 by yusufgamer Quote Link to comment Share on other sites More sharing options...
warjort Posted January 15, 2023 Share Posted January 15, 2023 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. Quote 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. Link to comment Share on other sites More sharing options...
yusufgamer Posted January 19, 2023 Author Share Posted January 19, 2023 fixed issue. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.