Jump to content

Recommended Posts

Posted

I'm working on a small mod that revolves around a specific block, and I've more or less got the functionality down. The issue I'm having is with the models - I've managed to get the model to apply when the block is placed in the world, but I can't get the item to be modeled in the player's inventory. It just shows up as the default flat black/magenta checkerboard in its slot, and as an overlarge block of the same texture when held. I wouldn't normally ask for help with something so mundane, but I'm legitimately stumped what I'm doing wrong. I've tried just about everything I can think of, including converting the blockstate JSON to Forge's format, changing paths, everything. The registry code is clearly working at least in part, since the block model works when it's placed, but the item just refuses to work.

 

ClientRegistry.kt

@SideOnly(Side.CLIENT)
@Mod.EventBusSubscriber(Side.CLIENT)
object ClientRegistry {
  @SubscribeEvent
  fun registerModels(e: ModelRegistryEvent) {
    ModelLoader.setCustomModelResourceLocation(
      Registry.itemBlockAutocrafter, 0,
      ModelResourceLocation(Registry.blockAutocrafter.registryName!!, "inventory"))
  }
}

 

blockstates/autocrafter.json

{
  "variants": {
    "normal": { "model": "autocrafter:autocrafter" },
    "inventory": { "model": "autocrafter:autocrafter" }
  }
}

 

models/block/autocrafter.json (copied wholesale from the Crafting Table, going to edit more later)

{
  "parent": "block/cube",
  "textures": {
    "particle": "blocks/crafting_table_front",
    "down": "blocks/planks_oak",
    "up": "blocks/crafting_table_top",
    "north": "blocks/crafting_table_front",
    "east": "blocks/crafting_table_side",
    "south": "blocks/crafting_table_side",
    "west": "blocks/crafting_table_front"
  }
}

 

models/item/autocrafter.json (again copied/modified from the Crafting Table)

{
  "parent": "autocrafter:block/autocrafter"
}

 

The item being rendered

2019-05-13_17_46_44.png.8a91e09607579ef19abb19b3ba828b97.png

 

The block when placed (currently looks the same as a Crafting Table, but it's not)

2019-05-13_20_40_05.png.cfc8535fc94fbc5f7ddf6bfaa66cf59a.png

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.