Posted May 10, 201510 yr First, sorry for the barrage of questions, but I'm trying to learn as much as I can about this stuff to become a better modder. I have a vehicle that is just an entity. I want it to to have hit points that will go down when things do damage and eventually destroy that vehicle. How do I add this? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
May 10, 201510 yr Extend EntityLivingBase instead, or simply add your own hit points field and manage it yourself when the entity is struck. The first is easier, but has the downside of your vehicle then acting like an actual living being when it shouldn't. The second is more work, and will require that you spend some time thinking about your design and being comfortable with Java. http://i.imgur.com/NdrFdld.png[/img]
May 10, 201510 yr Extend EntityLivingBase instead, or simply add your own hit points field and manage it yourself when the entity is struck. The first is easier, but has the downside of your vehicle then acting like an actual living being when it shouldn't. The second is more work, and will require that you spend some time thinking about your design and being comfortable with Java. You can actually override onUpdate and onLivingUpdate, and that will stop it from acting like a living entity.
May 10, 201510 yr Extend EntityLivingBase instead, or simply add your own hit points field and manage it yourself when the entity is struck. The first is easier, but has the downside of your vehicle then acting like an actual living being when it shouldn't. The second is more work, and will require that you spend some time thinking about your design and being comfortable with Java. You can actually override onUpdate and onLivingUpdate, and that will stop it from acting like a living entity. Not entirely, as there are plenty of places that check 'if (entity instanceof EntityLivingBase)' before operating some logic which may not really apply to the vehicle; not to mention that overriding those two methods is generally pretty messy. Still, that is a possibility. I would only use it as a last resort, though. http://i.imgur.com/NdrFdld.png[/img]
May 10, 201510 yr Well overriding onLivingUpdate will stop the entity from moving, and chances are, he will be overriding onUdate anyway. Plus as long as you dont give the entity any tasks it wont try to move anyway.
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.