Fix special endermen dropping their held block if not killed. #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes GTNewHorizons/GT-New-Horizons-Modpack#17828.
Details: Capturing a mob in a soul vial calls the
setDead()
method on the entity being captured, which handles cleanup of various data associated with the entity. However, some mods add other functionality to this method, which can be repeatedly triggered by capturing and releasing the same mob in a soul vial.The vanilla way to prevent this (for example, to stop a large slime from splitting into smaller slimes when removed in this way) is to check whether the entity's health is zero when this method is called. This means that these effects only trigger when the entity actually dies, and not when it is removed from game by other means. I have fixed this for endermen here, and for two other mobs elsewhere:
Heatscar Spider (Natura): GTNewHorizons/Natura#26
MedSlime (Thaumic Horizons): GTNewHorizons/ThaumicHorizons#78
These are the only three cases I could find by an org-wide search that could cause issues if triggered repeatedly, and do not already contain the check for entity health.