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

Hi, I have problem with loading texture for my custom block. Console keep saying : Using missing texture, unable to load... and I cant solve it. I think i have textures in right folder but they still dont work. What is strange is that my language file works.

Here is BlockrockBrick.java:

 

package com.alven4;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.*;

 

public class BlockrockBrick extends Block {

public BlockrockBrick(Material rock) {

super(Material.rock);

setBlockName("rockBrick");

setBlockTextureName(MOD.MODID+":"+"rockBrick");

setCreativeTab(CreativeTabs.tabBlock);

// TODO Auto-generated constructor stub

}}

 

My folder system looks:

 

src/main/

            java

                  com/alven4

                              MOD.java

                              BlockrockBrick.java

           

            resources/assets/MOD

                                          lang/en_US.lang

                                          textures/blocks/rockBrick.png

 

And here my main code:

 

package com.alven4;

 

import java.io.File;

 

import net.minecraft.block.Block;

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.registry.GameRegistry;

 

@Mod(modid = MOD.MODID, version = MOD.VERSION)

public class MOD

{

    public static final String MODID = "MOD";

    public static final String VERSION = "4.0";

   

    public static Block rockBrick;

   

 

@EventHandler

    public void preinit(FMLPreInitializationEvent event)

    {

    rockBrick  = new BlockrockBrick(null);

   

    GameRegistry.registerBlock(rockBrick, "rockBrick");

   

    ItemStack starStack = new ItemStack(Items.nether_star);

GameRegistry.addRecipe(new ItemStack(Blocks.command_block,1), new Object[]{"121","212","121",

'1',starStack,'2',new ItemStack(Blocks.bedrock)});

 

GameRegistry.addShapelessRecipe(new ItemStack(Items.iron_ingot,1), new Object[]{

new ItemStack(Blocks.rail),new ItemStack(Blocks.rail),new ItemStack(Blocks.rail),new ItemStack(Blocks.rail)

});

 

GameRegistry.addSmelting(Blocks.diamond_block, new ItemStack(Blocks.lava), (float) 0.001);

GameRegistry.addRecipe(new ItemStack(Blocks.bedrock), new Object[]{

"LLL","LLL","LLL",'L',new ItemStack(Blocks.lava)

});

    }

    @EventHandler

    public void init(FMLInitializationEvent event)

    {

// some example code

        System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());

    }

}

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.