Potential tweak: Stop decay trailed by monsters from hurting the caster
Caopr opened this issue ยท 2 comments
Minecraft version: 1.12.2
Wizardry version: 4.1.2
Environment: Singleplayer
Issue details: Casting Decay wont hurt yourself walking over it. but when a mob has walked into it and starts trailing more decay behind them That decay will harm and afflict the caster and caster minions
P.s. Legendary wizard armors a bit weaker than diamond due to it not having toughness added to it.
Strange as it may seem, this is the intended behaviour. There's a specific reason for this:
Decay entities store their 'owner', which may be a player or a mob. The owner will not be affected by the decay, but everything else will. When a player (or wizard) casts the decay spell, the decay entities placed initially have their owner set to the caster of that spell. However, if a mob has the decay effect, the decay entities it places when walking around have their owner set to that mob, not the player who originally cast the spell. This is because if the owner were anything other than the afflicted mob, the mob would continually be afflicted by the decay it placed itself and the decay effect would never wear off. Since the player is no longer the owner, they too are affected by that decay entity. (Hopefully that makes sense.)
It would be possible to store the original spell caster in a mob with the decay effect and have both that mob and the original caster be immune to any decay it places (I was probably too lazy to try this before), but in a way I quite like the existing mechanic. There will probably also be a (albeit small) performance cost to storing the additional information, especially since it probably needs syncing in some way.
I'll do some survival testing of the decay spell and see what I think. In the meantime... be careful, I guess!