Jump to content

Problem creating custom fishing rod.


Zcelo12

Recommended Posts

Hello,

I'm trying to make a custom fishing rod, but it doesn't work very well. With the item is everything ok, but with my EntityFishingHook class not. When i join a world i get a crash with these errors:

 

removed

 

Do you have an idea what I'm doing wrong?

Link to comment
Share on other sites

Edit: My EntityFishingHook looks like this, now.

 

EntityFishingHook

 

removed

 

I can catch animals with it, but can't fish. The bobber is jumping and sinking. This is weird. Is something wrong with my code or is it a render issue?

Link to comment
Share on other sites

Ok, I extended ItemFishingRod and changed the onItemRightClick function only to my EntityFishingHook class.

When I don't extend EntityFishHook in EntityFishingHok, i get 2 errors in this.angler.fishentity= this; and some similiar. public EntityFishHook fishEntity is only defined in EntityPlayer. When I extend EntityFishHook it works.

 

So how do you think should I make the class EntityFishingHook. Maybe there is something better. Then tell me, please. ;)

 

Anyway, with my current code the bobber is jumping when it is in the water and this looks strange. Then sometimes when i reopen the world i get a crash and have to generate a new one?!

 

Hope you can help me making a custom fishing rod.

Link to comment
Share on other sites

Extending the EntityFishHook is good.

Copying its private values inside your class is bad. <= when you do this, the new private values are just new, they won't affect the values in the parent class. At best it doesn't work, at worst it is confusing you and your class.

Remove every private values you copied from the parent class. If you need to change those values, you'll have to find a work-around. (using the Entity NBT at best, using reflection at worst)

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.