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've been trying to get find an event which fires when the player get's hurt, that is, our current player. I've tried LivingHurtEvent, but it doesn't seem to even fire on a multiplayer world. What event can I use for this?

Edited by Frontear

I am a human and this action was performed manually. Please contact Frontear if you have any questions or concerns.

  • Author
5 hours ago, diesieben07 said:

LivingHurtEvent is fired immediately when a living entity receives damage, it can be used to alter the damage or cancel it outright.

LivingDamageEvent is fired after all damage calculations have been done (armor, potions, LivingHurtEvent (unless cancelled)).

Both of these fire for players. They do sometimes fire on the logical client, but not in a useful fashion.

Perhaps it's my code's fault, because LivingHurtEvent does not fire while on a multiplayer world, even for myself. While I can understand that LivingHurtEvent on EntityLIvingBase wouldn't normally fire because I don't have direct access to all the players on the server, I was hoping the event in EntityPlayer would fire for myself. Is this even possible for me to do?

 

Relevant code:

@SubscribeEvent public void onLivingHurt(LivingHurtEvent event) {
  if (event.getEntity().getName().equals(mc.player.getName()) {
    // the player has been hurt
    doSomething();
  }
}

 

 

EDIT:

I've found a method which works properly, It is LivingAttackEvent

Edited by Frontear

I am a human and this action was performed manually. Please contact Frontear if you have any questions or concerns.

And your code will crash the desiccated server. 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

1 hour ago, Draco18s said:

And your code will crash the desiccated server. 

Dedicated server* (close enough).  I'm guessing that was autocomplete in action right there XD

 

But yeah, in *most cases*, you would want the LivingHurtEvent, on the server side, though I have no idea what you're actually trying to do, so I can't say for sure.

2 hours ago, Laike_Endaril said:

Dedicated server* (close enough).  I'm guessing that was autocomplete in action right there XD

Yeah, that. Was on tablet at a party.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

3 hours ago, diesieben07 said:

Best way to spend a party :P

In between turns of fighting OblivAeon? I'm sure it was fine.

(Also, we won. Took 8 freaking hours)

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.