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

the BlockItem is rendering but for some reason the Block when placed is not

 

lists:

public class BlockList {
    public static Block tutorial_block;
}
public class ItemList {
    public static  Item tutorial_item;
    public static  Item tutorial_block;

}

setup:

private void setup(final FMLCommonSetupEvent event) {
        
        logger.info("setup registered");
        
    }
    private void clientRegistries(final FMLClientSetupEvent event) {
        
        logger.info("client registered");
        
    }
    
    @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
    public static class RegistryEvents{
        
        
        @SubscribeEvent
        public static void registerBlocks(final RegistryEvent.Register<Block> event) {
            event.getRegistry().registerAll(
                    
                     
            BlockList.tutorial_block = new Block(Block.Properties.create(Material.WOOD).hardnessAndResistance(2.0f, 2.0f).sound(SoundType.WOOD)).setRegistryName(location("tutorial_block"))
            
        );
            logger.info("Blocks registered");
        }

        @SubscribeEvent
        public static void registerItems(final RegistryEvent.Register<Item> event) {
            event.getRegistry().registerAll(
   ItemList.tutorial_item = new Item(new Item.Properties().group(ItemGroup.TRANSPORTATION)).setRegistryName(location("tutorial_item")),
            ItemList.tutorial_block = new BlockItem(BlockList.tutorial_block, new Item.Properties().group(ItemGroup.TRANSPORTATION)).setRegistryName(BlockList.tutorial_block.getRegistryName())
);
            logger.info("items registered");
        }
            }
    
    private static ResourceLocation location(String name) {
        return new ResourceLocation(modid, name);
    }
    

 

blockstate:

      {
    "variants": {
        "axis=y":  { "model": "sakuraforest:block/tutorial_block" },
        "axis=z":   { "model": "sakuraforest:block/tutorial_block", "x": 90 },
        "axis=x":   { "model": "sakuraforest:block/tutorial_block", "x": 90, "y": 90 }
    }
}
   

models:
     block:

 {
    "parent": "block/cube_column",
    "textures": {
        "end": "sakuraforest:block/tutorial_block_top",
        "side": "sakuraforest:block/tutorial_block"
    }
}  

     Item

 {
    "parent": "sakuraforest:block/tutorial_block"
}


    
    
    
    
    

 

 

It's a block state issue. You're using Block, but it doesn't have the axis state that's needed for the variants. Use RotatedPillarBlock instead.

In the future, please post your logs when something's not working to make it easier to find the issue.

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

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.