Cracker's Wither Storm Mod

Cracker's Wither Storm Mod

6M Downloads

[Suggestion]: Enhanced kill detection

nmsl123467 opened this issue · 3 comments

commented

Guidelines

  • By checking this box, I am saying that I have read the guidelines and believe to be following them to the best of my ability

Description of feature request

I mentioned this problem in #2226. Now I think of a better way, which is to use entity.remove(Entity.RemovalReason.DISCARDED) for all damage sources of Wither Storm, because I found some entities with absolute invincibility mechanism (such as immune to all damage, commands, SetHealth, etc.) while playing other mods.
Such entities usually have:
Invulnerable:1b (completely invincible, cannot be killed by /kill, attack, fall, void); Health is always restored, or the SetHealth() method applied to it is blocked; has forced AI script or MOD protection (such as some bosses); cannot be killed by conventional means, including commands, magic damage, fall, void damage, etc., and can only be damaged by specific weapons or triggering specific events.
The best solution is to use entity.remove(RemovalReason.DISCARDED) to force the target entity to be removed from the world, so that no death judgment or injury mechanism will be triggered, and no death events, drops, experience, particles will be triggered. It completely bypasses all mechanisms such as the entity's Invulnerable:1b, SetHealth(), and damage callback methods, and directly "erases" the entity from the world level. Because it directly removes the entity reference from the server world instance, without going through any logical layer of "death judgment" process, it is also the top-level API used in the original Minecraft code to "completely, forcibly, and without triggering any logic to remove the entity." There is no official RemovalReason or method that is more "advanced" or more thorough than it. This is also more in line with the setting of Wither Storm, such as directly swallowing the entity, or the entity being blown up by the flaming skull without leaving any debris. I know some people may think this is very unfair, so this may become a configuration and be turned off by default.

commented

so essentially, force despawn mobs with the invulnerable tag?

commented

so essentially, force despawn mobs with the invulnerable tag?

“entity.remove(RemovalReason.DISCARDED)”

commented

so essentially, force despawn mobs with the invulnerable tag?

Yes, if just use entity.remove(RemovalReason.KILLED) then the entity may override onDeath() or hurt() and refuse to die, or a mod registers for the LivingDeathEvent and intercepts it, as well as Invulnerable:1b entities may not respond to death