Posted September 20, 20187 yr I have an ItemBlock connected that's tied to a block and I want it to be wearable as a helmet (it's a mob skull) and I have the block fully working but when I put it on as a helmet it just uses the JSON model for the Item (a flat texture) instead of the armor model that I define in the ItemBlock class. //In the itemblock class: @Override public boolean isValidArmor(ItemStack stack, EntityEquipmentSlot armorType, Entity entity) { return armorType == EntityEquipmentSlot.HEAD; } @Override public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { return Ref.MOD_ID + ":textures/entites/hirschgeist.png"; } @Override @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped defaultModel) { return ClientProxy.helmetModel; } //Client Proxy public static final ModelHirschgeistSkullArmorPiece helmetModel = new ModelHirschgeistSkullArmorPiece(0.0625F); //Block registry events /** * Register this mod's {@link Block}s. * * @param event The event */ @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { final IForgeRegistry<Block> registry = event.getRegistry(); final Block[] blocks = { trillium, hirschgeistskull, }; registry.registerAll(blocks); GameRegistry.registerTileEntity(TileEntityTrillium.class, new ResourceLocation(Ref.MOD_ID + ":" + trillium.getRegistryName())); GameRegistry.registerTileEntity(TileEntityHirschgeistSkull.class, Ref.MOD_ID + ":" + hirschgeistskull.getRegistryName()); } /** * Register this mod's {@link ItemBlock}s. * * @param event The event */ @SubscribeEvent public static void registerItemBlocks(final RegistryEvent.Register<Item> event) { final ItemBlock[] items = { new ItemBlock(trillium), hirschgeistskull.getItemBlock(), }; final IForgeRegistry<Item> registry = event.getRegistry(); for (final ItemBlock item : items) { final Block block = item.getBlock(); final ResourceLocation registryName = Preconditions.checkNotNull(block.getRegistryName(), "Block %s has null registry name", block); registry.register(item.setRegistryName(registryName)); ITEM_BLOCKS.add(item); } } How should I be registering the model? The Block is a TE with a TESR and that's registered, but I'm not sure how I should register my model. If I use ModelLoader.setCustomModelResourceLocation it's just the item texture on my head, not the java model. I put a print statement in getArmorModel and it doesn't seem like it's running. By the way, getItemBlock(); returns a new instance of my ItemBlock class. Edited January 6, 20196 yr by hiotewdew All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
September 20, 20187 yr How dynamic is your block? Does it need a TESR or can it be rendered with a custom baked model? If it can be rendered with a custom model, do it this way for the block first, then work on the item model. About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
September 20, 20187 yr Author 16 hours ago, Cadiboo said: How dynamic is your block? Does it need a TESR or can it be rendered with a custom baked model? If it can be rendered with a custom model, do it this way for the block first, then work on the item model. I cannot bake it, no. All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
September 23, 20186 yr Author Bump Here's my code: http://github.com/itsmeow/betteranimalsplus Edited September 23, 20186 yr by hiotewdew All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
September 23, 20186 yr Author I made a seperate wearable item and a seperate placeable item instead of an ItemBlock with armor attributes. Apparently minecraft requires it to extend ItemArmor for getArmorModel() to work. A shame. All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
September 23, 20186 yr 56 minutes ago, hiotewdew said: I made a seperate wearable item and a seperate placeable item instead of an ItemBlock with armor attributes. Apparently minecraft requires it to extend ItemArmor for getArmorModel() to work. A shame. You could copy most of the code from ItemBlock and put it into your ItemArmor class About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
September 23, 20186 yr Author 57 minutes ago, Cadiboo said: You could copy most of the code from ItemBlock and put it into your ItemArmor class I could, but the Block Registry requires it to extend ItemBlock. All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
September 23, 20186 yr No forge registry requires you to have an item be an ItemBlock About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
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.