Posted May 27, 201411 yr I have some custom mobs and custom weapons with custom damage sources It's straight forward to have my own entities reacted to those custom damage sources because I can put whatever I please into attackEntityFrom(). Is there a straight forward way to do that for vanilla entities? Thanks!
May 28, 201411 yr Author Thanks for the response. I did look at LivingAttackEvent but didn't see a straight forward way to persist anything, like a state of frozen What I'm doing on my custom entities is within attackEntityFrom() I check the damagesource to see if it's an iceblast then set the entity's state to frozen. During the onUpdate() for that entity, if it's frozen, it does nothing. I looked at using LivingAttackEvent, tracking a collection of entities that were hit with an iceblast and referencing them in a LivingUpdateEvent handler to freeze them, but it felt like overkill. Often when my solutions go out of the way, I'm approaching it wrong.
May 28, 201411 yr Do you want them to look frozen or such? You could remove the entity, replace it with a icicle version of the entity, have that entity respawn the original when it times out. That would be a cool effect. Other than that, you would have to track all the entities, spam zero motion and set position to origin position, set agrotarget to null, and cancel every entityagro event at a minimum. I think replacing the entiry temporarily would be a more robust solution and easier to troubleshoot long term, but that is just me. Long time Bukkit & Forge Programmer Happy to try and help
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.