Jump to content

How to name the latest item of forge【1.12.2】


liangmi

Recommended Posts

Today I am learning how to create an item in forge

But I have some small problems when naming item

His name has always been

item.ITEM_ Name (set with settranslationkey (name).Name)

Like my Genshin_ stone

Then his name is item.genshin_ stone.name

There is no problem with the texture

//itemBase class
public class ItemBase extends Item implements IHasModel {
    private Item item = new Item();
    public ItemBase(String name, CreativeTabs tab, int maxStackSize){
        //setUnlocalizedName(name);
//        this.setTranslationKey(name);
        this.setMaxStackSize(maxStackSize);
        this.setTranslationKey(name);
        this.setRegistryName(name);
        this.setCreativeTab(tab);
        ModItems.ITEMS.add(this);
    };
    @Override
    public void registerModels(){
        cn.lmfans.genshin.genshin.proxy.ClientProxy.registerItemRenderer(this, 0, "inventory");
//        genshin.CommonProxy.registerItemRenderer(this, 0, "inventory");
    }

}
//ModItems class
public class ModItems {
    public static final List<Item> ITEMS = new ArrayList<Item>();

    public static final Item GENSHIN_STONE = new ItemBase("genshin_stone", CreativeTabs.MATERIALS,160);
//    public static final Item genshinStone = new Item();
}

Please teach me how to solve this problem. He has stuck me for several days

Solutions used:

Try en_us.json

Try en_US.json

Try en_US.lang

Try another language.Lang

Try another language.Json

Try adding pack.mcmeta

Try using setunlicalizedname (although not found)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Whenever I try to create an world my game crashes. I´ve tried to figure it out myself but wasnt able to do it.   Here are the logs
    • So I have this weird bug in this modpack I've been making where water won't place in the overworld as if it's the nether. Water still generates naturally, but once you pick it up with a bucket and try to place it it sizzles out. Everything else functions as normal. I'll include a forced crash report for a mod list and a debug log. Not sure what's happening here. I'm using forge-40.2.7 on minecraft 1.18.2. Crash Report - https://pastebin.com/xGQKHiPA Debug Log - https://gist.github.com/wonkers27/0fa05bdcd7347ffbf1cf8d36be4e7f25    
    • My minecraft server with forge 1.20.1 doesnt want to start. It generates everything correctly, but then after generating the world gets stuck on this: [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/util/AbortableIterationConsumer$Continuation [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/server/ServerScoreboard$Method [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting com/almostreliable/lootjs/loot/results/Icon [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/world/level/border/BorderStatus [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting blusunrize/immersiveengineering/common/items/RevolverItem$RevolverPerk > Canary Cached BlockState Flags are disabled! [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/util/profiling/metrics/MetricCategory [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/world/entity/HumanoidArm [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting software/bernie/geckolib/core/object/PlayState [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting mods/railcraft/api/carts/Side [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraftforge/event/entity/living/LivingChangeTargetEvent$LivingTargetType [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/world/level/ClipContext$Block [17:30:45] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/world/phys/HitResult$Type [17:30:46] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/world/level/gameevent/GameEventListener$DeliveryMode [17:30:47] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/world/level/chunk/LevelChunk$EntityCreationType [17:30:47] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/world/entity/animal/horse/Markings [17:30:51] [Server thread/INFO] [co.te.re.Redirector/]: Redirecting net/minecraft/world/entity/RelativeMovement   and stays like that forever, help would be appreciated.
    • https://gist.github.com/it-is-allie/dca4f60822965496bbe9877088415663 im new to all this sorry haha I think that's what you wanted?  
  • Topics

×
×
  • Create New...

Important Information

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