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'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...

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.