Posted February 3, 201411 yr I want to add a task to the pig that will make the pig follow the player, regardless of what is held. Maybe i could make it my pet? Although i'm not sure how to do that. Any help is appreciated. Thanks!
February 4, 201411 yr Check out the wolf code. if (user.hasKnowledgeOfJava) { if (user.question.hasCode) { return interpetHelpfulResponse(user.getQuestion()); } else { return "Could you post your code please?"; } } else { return "Learn some freaking Java!"; }
February 4, 201411 yr Author I did but i'm not sure how to make it my pet in order for it to follow it's owner
February 4, 201411 yr All the code you need is in any of the passive mobs that can be tamed (all of which extend EntityTameable). As suggested, if you look in EntityWolf and EntityTameable, you can find the code you need. You will not be able to easily make the vanilla pig tameable, but you can make a class that extends EntityPig and replace the vanilla pig with your custom pig when you 'tame' the pig. http://i.imgur.com/NdrFdld.png[/img]
February 4, 201411 yr Author Ok thanks for clearing that up. Is there a way, though, for it to just follow me by either setting it's path? I tried but I got a null error. Same if I try to just set it's position to about mine. It doesn't have to be a pet or anything. I also tried setting its path to entity? Sorry not at my computer now but it took an entity creature and I'm not sure if you can cast entity player into that.
February 6, 201411 yr I've wanted to do something similar to this and I thought maybe I could make the mob target the player without hurting him? Also if anyone could figure out the piece of code that has a baby animal follow it's parent that might work too?
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.