Posted November 10, 20195 yr hello. i am a beginer in forge mod making and i wanted to code a chest with a custom size i achieved it but when i hold my item in my hand it's a big cube with purple and black square(missing texure) bug i don't have message in the logs about a missing blockstate nor textures all i have is the big buggy item here is a screen shot you can find my code here https://github.com/Gamerstone/FFactory sorry bad english im not a native speaker and thanks in advance Edited November 10, 20195 yr by Marcb barbier Gamerstone no name put
November 10, 20195 yr Looks like an asset problem.https://github.com/Gamerstone/FFactory/blob/master/resources/assets/ffactory/models/item/copper_chest.json#L1-L6 https://github.com/Gamerstone/FFactory/blob/master/resources/assets/ffactory/models/item/iron_chest.json#L1-L6 Your item model JSON can simply be: (For blocks!) { "parent": "modid:block" } If it's an item texture, then your current method is just fine.
November 10, 20195 yr Author thank you for your help but that didn't fix the issue i still have the same problem here my logs there is now error about model jsons https://pastebin.com/CVkTmjVp Edited November 10, 20195 yr by Marcb barbier Gamerstone providing logs
November 10, 20195 yr That's because you just copy-pasted what I put there.. Caused by: java.io.FileNotFoundException: modid:models/block.json You have to put YOUR modid where modid is, and YOUR block name where block is. { "parent": "ffactory:block/copper_chest" } for example... ^ Edited November 10, 20195 yr by MSpace-Dev
November 10, 20195 yr Author oh you right sorry for that i applied your fix there no more error in the logs but i still have the render bug Edit: i just updated the github with the fix still have the render bug tho Edit2: its like the file is read (because i have the error without it) and it's not used even when i had the code for a simple 2d item it was still rendering the big cube Edited November 11, 20195 yr by Marcb barbier Gamerstone
November 11, 20195 yr Problematic Code #1, Code Style #1, #2, #3, #4 Your chests aren't instances of IHasModel, so their Item models aren't being registered. (It's almost like IHasModel is useless because all Blocks and Items need models!) Even if they were, you've commented out the registerModels code in the copper chest anyways, which probably wouldn't help matters. Edit: You'll also have a rather brown-looking iron chest, since you just copied the copper chest's Json over to the iron one. Edited November 11, 20195 yr by SerpentDagger Fancy 3D Graphing Calculator mod, with many different coordinate systems. Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.
November 12, 20195 yr Author Thank you a lot i will try that as soon as I can And I will also try fix all of the code style error For the iron chest I did just copied the code from the copper one I would have fixed it if I had seen the chest workin
November 12, 20195 yr Do not make your classes implement IHasBlockModel.Refer here. (Code-Style, #3) Register your items/blocks like this instead. @SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(ModBlocks.BLOCKS); Utils.getLogger().info("Blocks Registered"); } @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(ModItems.ITEMS); for (Block block : ModBlocks.BLOCKS) { event.getRegistry().register(new ItemBlock(block).setRegistryName(block.getRegistryName()).setUnlocalizedName(block.getUnlocalizedName())); } Utils.getLogger().info("Items Registered"); } @SubscribeEvent public static void registerModels(ModelRegistryEvent event) { for (Block block : ModBlocks.BLOCKS) { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } for (Item item : ModItems.ITEMS) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } Utils.getLogger().info("Models Registered"); } Edited November 12, 20195 yr by MSpace-Dev Code formatting
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.