Jump to content

[1.14.4]block rendering issue


DarkAssassin

Recommended Posts

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"
}


    
    
    
    
    

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.