Jump to content

Ben0017

Members
  • Posts

    2
  • Joined

  • Last visited

Ben0017's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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.
×
×
  • Create New...

Important Information

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