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

Hello! I am trying to make a custom block that is smaller then a normal block, it's supposed to be 13px high instead of 16px, and it kinda works.

I am able to make the side of the blocks stop rendering at 13px, but then the top of the block goes all black, and when I stand on it the sky turns black as well??? Oh and I have changed the hitbox so that it's 0.8f instead of 1.0f in the code.

 

Here is the .json code that i'm using:

 

The parent json:

  {

      "textures": {

            "particle": "#all"

      },

      "elements": [

            {

                "from": [0, 0, 0],

                "to": [16, 13, 16],

                "faces": {

                      "down": {"uv": [0, 0, 16, 13], "texture": "#all"},

                      "up": {"uv": [0, 0, 16, 13], "texture": "#all"},

                      "north": {"uv": [0, 0, 16, 13], "texture": "#all"},

                      "south": {"uv": [0, 0, 16, 13], "texture": "#all"},

                      "west": {"uv": [0, 0, 16, 13], "texture": "#all"},

                      "east": {"uv": [0, 0, 16, 13], "texture": "#all"}

                }

            }

      ]

  }

 

the block json:

  {

        "parent": "mymodid:block/parentjson",

        "textures": {

            "all": "mymodid:blocks/myblock"

        }

  }

 

Can anyone tell what the h i'm doing wrong? :(

hi

 

Have you overridden Block.isOpaqueCube and .isFullCube?

 

  // used by the renderer to control lighting and visibility of other blocks.
  // set to false because this block doesn't fill the entire 1x1x1 space
  @Override
  public boolean isOpaqueCube() {
    return false;
  }

  // used by the renderer to control lighting and visibility of other blocks, also by
  // (eg) wall or fence to control whether the fence joins itself to this block
  // set to false because this block doesn't fill the entire 1x1x1 space
  @Override
  public boolean isFullCube() {
    return false;
  }

 

-TGG

 

  • Author

hi

 

Have you overridden Block.isOpaqueCube and .isOpaqueCube?

 

  // used by the renderer to control lighting and visibility of other blocks.
  // set to false because this block doesn't fill the entire 1x1x1 space
  @Override
  public boolean isOpaqueCube() {
    return false;
  }

  // used by the renderer to control lighting and visibility of other blocks, also by
  // (eg) wall or fence to control whether the fence joins itself to this block
  // set to false because this block doesn't fill the entire 1x1x1 space
  @Override
  public boolean isFullCube() {
    return false;
  }

 

-TGG

 

No I didn't override the isOpaqueCube method, but I did override the isFullCube, thank you!

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.