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.

Ben0017

Members
  • Joined

  • Last visited

  1. It is going to be a client side mod only. The only information the server sends when an entity is attacked is the animation/velocity packets, both of which do not fire a forge event. I need to know when each packet is received, and the target entity. In the NetHandlerPlayClient class, there are methods, such as handleAnimation(), which do not fire any forge event. I need to somehow make these methods fire an event, similar to how the handleChat() method fires a forge event. I would like to know the correct way to implement this into a forge mod, I already know I could insert a line of code with ASM or replace the NetHandlerPlayClient variable when it is initialized with an instance of a nearly identical class; however, there probably is a better way to fix my problem since ASM should be a last resort.
  2. I need to know when a packet is received. Forge has a handler for when a chat message is received, I want something exactly the same except for handling different packets(specifically the velocity updates and animations update). My end goal is to in some way, accurately know the distance an entity was attacked from and make a prediction as to which entity attacked them; it seems the only way to do this is to calculate the entities distance to all nearby mobs when it's velocity is updated from being attacked. I have been attempting to use hurtDelay and several other fields to avoid this problem here, but it seems I just cannot accurate values(or maybe I do and the idea that I could possibly have a "perfect" prediction by measuring distances the second the velocity packet is received bugs me). I know a few ways I could do this(ASM or replace the instance of NetHandler when it is instantiated), but I do not know what the best way is. I would like for whatever method I choose not to conflict with other mods. I am forced to use 1.8.9, sorry for being outdated.

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.