Jump to content

Can't set custom Item or Block IDs? (1.7.2)


Eria8

Recommended Posts

I just noticed whenever I test my mod the console log tells me that all my item and block IDs are mismatched and the mod IDs all seem to come directly after Vanilla IDs:

 

[00:15:05] [server thread/INFO] [FML]: Found item id mismatch starlight:chaosSword : 4112 4188

[00:15:05] [server thread/INFO] [FML]: Found item id mismatch starlight:wall_white : 185 186

[00:15:05] [server thread/INFO] [FML]: Found item id mismatch starlight:ChaoticHelmet: 4177 4165

[00:15:05] [server thread/INFO] [FML]: Found item id mismatch starlight:meteorite : 4139 4127

 

...and it keeps going and going for over a hundred lines with every item/block.

 

 

This is all the coding for an example item to show what I assumed would set my IDs:

 

In the main class there's

 

public static Item chaosSword;

public final int chaosSwordID = 10020;

 

and

 

@EventHandler

public void preInit(FMLPreInitializationEvent event)

{

chaosSword = new com.starlight.weapons.chaosSword(chaosSwordID, ChaosSword).setUnlocalizedName("chaosSword").setTextureName("starlight:chaosSword");

GameRegistry.registerItem(chaosSword, "chaosSword");

}

 

 

And in the item's class

 

package com.starlight.weapons;

import net.minecraft.item.ItemSword;

public class chaosSword extends ItemSword

{

public chaosSword (int id, ToolMaterial ChaosSword)

{

super(ChaosSword);

this.setMaxStackSize(1);

                this.setCreativeTab(tabStarlightWeapons);

}

}

 

 

So can someone tell me what I'm doing wrong?

Link to comment
Share on other sites

Forget about IDs. You should need to worry about them anymore, as they are handled internally.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

public chaosSword (int id, ToolMaterial ChaosSword)
   {
      super(ChaosSword);
      this.setMaxStackSize(1);
                this.setCreativeTab(tabStarlightWeapons);
   }

"id" is totally unused in this constructor. Removing is advised.

Link to comment
Share on other sites

No, because you register the items with a string, so that's how minecraft now determins what item's should go where. So you shouldn't have to worry about that.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

IDs still technically exist, but they're now handled internally by Minecraft and are dynamically assigned per world (if you load a world, then add a mod and reload the world, that mods items won't exist (as far as I've seen and found for myself))

The further a society drifts from the truth, the more it hates those who speak it.

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

    • before I updated my pack I made for paintings++ mod, i noticed and saw that only modded paintings and vanilla ones move one block each time I re-enter my world! is there something wrong? what the hell is even going on? why is there a ghost living in my house?! the modded paintings even phase through blocks which is super weird!! help! here is my painting mod list: Paintings++ Dark paintings Macaw's paintings Joy of painting Immersive paintings My custom paintings++ resource pack
    • Error: java.lang.NullPointerException: Cannot invoke "me.codexadrian.tempad.TempadClientConfig.renderBlur()" because the return value of "me.codexadrian.tempad.TempadClient.getClientConfig()" is null I keep having this error while trying to launch a modpack through the forge modloader, any suggestions? https://docs.google.com/document/d/1CRKUoSiu2e_mDvDTVYpIA5wqD3w-BsCycxBu1_vQ4OA/edit?usp=sharing Crash Report ^^^^
    • I'm trying to start a server with the latest installer, but running the run.bat file doesn't generate new files. It shows the following in the cmd prompt.
    • One of my players is suddenly unable to join a locally hosted MC Eternal server. We have been playing on this server for about 2-3 weeks now. I have tried erasing his player files and his reputation file, and now it just coughs up this and kicks him out: [User Authenticator #5/INFO] [minecraft/NetHandlerLoginServer]: UUID of player EthosTheGod is 7692d8db-02c3-424f-a4ab-0e4e259b106b [20:25:36] [User Authenticator #4/INFO] [minecraft/NetHandlerLoginServer]: UUID of player EthosTheGod is 7692d8db-02c3-424f-a4ab-0e4e259b106b [20:29:35] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Did the system time change, or is the server overloaded? Running 575849ms behind, skipping 11516 tick(s) [20:29:35] [Server thread/INFO] [minecraft/NetHandlerLoginServer]: com.mojang.authlib.GameProfile@4a6c63f1[id=7692d8db-02c3-424f-a4ab-0e4e259b106b,name=EthosTheGod,properties={textures=[com.mojang.authlib.properties.Property@241ea89e]},legacy=false] (/IP.ADDRESS) lost connection: Disconnected [20:29:35] [Server thread/INFO] [minecraft/NetHandlerLoginServer]: com.mojang.authlib.GameProfile@6ab6c661[id=7692d8db-02c3-424f-a4ab-0e4e259b106b,name=EthosTheGod,properties={textures=[com.mojang.authlib.properties.Property@7f19aae3]},legacy=false] (/IP.ADDRESS) lost connection: Disconnected It just says "connection timed out" on his end. Any ideas?
    • I'm trying to migrate my mod from 1.20 to 1.21. Some packages in the forge api were changed so my mod did have some classes not working. I've changed everything i needed but still is getting me the following error error: cannot access Registry DeferredRegister.create(ForgeRegistries.BLOCKS, FarmMod.MOD_ID); ^ class file for net.minecraft.core.Registry not found The piece of code that is wrong is   public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, FarmMod.MOD_ID); And here are my imports   import com.lucas.farmmod.FarmMod; import com.lucas.farmmod.block.custom.BaseIrrigatorBlock; import com.lucas.farmmod.item.ModItems; import com.lucas.farmmod.item.custom.BaseIrrigatorBlockItem; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; The class DeferredRegister is throwing the error in the print below     I've tried running rebuilding my project in every way possible, tried refreshing my dependencies but nothing works. What can i do?
  • Topics

×
×
  • Create New...

Important Information

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