Jump to content
  • Home
  • Files
  • Docs
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
  • [1.7]Naming Item
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
BladianYT

[1.7]Naming Item

By BladianYT, November 2, 2015 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

BladianYT    0

BladianYT

BladianYT    0

  • Tree Puncher
  • BladianYT
  • Members
  • 0
  • 2 posts
Posted November 2, 2015

I'm just started coding Forge after a couple years of coding Bukkit, and I just can't seem to get to name an item.

 

package com.bladianyt.basemod;

import com.bladianyt.basemod.item.GenericItem;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

@Mod(modid="basemod", name="Base", version="0.0.0")
public class Base {

    // The instance of your mod that Forge uses.
    @Instance("Base")
    public static Base instance;

    // Says where the client and server 'proxy' code is loaded.
    @SidedProxy(clientSide="com.bladianyt.basemod.ClientProxy", serverSide="com.bladianyt.basemod.CommonProxy")
    public static CommonProxy proxy;

    public static Item item1;
    public static Item genericIngot;

    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        item1 = new GenericItem();
        genericIngot = new GenericItem().setMaxStackSize(16).setCreativeTab(CreativeTabs.tabMisc).setUnlocalizedName("genericIngot");
        GameRegistry.registerItem(item1, "item1");
        GameRegistry.registerItem(genericIngot, "genericIngot");
        // Stub Method
    }

    @EventHandler
    public void load(FMLInitializationEvent event) {
        proxy.registerRenderers();
    }

    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
        // Stub Method
    }

}

 

item.genericItem.name=Generic Item
item.genericIngot.name=Generic Ingot

 

bHZvjRV.png

 

Any help? Probably an idiotic mistake but I just can't seem to find it.

 

Also:

 

package com.bladianyt.basemod;

/**
* Created by maxmigliorini on 28/10/15.
*/
public class ClientProxy extends CommonProxy{

    @Override
    public void registerRenderers() {

    }
}

 

package com.bladianyt.basemod;

/**
* Created by maxmigliorini on 28/10/15.
*/
public class CommonProxy {

    // Client stuff
    public void registerRenderers() {
        // Nothing here as the server doesn't render graphics or entities!
    }
}

 

package com.bladianyt.basemod.item;


import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

/**
* Created by maxmigliorini on 28/10/15.
*/
public class GenericItem extends Item {

    public GenericItem() {
        setMaxStackSize(64);
        setCreativeTab(CreativeTabs.tabMisc);
        setUnlocalizedName("genericItem");
    }

}


  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7697

diesieben07

diesieben07    7697

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7697
  • 56414 posts
Posted November 2, 2015

Apart from the fact that you should include your modID in your unlocalized name: Assets don't work out of the box when using IntelliJ, see here.

  • Quote

Share this post


Link to post
Share on other sites

SCAREX    2

SCAREX

SCAREX    2

  • Tree Puncher
  • SCAREX
  • Members
  • 2
  • 28 posts
Posted November 2, 2015

Your instance annotation should have the modid inside, not the name

  • 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

    • ThisIsNotOriginal
      When I try to run my mod after I just added Deferred Registries it crashes

      By ThisIsNotOriginal · Posted 2 minutes ago

      i have a repo ready but do i need to show my assets files as well?
    • Extrupt
      Forge won't fully download

      By Extrupt · Posted 8 minutes ago

      im using version 16.5 forge and minecraft btw
    • troublemaker_47
      Teleport player in same direction as where he looks

      By troublemaker_47 · Posted 15 minutes ago

      Could you rewrite the function please because i am fairly new and i really wanted to add this functionality to my mod. the part that is the most confusing to me is the part where you told me to scale the lookvec, because i dont know if this is a special procedure or if i just need to multiply the look vector. Thanks in advance
    • Extrupt
      Forge won't fully download

      By Extrupt · Posted 17 minutes ago

      i tried to download forge but every time i got the same message after a few seconds of downloading Failed to run processor: java.io.FileNotFoundException:C:\Users\mande\AppData\Roaming\.minecraft\libraries\de\oceanlabs\mcp\mcp_config\1.16.5-20210115.111550\mcp_config-1.16.5-20210115.111550-mappings.txt (Access is denied) See log for more details. i tried to look up what i could do but no one else had the problem. Could someone please help me with this. thanks-  
    • GenElectrovise
      When I try to run my mod after I just added Deferred Registries it crashes

      By GenElectrovise · Posted 19 minutes ago

      All of it. If you don't have a repo, please make one. Everything will be easier.
  • Topics

    • ThisIsNotOriginal
      15
      When I try to run my mod after I just added Deferred Registries it crashes

      By ThisIsNotOriginal
      Started 15 hours ago

    • Extrupt
      1
      Forge won't fully download

      By Extrupt
      Started 17 minutes ago

    • troublemaker_47
      6
      Teleport player in same direction as where he looks

      By troublemaker_47
      Started 1 hour ago

    • SwiftNinjaPro
      0
      Bug report: files.minecraftforge.net ssl

      By SwiftNinjaPro
      Started 20 minutes ago

    • Retsal
      6
      [1.16.x] Custom block as a shop

      By Retsal
      Started Yesterday at 01:04 PM

  • Who's Online (See full list)

    • Gorp5
    • RaySanketsu
    • J_F1Nl3Y_
    • GenElectrovise
    • 3.1459
    • diesieben07
    • Extrupt
    • ThisIsNotOriginal
    • arna
    • WindRunner7
    • troublemaker_47
    • CAS_ual_TY
    • Tessa
    • SwiftNinjaPro
    • thepumpkinbg
    • llllllll
    • brok4d
    • Spacerulerwill
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.7]Naming Item
  • Theme

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