Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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.

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.

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.

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.

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.