Posted July 29, 201312 yr 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?
July 29, 201312 yr Author 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?
July 29, 201312 yr Why aren't you extending ItemFishingRod ? Why are you extending EntityFishHook AND copying its content ?
July 29, 201312 yr Author 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.
July 29, 201312 yr 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)
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.