Jump to content

Recommended Posts

Posted (edited)

Hi everyone, I started new mod, but got a problem:

Crash-report:

  Reveal hidden contents

So, you can view this file at my GitHub: https://github.com/IvanSteklow/FMHammers/blob/master/src/main/java/ivansteklow/fmhammers/tools/ItemHammer.java

 

HELP ME PLS!!! & excuse me for my broken english

Edited by IvanSteklow
Solved
  • Like 1
Posted (edited)

A Null Pointer Exception means you're treating a variable like an object, but it actually holds null (or "nothing") in it, so it doesn't have the methods you're trying to use. This error tells you the problem is in your ItemHammer.java file on line 35. So check there and see what variables you're trying to access, and then you can start thinking about why they might not have an actual object like you're expecting. Hint: Look at how many different constructors RayTraceResult has, and look at which one you're using. (Also, take V0idW1k3r's advice in general; but for the NPE, look at the constructors.)

Edited by IceMetalPunk

Whatever Minecraft needs, it is most likely not yet another tool tier.

Posted
  On 7/7/2017 at 11:22 PM, IceMetalPunk said:

A Null Pointer Exception means you're treating a variable like an object, but it actually holds null (or "nothing") in it, so it doesn't have the methods you're trying to use. This error tells you the problem is in your ItemHammer.java file on line 35. So check there and see what variables you're trying to access, and then you can start thinking about why they might not have an actual object like you're expecting. Hint: Look at how many different constructors RayTraceResult has, and look at which one you're using. (Also, take V0idW1k3r's advice in general; but for the NPE, look at the constructors.)

Expand  

 

  On 7/7/2017 at 11:23 PM, V0idWa1k3r said:

This is not how you raytrace anything. Items already have a built-in raytrace method conviniently called Item::rayTrace.

Expand  

Thank you, I fixed it!

  • Like 1

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.