Jump to content

Recommended Posts

Posted

I'm trying to make some tools and armor for my mod but certain parts in the text get highlighted red, I've tried everything but I just don't know how to fix it. This is the only class with those kind of errors.

 

package com.mineralz.init;

import com.mineralz.Mineralz;
import com.mineralz.Reference;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class MineralzItems {

private static final String mineralz = null;

//Items
public static Item tin_ingot;
public static Item copper_ingot;
public static Item bronze_ingot;
public static Item silver_ingot;
public static Item platinum_ingot;
public static Item silver_nugget;
public static Item platinum_nugget;
public static Item ruby;
public static Item sapphire;
public static Item amethyst;
public static Item onyx;

// Tools
public static Item.ToolMaterial tin_pickaxe = EnumHelper.addToolMaterial("tin_pickaxe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial tin_shovel = EnumHelper.addToolMaterial("tin_shovel", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial tin_axe = EnumHelper.addToolMaterial("tin_axe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial tin_hoe = EnumHelper.addToolMaterial("tin_hoe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial copper_pickaxe = EnumHelper.addToolMaterial("copper_pickaxe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial copper_shovel = EnumHelper.addToolMaterial("copper_shovel", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial copper_axe = EnumHelper.addToolMaterial("copper_axe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial copper_hoe = EnumHelper.addToolMaterial("copper_hoe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial bronze_pickaxe = EnumHelper.addToolMaterial("bronze_pickaxe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial bronze_shovel = EnumHelper.addToolMaterial("bronze_shovel", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial bronze_axe = EnumHelper.addToolMaterial("bronze_axe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial bronze_hoe = EnumHelper.addToolMaterial("bronze_hoe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial silver_pickaxe = EnumHelper.addToolMaterial("silver_pickaxe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial silver_shovel = EnumHelper.addToolMaterial("silver_shovel", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial silver_axe = EnumHelper.addToolMaterial("silver_axe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial silver_hoe = EnumHelper.addToolMaterial("silver_hoe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial platinum_pickaxe = EnumHelper.addToolMaterial("platinum_pickaxe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial platinum_shovel = EnumHelper.addToolMaterial("platinum_shovel", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial platinum_axe = EnumHelper.addToolMaterial("platinum_axe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial platinum_hoe = EnumHelper.addToolMaterial("platinum_hoe", 2, 125, 2.0F, 2.0F, 30);

//Weapons
public static Item tin_sword;
public static Item copper_sword;
public static Item bronze_sword;
public static Item silver_sword;
public static Item platinum_sword;

//Armor

public static ArmorMaterial tin_helmet = EnumHelper.addArmorMaterial("tin_helmet", mineralz, 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial tin_chestplate = EnumHelper.addArmorMaterial("tin_chestplate", "mineralz", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial tin_leggings = EnumHelper.addArmorMaterial("tin_leggings", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial tin_boots = EnumHelper.addArmorMaterial("tin_boots", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial copper_helmet = EnumHelper.addArmorMaterial("copper_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial copper_chestplate = EnumHelper.addArmorMaterial("copper_chestplate", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial copper_leggings = EnumHelper.addArmorMaterial("copper_leggings", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial copper_boots = EnumHelper.addArmorMaterial("copper_boots", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial bronze_helmet = EnumHelper.addArmorMaterial("bronze_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial bronze_chestplate = EnumHelper.addArmorMaterial("bronze_chestplate", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial bronze_leggings = EnumHelper.addArmorMaterial("bronze_leggings", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial bronze_boots = EnumHelper.addArmorMaterial("bronze_boots", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial silver_helmet = EnumHelper.addArmorMaterial("silver_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial silver_chestplate = EnumHelper.addArmorMaterial("silver_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial silver_leggings = EnumHelper.addArmorMaterial("silver_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial silver_boots = EnumHelper.addArmorMaterial("silver_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial platinum_helmet = EnumHelper.addArmorMaterial("platinum_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial platinum_chestplate = EnumHelper.addArmorMaterial("platinum_chestplate", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial platinum_leggings = EnumHelper.addArmorMaterial("platinum_leggings", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial platinum_boots = EnumHelper.addArmorMaterial("platinum_boots", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);

public static void init() {

	//Items
	tin_ingot = new Item().setUnlocalizedName("tin_ingot").setCreativeTab(Mineralz.tabMineralz);
	copper_ingot = new Item().setUnlocalizedName("copper_ingot").setCreativeTab(Mineralz.tabMineralz);
	bronze_ingot = new Item().setUnlocalizedName("bronze_ingot").setCreativeTab(Mineralz.tabMineralz);
	silver_ingot = new Item().setUnlocalizedName("silver_ingot").setCreativeTab(Mineralz.tabMineralz);
	platinum_ingot = new Item().setUnlocalizedName("platinum_ingot").setCreativeTab(Mineralz.tabMineralz);
	silver_nugget = new Item().setUnlocalizedName("silver_nugget").setCreativeTab(Mineralz.tabMineralz);
	platinum_nugget = new Item().setUnlocalizedName("platinum_nugget").setCreativeTab(Mineralz.tabMineralz);
	ruby = new Item().setUnlocalizedName("ruby").setCreativeTab(Mineralz.tabMineralz);
	sapphire = new Item().setUnlocalizedName("sapphire").setCreativeTab(Mineralz.tabMineralz);
	amethyst = new Item().setUnlocalizedName("amethyst").setCreativeTab(Mineralz.tabMineralz);
	onyx = new Item().setUnlocalizedName("onyx").setCreativeTab(Mineralz.tabMineralz);

	//Tools
	tin_pickaxe = new Item().setUnlocalizedName("tin_Pickaxe").setCreativeTab(Mineralz.tabMineralz);
	tin_shovel = new Item().setUnlocalizedName("tin_shovel").setCreativeTab(Mineralz.tabMineralz);
	tin_axe = new Item().setUnlocalizedName("tin_axe").setCreativeTab(Mineralz.tabMineralz);
	tin_hoe = new Item().setUnlocalizedName("tin_hoe").setCreativeTab(Mineralz.tabMineralz);
	copper_pickaxe = new Item().setUnlocalizedName("copper_pickaxe").setCreativeTab(Mineralz.tabMineralz);
	copper_shovel = new Item().setUnlocalizedName("copper_shovel").setCreativeTab(Mineralz.tabMineralz);
	copper_axe = new Item().setUnlocalizedName("copper_axe").setCreativeTab(Mineralz.tabMineralz);
	copper_hoe = new Item().setUnlocalizedName("copper_hoe").setCreativeTab(Mineralz.tabMineralz);
	bronze_pickaxe = new Item().setUnlocalizedName("bronze_pickaxe").setCreativeTab(Mineralz.tabMineralz);
	bronze_shovel = new Item().setUnlocalizedName("bronze_shovel").setCreativeTab(Mineralz.tabMineralz);
	bronze_axe = new Item().setUnlocalizedName("bronze_axe").setCreativeTab(Mineralz.tabMineralz);
	bronze_hoe = new Item().setUnlocalizedName("bronze_hoe").setCreativeTab(Mineralz.tabMineralz);
	silver_pickaxe = new Item().setUnlocalizedName("silver_pickaxe").setCreativeTab(Mineralz.tabMineralz);
	silver_shovel = new Item().setUnlocalizedName("silver_shovel").setCreativeTab(Mineralz.tabMineralz);
	silver_axe = new Item().setUnlocalizedName("silver_axe").setCreativeTab(Mineralz.tabMineralz);
	silver_hoe = new Item().setUnlocalizedName("silver_hoe").setCreativeTab(Mineralz.tabMineralz);
	platinum_pickaxe = new Item().setUnlocalizedName("platinum_pickaxe").setCreativeTab(Mineralz.tabMineralz);
	platinum_shovel = new Item().setUnlocalizedName("platinum_shovel").setCreativeTab(Mineralz.tabMineralz);
	platinum_axe = new Item().setUnlocalizedName("platinum_axe").setCreativeTab(Mineralz.tabMineralz);
	platinum_hoe = new Item().setUnlocalizedName("platinum_hoe").setCreativeTab(Mineralz.tabMineralz);

	//Weapons
	tin_sword = new Item().setUnlocalizedName("tin_sword").setCreativeTab(Mineralz.tabMineralz);
	copper_sword = new Item().setUnlocalizedName("copper_sword").setCreativeTab(Mineralz.tabMineralz);
	bronze_sword = new Item().setUnlocalizedName("bronze_sword").setCreativeTab(Mineralz.tabMineralz);
	silver_sword = new Item().setUnlocalizedName("silver_sword").setCreativeTab(Mineralz.tabMineralz);
	platinum_sword = new Item().setUnlocalizedName("platinum_sword").setCreativeTab(Mineralz.tabMineralz);

	//Armor
	tin_helmet = new MineralzArmor(4, 6, true).setUnlocalizedName(null, tin_helmet, 1, 0).setUnlocalizedName("tin_helmet").setCreativeTab(Mineralz.tabMineralz);
	tin_chestplate = new MineralzArmor().setUnlocalizedName("tin_chestplate").setCreativeTab(Mineralz.tabMineralz);
	tin_leggings = new MineralzArmor().setUnlocalizedName("tin_leggings").setCreativeTab(Mineralz.tabMineralz);
	tin_boots = new MineralzArmor().setUnlocalizedName("tin_boots").setCreativeTab(Mineralz.tabMineralz);
	copper_helmet = new MineralzArmor().setUnlocalizedName("copper_helmet").setCreativeTab(Mineralz.tabMineralz);
	copper_chestplate = new MineralzArmor().setUnlocalizedName("copper_chestplate").setCreativeTab(Mineralz.tabMineralz);
	copper_leggings = new MineralzArmor().setUnlocalizedName("copper_leggings").setCreativeTab(Mineralz.tabMineralz);
	copper_boots = new MineralzArmor().setUnlocalizedName("copper_boots").setCreativeTab(Mineralz.tabMineralz);
	bronze_helmet = new MineralzArmor().setUnlocalizedName("bronze_helmet").setCreativeTab(Mineralz.tabMineralz);
	bronze_chestplate = new MineralzArmor().setUnlocalizedName("bronze_chestplate").setCreativeTab(Mineralz.tabMineralz);
	bronze_leggings = new MineralzArmor().setUnlocalizedName("bronze_leggings").setCreativeTab(Mineralz.tabMineralz);
	bronze_boots = new MineralzArmor().setUnlocalizedName("bronze_boots").setCreativeTab(Mineralz.tabMineralz);
	silver_helmet = new MineralzArmor().setUnlocalizedName("silver_helmet").setCreativeTab(Mineralz.tabMineralz);
	silver_chestplate = new MineralzArmor().setUnlocalizedName("silver_chestplate").setCreativeTab(Mineralz.tabMineralz);
	silver_leggings = new MineralzArmor().setUnlocalizedName("silver_leggings").setCreativeTab(Mineralz.tabMineralz);
	silver_boots = new MineralzArmor().setUnlocalizedName("silver_boots").setCreativeTab(Mineralz.tabMineralz);
	platinum_helmet = new MineralzArmor().setUnlocalizedName("platinum_helmet").setCreativeTab(Mineralz.tabMineralz);
	platinum_chestplate = new MineralzArmor().setUnlocalizedName("platinum_chestplate").setCreativeTab(Mineralz.tabMineralz);
	platinum_leggings = new MineralzArmor().setUnlocalizedName("platinum_leggings").setCreativeTab(Mineralz.tabMineralz);
	platinum_boots = new MineralzArmor().setUnlocalizedName("platinum_boots").setCreativeTab(Mineralz.tabMineralz);

}

public static void register() {
	registerItem(tin_ingot); 
	registerItem(copper_ingot);
	registerItem(bronze_ingot);
	registerItem(silver_ingot);
	registerItem(platinum_ingot);
	registerItem(silver_nugget);
	registerItem(platinum_nugget);
	registerItem(ruby);
	registerItem(sapphire);
	registerItem(amethyst);
	registerItem(onyx);
	registerItem(tin_helmet);
	registerItem(tin_chestplate);
	registerItem(tin_leggings);
	registerItem(tin_boots);
	registerItem(tin_sword);
	registerItem(tin_pickaxe);
	registerItem(tin_shovel);
	registerItem(tin_axe);
	registerItem(tin_hoe);
	registerItem(copper_helmet);
	registerItem(copper_chestplate);
	registerItem(copper_leggings);
	registerItem(copper_boots);
	registerItem(copper_sword);
	registerItem(copper_pickaxe);
	registerItem(copper_shovel);
	registerItem(copper_axe);
	registerItem(copper_hoe);
	registerItem(bronze_helmet);
	registerItem(bronze_chestplate);
	registerItem(bronze_leggings);
	registerItem(bronze_boots);
	registerItem(bronze_sword);
	registerItem(bronze_pickaxe);
	registerItem(bronze_shovel);
	registerItem(bronze_axe);
	registerItem(bronze_hoe);
	registerItem(silver_helmet);
	registerItem(silver_chestplate);
	registerItem(silver_leggings);
	registerItem(silver_boots);
	registerItem(silver_sword);
	registerItem(silver_pickaxe);
	registerItem(silver_shovel);
	registerItem(silver_axe);
	registerItem(silver_hoe);
	registerItem(platinum_helmet);
	registerItem(platinum_chestplate);
	registerItem(platinum_leggings);
	registerItem(platinum_boots);
	registerItem(platinum_sword);
	registerItem(platinum_pickaxe);
	registerItem(platinum_shovel);
	registerItem(platinum_axe);
	registerItem(platinum_hoe);
}

public static void registerRenders() {
	registerRender(tin_ingot); 
	registerRender(copper_ingot);
	registerRender(bronze_ingot);
	registerRender(silver_ingot);
	registerRender(platinum_ingot);
	registerRender(silver_nugget);
	registerRender(platinum_nugget);
	registerRender(ruby);
	registerRender(sapphire);
	registerRender(amethyst);
	registerRender(onyx);
	registerRender(tin_helmet);
	registerRender(tin_chestplate);
	registerRender(tin_leggings);
	registerRender(tin_boots);
	registerRender(tin_sword);
	registerRender(tin_pickaxe);
	registerRender(tin_shovel);
	registerRender(tin_axe);
	registerRender(tin_hoe);
	registerRender(copper_helmet);
	registerRender(copper_chestplate);
	registerRender(copper_leggings);
	registerRender(copper_boots);
	registerRender(copper_sword);
	registerRender(copper_pickaxe);
	registerRender(copper_shovel);
	registerRender(copper_axe);
	registerRender(copper_hoe);
	registerRender(bronze_helmet);
	registerRender(bronze_chestplate);
	registerRender(bronze_leggings);
	registerRender(bronze_boots);
	registerRender(bronze_sword);
	registerRender(bronze_pickaxe);
	registerRender(bronze_shovel);
	registerRender(bronze_axe);
	registerRender(bronze_hoe);
	registerRender(silver_helmet);
	registerRender(silver_chestplate);
	registerRender(silver_leggings);
	registerRender(silver_boots);
	registerRender(silver_sword);
	registerRender(silver_pickaxe);
	registerRender(silver_shovel);
	registerRender(silver_axe);
	registerRender(silver_hoe);
	registerRender(platinum_helmet);
	registerRender(platinum_chestplate);
	registerRender(platinum_leggings);
	registerRender(platinum_boots);
	registerRender(platinum_sword);
	registerRender(platinum_pickaxe);
	registerRender(platinum_shovel);
	registerRender(platinum_axe);
	registerRender(platinum_hoe); 
}

public static void registerItem(Item item) {
	GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));
	System.out.println("Registered Item: " + item.getUnlocalizedName().substring(5));
}

public static void registerRender(Item item) {
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}

}

Posted

  • Please don't spam the log files with useless information (nobody cares you successfully registered an item). And if you really must print these things use a logger with an appropriately set level (such as
    LogLevel.TRACE

    ).

 

I'm not trying to spam useless information, I'm posting this because I hope to find a solution for my problem.

I'm very new to this so it will take me a while to understand certain things. We all started somewhere didn't we?

 

But thank you for the information, I'll try to do something with it.

 

 

Posted

  • Please don't spam the log files with useless information (nobody cares you successfully registered an item). And if you really must print these things use a logger with an appropriately set level (such as
    LogLevel.TRACE

    ).

 

I'm not trying to spam useless information, I'm posting this because I hope to find a solution for my problem.

I'm very new to this so it will take me a while to understand certain things. We all started somewhere didn't we?

 

But thank you for the information, I'll try to do something with it.

 

Diesieben07 was talking about the logging in your code, not your post.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Reach Out To Rapid Digital: What sapp Info: +1 41 4 80 7 14 85 Email INFO: rap iddi gita lrecov ery @ exe cs. com Hello, my name is Jayson, and I’m 35 years old from the United Kingdom. My family and I recently endured an incredibly challenging experience that I wouldn’t wish on anyone. We became victims of a cryptocurrency investment fraud scheme that saw us lose a staggering $807,000 in USDT and Bitcoins. The fraudsters had created a convincing facade, and we were lured into investing, only to discover later that the platform was a complete scam. We were left devastated, not just financially, but emotionally, as we had trusted these people and believed in the legitimacy of the investment. After the initial shock wore off, we desperately searched for ways to recover the lost funds. It seemed like an impossible task, and we felt as though there was no hope. That’s when, by sheer luck, we stumbled across a post about Rapid Digital Recovery, a cryptocurrency and funds recovery organization with a proven track record in cybersecurity and fraud recovery. We decided to reach out to them, and from the first interaction, we were impressed with their professionalism and transparency. They explained the recovery process in detail and reassured us that they had the skills and expertise to track down the perpetrators and recover our funds. This gave us a renewed sense of hope, something we hadn’t felt in months. What truly stood out during our experience with Rapid Digital Recovery was their dedication to the recovery process. The team went above and beyond, using sophisticated tracking tools and cyber forensics to gather critical information. Within a matter of weeks, they had successfully located the funds and traced the scam back to the fraudsters responsible. They worked with the authorities to ensure the criminals were held accountable for their actions. To our relief, the team at Rapid Digital Recovery was able to recover every single penny we had lost. The funds were returned in full, and the sense of closure we felt was invaluable. We couldn’t have imagined such a positive outcome in the early stages of our recovery journey, and we are deeply grateful for the work they did. If you ever find yourself in a similar situation, I highly recommend contacting Rapid Digital Recovery. Their expertise, transparency, and dedication to their clients make them the go-to choice for anyone seeking to recover lost cryptocurrency or funds. They truly gave us back our financial future.  
    • This is my first time modding anything, so maybe just skill issue. I'm using Forge 54.0.12 and Temurin 21.0.5+11-LTS I wanted to create a custom keybind and to check whether it works I'd like to send a chat message. I tried using Minecraft.getInstance().player.sendSystemMessage(Component.literal("test")); but IntelliJ couldnt resolve sendSystemMessage(...). Since I saw people using it in earlier versions, I tried the same thing with 1.20.6(- 50.1.0), where it works fine, now I can't figure out if this is intentional and whether there are other options for sending chat messages. On that note, is there more documentation than https://docs.minecraftforge.net/en/1.21.x/? It seems very incomplete compared to something like the Oracle Java docs
    • Hi, i'm having this error and I wanna fix it. we try: -Reload drivers -Eliminate .minecraft -Eliminate Java -Restart launcher -Verify if minecraft is using gpu -Mods  in .minecraft is empty -Install the latest and recomended version of forge idk what i have to do, help me pls. the lastest log is: https://mclo.gs/WAMao8x  
    • Read the FAQ, Rule #2. (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/)  
    • The link to your log does not work, it says it is forbidden, Error, this is a private paste or is pending moderation.
  • Topics

×
×
  • Create New...

Important Information

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