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

Hey guys, so i'm totally new to Forge API and would love guidance. (I come from a Bukkit background). I am looking to make a client mod where when a player takes damage (on a vanilla/spigot - not forge - server), x code happens. I have some sample code, and have registered the LivingHurtEvent event. However, on multiplayer the event does not seem to fire, ever. Can anyone point me in the right direction? Cheers.

LivingHurtEvent is fired only by server to compute how much damage should be dealt to entity after attack has succesfully reached "damaging point" (e.g entity is not invulnerable).

 

Client side is only ever notified about health, but never about hurting itself, therefore - you cannot track hurting on client easily.

 

Without either server telling you it happened (not possible on client-only mods) or finding it on your own (making some tick-based event that check difference between prev and current health), it is not really possible to do it nicely.

 

I am not sure about colored statement tho, but I am sure about HurtEvent.

 

There is also LivingAttackEvent which (I think) is fired on client, BUT - this one (if fired) would be called BEFORE server's, so kinda like:

client attack -> packet to server -> server attack -> server hurt -> damage dealth -> client update with new health.

 

Again, I am not really sure about this one (been months since I touched those events).

I recommend testing. :D

1.7.10 is no longer supported by forge, you are on your own.

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.