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

Been beating my head against the wall for a while on this one.

 

I am creating a block that should change it's model based on whether or not it is next to another one.

 

However I'm having this error and I can't seem to figure out what's going on.

 

Here is a single instance of the error

http://pastebin.com/eEja2LJT

 

There are four block models

shelf_center_oak.json

shelf_left_oak.json

shelf_right_oak.json

shelf_single_oak.json

 

My BlockShelf.json (BlockState)

http://pastebin.com/8c1sx859

 

and finally my BlockShelf.java class

http://pastebin.com/AhAvZtcw

 

Any insight would be greatly appreciated. Though I am not yet familiar with the inner workings of MinecraftForge, nor would I call myself a Java expert, I am a Software Engineer and perfectly ok with Googling something i don't understand in your answer :)

TitanCraft is coming... This will be updated with a link once available

That's not how Forge's blockstates format works. The format is documented here.

 

The

defaults

section can only contain the same values as a single variant would, it can't have multiple variants in it.

 

Each key in the

variants

section can either be a fully-defined variant (e.g.

connections=4,facing=east

or

normal

) or a property name (e.g.

connections

).

 

The value of a fully-defined variant key can either be an array of variants (in which case one will be chosen at random when the model is rendered) or a single variant (must not have an object as the first value, otherwise the deserialiser won't recognise it as a fully-defined variant).

 

The value of a property name key must be an object that maps each value of the property to a variant.

 

You can see some examples of the format here, here and here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

Awesome, thank you for the examples. I took a step away for a bit and while talking with my niece it suddenly occurred to me that I was thinking of the BlockState json in totally the wrong way.

 

This is what I have now. and though I'm changing the model in the wrong directions it is working, and that's a simple fix.

 

[EDIT] had my left and right backwards

 

{
  "forge_marker": 1,
  "defaults": {
    "model": "titancraft:shelf_single_oak"
  },
  "variants": {
    "connections": {
      "1": {
        "model": "titancraft:shelf_right_oak"
      },
      "2": {
        "model": "titancraft:shelf_left_oak"
      },
      "3": {
        "model": "titancraft:shelf_center_oak"
      },
      "4": {
        "model": "titancraft:shelf_single_oak"
      }
    },
    "facing": {
      "north": {

      },
      "east": {
        "y": 90
      },
      "south": {
        "y": 180
      },
      "west": {
        "y": 270
      }
    }
  }
}

 

TitanCraft is coming... This will be updated with a link once available

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.