[Bug]: melee hit has entire chase distance added to range (?), + Shield melee interesting interaction
Darkmega18 opened this issue ยท 16 comments
Describe the bug you're experiencing
first (bug):
It's weird, but I'm trying to have a boss who chases you and fires projectiles and summons, but he has the capability to melee every so often if you get to close to knock you back and debuff you.
However what instead has happened is that this boss with 10 follow range is hovering well outside my reach, and with his 4 range melee that should only hit if I'm also within melee range trying to attack him is hitting me even when he's chasing me down at full range...
The knockback also seems to be busted as an aside. as I set it to knockback 1, but I wasn't being sent away. or do I need a much bigger knockback size?
Second (interesting interaction, with a suggestion):
I had the wise idea to put an item with a rightclick feature into the bosses offhand so to also give it shield melee ai cause it said specifically they "use" their offhand item.
I gave the boss a staff item that fires projectiles repeatedly as it's held down and found that this interaction actually works, however the projectile and facing direction of the item in question seemed like it was facing straight down at his feet and he was somehow hitting himself with it.
Now I find this interesting, because I've always wanted a way that a mob could be made to use other weapons and tools with rightclick/use functionality from their offhand, like say guns from guns without roses or the staffs from eidolon that I tried with minor success.
Would it be possible to have an ai made based on this that specifically targets the player with a raycast (or something) from the mob's view to the player's head location while it's holding down it's item to potentially create an interaction where it'll use equipped item's effects towards the player much like a player would?
This would rather amazing to tinker with for modpacks.
Reproducability
Make a boss with a long follow range who is inherently a ranged spell caster.
But also put melee hit on him. And prepare for a bad time.
Mod up to date
- Before submitting this issue I updated to the newest version and reproduced it
Minecraft version
1.16.5
Modloader version
Forge
Logs
it's the same log as before incase theres anything there. But I doubt it.
https://gist.github.com/Darkmega18/60e9ca3872ffb344963f95bebf5ea77b
Could you upload your custom boss json? The melee AI is by default allowing hits at a 2 block range, which shouldnt be so big.
For the suggestions the problematic is that many of those modded items are made especially for players, e.g. mobs don't have the kind of aim players do.
you'll need eidolon, quark, atum and dungeons gear installed for him cause of the mobs and items used for his stuff... or yeah, exchange. but the necromancer naturally spams zombies and skeletons at you anyways. I just added wraiths past half health through the mod.
(renamed to a txt so it uploads. but it was a json of course.)
This was first copied over the original archmage, who after frustration from not changing, I gave him his own file and then worked without any changes afterwards.
necroboss.txt
chase distance is 10 so he tends to stand closer than the archmage.
Throws wraith fireballs periodically.
Experiment was melee shield but he's a spell caster in his base ai so he doesn't come in for the melee.
but then the melee hit somehow automatically gets the range potential of his chase distance it seems. cause when he's within range to start powering up his spells he can hit me from range.
It's likely stupid hard without the mods I have like war dance which allows parrying. cause you're intended to try to go in for the attack while he's casting at you, while also parrying his melee swing that comes out periodically. (or so I hoped) but yep, instead he's ends up endlessly psycho-slashing you from range.
the melee swing also doesn't seem to carry and linkage to the items in his hands. cause I would've hoped it would notice the item placed in his main hand and act as if it hit the player also, hence the sapping sword so he'd maybe get health off it.
hm the melee shield goal is actually not intended to be used alongside the other melee and chase AI's, those exclude eachother from running. Without using that one it should probably be fine
frick! I started on a redstone golem fight. Whirlwind still has the same issue. the golem somehow has his entire aggro distance range whirlwind, despite it being set to only 3.
also yes, it's whirlwind, not whirldwind. :V even google, it'll correct you to whirlwind without the d. that threw me off really hard.
Am I right in assuming that range and whirlwinds are only fine to add onto mobs who don't naturally have melee or combat abilities in the first place? I successfully worked it onto a chicken boss to make it and all it's called backup fight you, but placing it on literally any mob who's already capable of fighting makes it become a maximum range slap of death. D:
have a streamable of me fighting him. This is with melee hit set to 4 where it's meant to be so he can hit you if you get close. but he's just always hitting regardless when within chase distance.
https://streamable.com/dv6vjp
not sure how I picked up a bleed in the fight, but it was likely majrusz's difficulty picking up that he's got a sword in his mainhand technically, and so counting it for his hits to make bleeds from weaponry...
ok. if I take out chase, he then just gets infinite range as long as he's aggro it seems. ._. seems like he's somehow just raytrace sniping me. cause it also hurts any mobs if I line them up perfectly also...
your item based projectiles are also capable of going through shield.... :V
but further testing seems like the "melee" doesn't. so he must've been backing it up with fireballs.
further testing with zombieboss, whirlwind hit wither effect seems to penetrate shields and war dance parry....
I might have to steer clear of these "melee" things, cause they're kinda cheesy right now.
does the melee hit just "enable" the mob to melee at the given range and apply effects? or is it a projected effect?
cause the madcow, who naturally doesn't attack at melee is properly applying poison when hitting normally, but then periodically hits with a phantom hit that makes a swipe, which is the shockwave.
could the issue be that I'm trying to give the melee damage to an enemy that starts an attack routine (charge up, summon mobs, throw ice fireballs, repeat) at range and so thats where the reach of the "melee" comes from? If I use shockwave, would that create a desired effect cause it's based on proximity?
speaking of which, the shockwave is very sneaky, you don't get any indication it's about to happen or will happen. Can you create maybe a visual effect to say that it's recharged and the mob will use it when it's available? like say, emitting particle effects which you can select similar to the particle effect command that radiate at a certain speed from the mob?
well, even without the shield goal. the melee hit can hit me as long as he's within his chase distance doing his other attacks.
even after I set it to something like -6. which somehow it takes, he can still hit at 10 range. same boss, just minus the shield ai
necroboss.json.txt
ye I butchered the name. Whirlwind should be fine on any entity, its simply doing the attack on the specified attackdistance or by default 4 blocks far. For me that works just fine aswell, you might want to test with a simple vanilla mob. Modded mobs may have other functionalities/AI's running beside the brutal bosses ones.
Visual indicators I think are only helpful if you can somehow avoid the ability, but since it stays ready until used thats kinda unlikely
You squared attack reach twice. This doesn't manifest on default bosses because they do not use this field, and thus the initial squaring is skipped.
blocking can "avoid" the hit, but your potion effect still goes through.
and thats probably one of my issues then. I'm trying to make unique bosses out of mobs who don't appear very often due to having a decent variety of mobs available in my game all vying for screen time. :<
The melee hit was working on any mob that doesn't naturally have a melee attack in the first place like chicken and cow. in which case then it adds one and lets them hit with it to deal effects etc.
but if it gets put onto a mob who naturally already has a melee: instead of just infusing their melee attack with effects or giving them increased range so they're harder to approach I end up with two melee hits working in tandem where their melee can hit if they touch you, but they can still constantly hit me with the fake one which for some reason then gets infinite range.
The shockwave then seemingly is pretty much melee hit but with "AoE" taking after your other projectiles where they're projected at all nearby or within range all at once.
Is there no way you can check the range from the player to the mob and enforce the reach if it tries to use the attack regardless?
My AI does enforce the reach, see here
if that one was broken then it should be reproduceable with any normal non-modded entitiy aswell, which would exclude other AI's/attacks from other mods for testing.