Jump to content

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


Recommended Posts

Posted

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 ]
	}
}
}

Posted

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.

Posted

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)

Posted

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/

Posted

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/

Posted

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

Posted

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/

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



×
×
  • Create New...

Important Information

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