Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Block With Given ID Does Not Exist - Minecraft Mod
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
xtremegamer

Block With Given ID Does Not Exist - Minecraft Mod

By xtremegamer, October 17, 2013 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

xtremegamer    0

xtremegamer

xtremegamer    0

  • Tree Puncher
  • xtremegamer
  • Members
  • 0
  • 2 posts
Posted October 17, 2013

I have tried to make my own Minecraft Block using Forge, but for some reason, when I use /give Playerxxx 1000 1 the game says, There is no block with id '1000'

 

My Block Code:

 

package net.minecraft.blockr;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;

public class Basalt extends Block
{
    public Basalt(int par1, Material par2Material)
    {
        super(par1, par2Material);
        this.setCreativeTab(CreativeTabs.tabBlock);
    }

}

 

Mod code:

 

package net.minecraft.blockr;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;


@Mod(modid="blockr", name="Blockr Mod", version="PreAlpha v0.0.1")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class BlockrMod
{
    public static Block basalt;

    @Init
    public void load() 
    {
        basalt = new Basalt(1000, Material.ground).setUnlocalizedName("basalt");

        GameRegistry.registerBlock(basalt, basalt.getUnlocalizedName());
        LanguageRegistry.addName(basalt, "Basalt Block");
    }

    public String getVersion()
    {
        return "0.0.1";
    }
}

 

What exactly is going wrong? My package is blockr (as my mod is called blockr)

 

I know my mod was loaded as I see in Forge under Mods I see my mod

  • Quote

Share this post


Link to post
Share on other sites

ItsTheRuski    2

ItsTheRuski

ItsTheRuski    2

  • Stone Miner
  • ItsTheRuski
  • Members
  • 2
  • 55 posts
Posted October 17, 2013

Hello,

 

Don't use @Init because it as been deprecated, meaning that there is a better version of it now.

 

1.

Instead of

@Init

 

Substitute it with

@EventHandler

 

2.

Since you are now using the an EventHandler, you have to give your 'load' method a loading event. Generally, for initializing your blocks, items, and such you want to use a PreIntializationEvent, so ...

 

Replace

public void load() 

 

With

public void load(FMLPreInitializationEvent event)

 

The rest of the code can remain the same. You can use this parameter later for other purposes, but for now, this allows Forge to initialize your blocks at the proper time.

 

Hope this helps. =)

 

  • Quote

Share this post


Link to post
Share on other sites

xtremegamer    0

xtremegamer

xtremegamer    0

  • Tree Puncher
  • xtremegamer
  • Members
  • 0
  • 2 posts
Posted October 17, 2013

It works now. Just a little code tweek and all is well

 

Thanks

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • DragonITA
      [1.14.4]What are API/Library and how to make a custom/own API/Library?

      By DragonITA · Posted 10 minutes ago

      Hi, a exemple: i just installed Tabula and i see, that i should install a Library or a API, iChunc or something else, else the mod wont work. Question: What is a Library/API and how to make a own?
    • Kangoro
      Mc Forge 1.14.4

      By Kangoro · Posted 31 minutes ago

      Where do I find it? and i copy paste here or in other web and link here?
    • thedarkcolour
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour · Posted 43 minutes ago

      Now it just freezes with no error at all.
    • thedarkcolour
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour · Posted 44 minutes ago

      I just realized what I've done. I forgot to make the BeeNestGenerator method static. I'll check if that fixes it.
    • thedarkcolour
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour · Posted 48 minutes ago

      BeeNestGenerator class
  • Topics

    • DragonITA
      0
      [1.14.4]What are API/Library and how to make a custom/own API/Library?

      By DragonITA
      Started 10 minutes ago

    • Kangoro
      4
      Mc Forge 1.14.4

      By Kangoro
      Started Yesterday at 05:17 PM

    • thedarkcolour
      13
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour
      Started 11 hours ago

    • Pixelboss4d
      2
      1.89 crash forge

      By Pixelboss4d
      Started 2 hours ago

    • Junior240
      4
      I'm having trouble with Java on !MAC!

      By Junior240
      Started November 9

  • Who's Online (See full list)

    • Choco
    • Kangoro
    • tomatoBhutan
    • plugsmustard
    • LexManos
    • Simon_kungen
    • DragonITA
    • loordgek
    • Ryagal
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Block With Given ID Does Not Exist - Minecraft Mod
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community