Spiderman31807 / MC-Modded

Click the Link below to find the Source Code of all of these mods
https://github.com/Spiderman31807/MC-Modded-Source
GNU General Public License v3.0
1 stars 0 forks source link

BUG: Zombies attack me #5

Open Nikitaf93 opened 1 month ago

Nikitaf93 commented 1 month ago

so when i turn into a zombie the zombie keeps attacking me for no reason apparently, this mostly happens when i hit the zombie BEFORE i turn into a zombie

Spiderman31807 commented 1 month ago

i did test the de-aggro system quite a bit and it worked fine, however it could be that it de-aggros fine but then your still stored as the recent attacker so it re-targets you. i'll see if i can fix that with / is that is the reason.

Nikitaf93 commented 4 weeks ago

also its maybe because the config does not generate so it defaults like that

Spiderman31807 commented 4 weeks ago

there is no config for that behaviour of the mod.

Nikitaf93 commented 4 weeks ago

oh, but if possible how do i make it so certain mob types attack or dont attack me if i would want to do it, its just thru the code?

Nikitaf93 commented 4 weeks ago

also if needed to know im using curseforge launcher

Spiderman31807 commented 4 weeks ago

the targeting system for zombie players for the mod is simple, when first infected it make the player invincible for 20 ticks (the same amount of time the red IFrames from getting hit lasts, so already invincible), but during those 20 ticks all mobs targeting the player will lose aggression because your no longer a valid target. (this doesn't happen from the red Iframes of the vanilla game, because that doesn't make it invincible, it just prevent any damage from happening).

then for goal targeting (goal is like a brain of the mob), i modified its NearestAttackableTargetGoal to apply a filter from just Players, to Players that are not infected. however if hit the zombie it'll trigger their HurtByTargetGoal which tells mobs to attack things that attack them. (which i left unmodified from the vanilla game)

Nikitaf93 commented 3 weeks ago

maybe add an option to make it so if u still hit them they wouldnt attack u yet idk? also if i dont even attack they start attacking me again in like 3-5 seconds

Spiderman31807 commented 3 weeks ago

i did consider that when initially making the mod, but i came to the conclusion at that time that it would probably be exploited more than it is worth (this conclusion was however made with the De-Aggro system working, which is did work in my Test just now so idk..), i would be fine with adding a config but from what i can tell people never actually use the config files only the UI Configs & i still don't know how to do those Configs.

there is also the fact im still debating with myself weather i should even be updating Zombie Infection given that fact that Mob Selector (the mod i made after Zombie Infection) is basically just everything Zombie Infection is, and more. with the only real difference (thats negative, more are positive) being that dying & respawning doesn't revert the player back into a normal player.

Nikitaf93 commented 3 weeks ago

i see mob selector does not work in multiplayer, and i need the infection thingy itself, i dunno if its there but like if u die to a zombie u turn into a zombie (if you're human) also for the infection to be good its need to work with multiplayer

Spiderman31807 commented 3 weeks ago

right.. i did actually forget about the single player only part, i do plan to fix that at some point. and yeah it does infect killed players, just not if they are playing another mob already (unless they are a villager).

i mean technically multiplayer does work, its only the texture & model of the player that doesn't work for other players on their client (and hitbox but that only affects them being able to hit the player), everything works fine on the own users client & on the server. but yeah that is a pretty good reason to still update this mod, at least until i fix multiplayer in that mod.