Jump to content

Recommended Posts

Posted

Hi guys, check this for mistakes.

 

BlockClass:

public class CraftClass extends Block {
    public CraftClass() {
        super(Material.IRON);
        this.setUnlocalizedName("Craft");
        this.setRegistryName("Craft");
        this.setCreativeTab(CreativeTabs.REDSTONE);
    }

    @Override
    public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {

        BlockPos bp = new BlockPos(pos.getX(), pos.getY() + 1, pos.getZ());
        Block b = world.getBlockState(bp).getBlock();
        if(b == Blocks.DRAGON_EGG)
        {
            playerIn.addExperience(131231);
        }
        return super.onBlockActivated(world, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ);
    }

mainClass:

@Mod(modid = settings.MODID, version = settings.VERSION, name = settings.NAME)
public class multistructs {

    public Main instance = new Main();


    public static Block craft = new CraftClass();
    @EventHandler
    public void init(FMLInitializationEvent event)
    {

    }
    @EventHandler
    public void preinit(FMLPreInitializationEvent event)
    {
        GameRegistry.register(craft);
    }
    @EventHandler
    public void postinit(FMLPostInitializationEvent event)
    {

    }
}

 

Why when i start game i saw no my block in RedstoneTab?

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.