Posted May 4, 20169 yr Okay, I'm new the the forums and i don't expect any help right away but thanks for any i get. So my question is or starting statement, I have a entity i made, His name is bob, he extends EntityTamable, and all that fun stuff, but i want to make it so: A) he re-spawns when he is killed IF he is tamed by a player B) he has a Chest GUI When u click him with an Open hand and Shift click makes him "sit" C)i almost forgot, owner shouldnt beable to hit him
May 5, 20169 yr Whenever you want to do something, take a moment to think if there is anything in Vanilla Minecraft that does something similar and then take a look at that. A) override #setDead in your entity class, check if it's tamed, and if so, do something like set its HP back to max and teleport it somewhere random. B) sitting: not too complicated - take a look at EntityWolf for the interaction and the wolf's Model / Render class for rendering stuff B) Chest GUI: quite a lot more complicated than either of the above - take a look at EntityHorse, plus the related Gui, Container, and IInventory (or whatever that has become if you are in 1.9) classes. If you are new to Java / modding, you might want to wait until you are more experienced to tackle this one. C) Override #attackEntityFrom in your entity class - the DamageSource#getEntity() method returns the entity that caused the damage, so you can check there if it is the owner and then return false rather than allowing any damage to occur. http://i.imgur.com/NdrFdld.png[/img]
May 5, 20169 yr Author Okay thank you ill give some of those a shot, maybe all and see if i can get little bobby some cool things.
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.