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
{
  "variants": {
    "normal": { "model": "examplemod:exampleblock" },
    "facing=up": { "model": "examplemod:exampleblock" },
    "facing=east": { "model": "examplemod:exampleblock" },
    "facing=south": { "model": "examplemod:exampleblock", "y": 90 },
    "facing=west": { "model": "examplemod:exampleblock", "y": 180 },
    "facing=north": { "model": "examplemod:exampleblock", "y": 270 }
  }
}

This is a blockstate.

 

{
  "textures": {
    "cbf": "examplemod:blocks/exampleblock"
  },
  "elements": [
    {
      "from": [0, 0, 0],
      "to": [16, 2, 16],
      "faces": {
        "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#cbf" },
        "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#cbf" },
        "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#cbf" },
        "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#cbf" },
        "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#cbf" },
        "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#cbf" }
      }
    }
  ]
}

This is a simple model.

 

{
  "textures": {
    "cbf": "examplemod:blocks/exampleblock"
  },
  "elements": [
    {
      "from": [0, 0, 0],
      "to": [2, 16, 16],
      "faces": {
        "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#cbf" },
        "up": { "uv": [ 16, 0, 0, 16 ], "texture": "#cbf" },
        "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#cbf" },
        "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#cbf" },
        "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#cbf" },
        "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#cbf" }
      }
    }
  ]
}

This is the model to be applied when the object is on the wall.

The model should be on the surface (like a vine or a torch), but in the end it is always the same. Why?

Edited by KitKit

show the block class, and the facing "normal" dosen't exist, there are only up, down, north, south, east, west

Edited by Luis_ST

  • Author
3 minutes ago, Luis_ST said:

show the block class, and the facing "normal" dosen't exist, there are only up, down, north, south, east, west

If I remove "normal" from my blockstate, an exception is thrown that the "normal" variant was not found

  • Author
6 minutes ago, Luis_ST said:

show the block class, and the facing "normal" dosen't exist, there are only up, down, north, south, east, west

package com.example.examplemod.objects;

import com.example.examplemod.init.BlockInit;
import com.example.examplemod.init.ItemInit;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemBlock;

public class BaseBlock extends Block
{
    public BaseBlock(String name, Material material, float hardness, String toolClass, int harvestLevel, SoundType soundType, CreativeTabs creativeTab)
    {
        super(material);
        setRegistryName(name);
        setUnlocalizedName(name);
        setHardness(hardness);
        setHarvestLevel(toolClass, harvestLevel);
        setSoundType(soundType);
        setCreativeTab(creativeTab);

        BlockInit.BLOCKS.add(this);
        ItemInit.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName()));
    }
}

I think there are no problems in the block class, because ordinary blocks were successfully created using it.

1.12 is no longer supported on this forum.
Please update to a modern version of Minecraft to receive support.

  • Author
Just now, Luis_ST said:

1.12 is no longer supported on this forum.
Please update to a modern version of Minecraft to receive support.

What solution would be for the latest version then? It doesn't work on other versions either.

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.