Jump to content

Why does Minecraft crash when I add this line of code?


Seroe

Recommended Posts

Whenever I add this line of code:

 

 

ItemStack hilt = new ItemStack(SeroeMod.hiltBlueLightsaber);

 

 

Minecraft won't start.

 

Here is the link to the error: http://pastebin.com/EgxhkeHd

 

Here is the link to my main class: http://pastebin.com/3xbeLpQ5

 

Here is a link to my hiltBlueLightsaber class: http://pastebin.com/YaCwndfC

 

Here is a link to my BlueLightsaber class, where I have the "ItemStack hilt = new ItemStack(SeroeMod.hiltBlueLightsaber);" code: http://pastebin.com/5CDC8v1B

 

Also, in my BlueLightsaber class, why doesn't this code work:

@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
  par3World.playSoundAtEntity(par2EntityPlayer, "seroemod:swing", 500.0F, 1.0F);
  return true;
}

 

 

My intention is to play a sound every time the user left-clicks.

 

Thanks in advance

Link to comment
Share on other sites

Okay, I fixed that. I also want to add durability to my item, so I extended ItemSword. When you have 2 open lightsabers in your inventory, damage applies to both of them. How might one fix that? Also, the lightsaber now will not close when it has damage.

 

 

Also follow this link to see the update of my situation: http://www.minecraftforum.net/topic/2045112-why-does-minecraft-crash-when-i-add-this-line-of-code/

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



×
×
  • Create New...

Important Information

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