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

I'm making a client-side hud mod that I want to tell me the last person that hit me, but I'm not sure how to go about it. The LivingHurtEvent has this info, but it's only server side :(, so I'm trying to find an alternative that's client side.

 

I read a thread about something similar to this, where it was suggested the original poster either check every tick if the player's health decreases or look around for a packet that sends that info. 

 

Checking if my player's health is decreasing won't tell me what hit me, but I was wondering if anybody knew if any packets used this info - I've looked around but I'm still a little confused how to read what these packets do.

 

Alternatively, if that packet doesn't exist, how should i go about checking my surroundings for what hurt me?

 

Any advice is appreciated, thanks :)

Hi

:D

I'm not certain but the combat tracker might be up to date on the client side. Each entity living base child class has a combat tracker that indicates what is attacking and what the damage source is. So you can call the getCombatTracker() on the player entity and then get further info such as the damage source and attacker. I guess you'd do it in the Player tick event.

 

Also, if you can't figure out an easier way, you can have the server side send a custom packet to the client with the info you need.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.