Jump to content

[1.8.9](SOLVED)Null error but i cant fix it ..:3


terraya

Recommended Posts

Hello Dear Forum,

 

i keep studying java, but only through minecraft coding, its kind of funny to learn it like this :) ,

 

well, since this forum was everytime very helpfull, i have a next problem :/ ,

 

--- ERROR LOG  ---

---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.

Time: 10.10.16 22:17
Description: Initializing game

java.lang.IllegalArgumentException: The name blockupdate:null has been registered twice, for net.minecraft.item.ItemBlock@7731504 and Items.TestSkill@1d1a706.
at net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:456)
at net.minecraftforge.fml.common.registry.GameData.registerItem(GameData.java:120)
at net.minecraftforge.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:152)
at ArturFarid.BlockUpdate.init.ItemsUpdate.register(ItemsUpdate.java:574)
at ArturFarid.BlockUpdate.BlocksUpdate.preInit(BlocksUpdate.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:556)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:451)
at net.minecraft.client.Minecraft.run(Minecraft.java:360)
at net.minecraft.client.main.Main.main(Main.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)

 

emm well , my "Skill Class" :

 

package Items;

import java.util.List;

import ArturFarid.BlockUpdate.Util.ElementalConfig;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class TestSkill extends ItemSword {

public TestSkill(Item.ToolMaterial m, String name) {
	super(m);
	setRegistryName(name);
}

public boolean onLeftClickEntity(ItemStack par1, EntityPlayer par2, Entity par3) {
	if (!par2.getEntityWorld().isRemote) {
		par3.setFire(ElementalConfig.swordAbilitiesControlledByExp ? par2.experienceLevel / 5 + 5 : 20);
	}
	return false;
}

@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1, EntityPlayer par2, List par3, boolean par4) {
	par3.add(EnumChatFormatting.RED + "BURN" + "!");
}
}

 

The Small stuff:

 

public static Item.ToolMaterial fire = EnumHelper.addToolMaterial("Fire", 10, 2000, 10.0F, 4.0F, 2);
public static TestSkill fireskill;
fireskill = new TestSkill (fire, "test");
GameRegistry.registerItem(fireskill, fireskill.getUnlocalizedName().substring(5)); //Here is the Error, if i set this as "comment" the game starts witouth problem
registerRender(fireskill);

 

and well the json is a normal test one:

 

{
"parent": "builtin/generated",
"textures": {
	"layer0": "blockupdate:item/fireskill"
},
"display": {
	"thirdperson": {
		"rotation": [ -90, 0, 0 ],
		"translation": [ 0, 1, -3 ],
		"scale": [ 0.55, 0.55, 0.55 ]
	},
	"firstperson": {
		"rotation": [ 0, -135, 25 ],
		"translation": [ 0, 4, 2 ],
		"scale": [ 1.7, 1.7, 1.7 ]
	}
}
}

Link to comment
Share on other sites

Just so you know, the method GameRegistry.registerItem(Item item, String name), if you look at the GameRegistry.class, tells you strait up that in your item class, you are setting the registry name, yet you reset it again when you use that particular method. Just use GameRegistry.registerItem(Item item). that should work just fine, so in your case GameRegistry.registerItem(fireskill); You were just registering the name twice, so forge through the error.

Link to comment
Share on other sites

ok after fixing this,

 

now he tryed to register my "Item" as a block O.o? why is that

 

---- Minecraft Crash Report ----
// I let you down. Sorry 

Time: 11.10.16 13:56
Description: Initializing game

java.lang.IllegalArgumentException: Attempted to register a block with no name: Items.TestSkill@1d1a706
at net.minecraftforge.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:150)
at net.minecraftforge.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:137)
at ArturFarid.BlockUpdate.init.ItemsUpdate.register(ItemsUpdate.java:573)
at ArturFarid.BlockUpdate.BlocksUpdate.preInit(BlocksUpdate.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:556)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:451)
at net.minecraft.client.Minecraft.run(Minecraft.java:360)
at net.minecraft.client.main.Main.main(Main.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)

Link to comment
Share on other sites

It thinks your item is an 'ItemBlock' for some reason, I believe. Try setting the unlocalized name to something other than 'test'.

 

and don't do this: fireskill.getUnlocalizedName().substring(5))

 

Just change that to 'fireskill' and change the 'test' up above to 'fireskill' too.

Have a modding question? PM me and hopefully I'll be able to help. Good at 2d Pixel Art? We need your help!  http://www.minecraftforum.net/topic/1806355-looking-for-2d-pixel-artist/

Link to comment
Share on other sites

Don't use

getUnlocalizedName()

for registering the block, either use the registry name (

getRegistryName()

, or a custom name.

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

Don't use

getUnlocalizedName()

for registering the block, either use the registry name (

getRegistryName()

, or a custom name.

 

its not a block, its a Item :3

Derp...

 

Even though, you should still change over to the registry name.

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

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

    • https://pastebin.com/VwpAW6PX My game crashes upon launch when trying to implement the Oculus mod to this mod compilation, above is the crash report, I do not know where to begin to attempt to fix this issue and require assistance.
    • https://youtube.com/shorts/gqLTSMymgUg?si=5QOeSvA4TTs-bL46
    • CubeHaven is a SMP server with unique features that can't be found on the majority of other servers! Java: MC.CUBEHAVEN.NET Bedrock: MC.CUBEHAVEN.NET:19132 3 different stores: - CubeHaven Store: Our store to purchase using real money. - Bitcoin Store: Store for Bitcoin. Bitcoin can be earned from playing the server. Giving options for players if they want to spend real money or grind to obtain exclusive packages. - Black Market: A hidden store for trading that operates outside our traditional stores, like custom enchantments, exclusive items and more. Some of our features include: Rank Up: Progress through different ranks to unlock new privileges and perks. 📈 Skills: RPG-style skill system that enhances your gaming experience! 🎮 Leaderboards: Compete and shine! Top players are rewarded weekly! 🏆 Random Teleporter: Travel instantly across different worlds with a click! 🌐 Custom World Generation: Beautifully generated world. 🌍 Dungeons: Explore challenging and rewarding dungeons filled with treasures and monsters. 🏰 Kits: Unlock ranks and gain access to various kits. 🛠️ Fishing Tournament: Compete in a friendly fishing tournament! 🎣 Chat Games: Enjoy games right within the chat! 🎲 Minions: Get some help from your loyal minions. 👥 Piñata Party: Enjoy a festive party with Piñatas! 🎉 Quests: Over 1000 quests that you can complete! 📜 Bounty Hunter: Set a bounty on a player's head. 💰 Tags: Displayed on nametags, in the tab list, and in chat. 🏷️ Coinflip: Bet with other players on coin toss outcomes, victory, or defeat! 🟢 Invisible & Glowing Frames: Hide your frames for a cleaner look or apply a glow to it for a beautiful look. 🔲✨[ Player Warp: Set your own warp points for other players to teleport to. 🌟 Display Shop: Create your own shop and sell to other players! 🛒 Item Skins: Customize your items with unique skins. 🎨 Pets: Your cute loyal companion to follow you wherever you go! 🐾 Cosmetics: Enhance the look of your character with beautiful cosmetics! 💄 XP-Bottle: Store your exp safely in a bottle for later use! 🍶 Chest & Inventory Sorting: Keep your items neatly sorted in your inventory or chest! 📦 Glowing: Stand out from other players with a colorful glow! ✨ Player Particles: Over 100 unique particle effects to show off. 🎇 Portable Inventories: Over virtual inventories with ease. 🧳 And a lot more! Become part of our growing community today! Discord: https://cubehaven.net/discord Java: MC.CUBEHAVEN.NET Bedrock: MC.CUBEHAVEN.NET:19132
    • # Problematic frame: # C [libopenal.so+0x9fb4d] It is always the same issue - this refers to the Linux OS - so your system may prevent Java from working   I am not familiar with Linux - check for similar/related issues  
  • Topics

×
×
  • Create New...

Important Information

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