Mobs fix crash and not drop XP when dying by fire from sunlight #3398
No reviewers
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-Minecraft feature
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#3398
Loading…
Reference in New Issue
No description provided.
Delete Branch "mob_death_xp_drop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hopefully fixes crashes for #3403
Fixes #3179 for sunlight burning
The issue was that there was no death cause received by the code that identified the mob dead.
This was the catch all at the end of env_damage. After finding this was the check that succeeded, I commented it out and burning mobs would not die.
As a result:
I added a death check at the end of fire death so this will catch it and pass in the correct death cause, rather than waiting for it to run through the whole mob step to be caught.
I moved env_damage to the top with all the damage dealing mob code. If a mob dies in method, we have to know before deciding to move on with any other processing and ideally exit out of the mob_step
I added in the death cause unknown so we know what is causing a death and where it is being triggered.
Testing
/time 20000
wait for zombies
/time 9000
watch them die, and verify they don't drop xp orbs
From the wiki:
So whatever the cause of death, other than dispensed stuff, I think we should only check if a player or tamed wolf damaged the mobs less than three seconds before dying.
Can mobs get timers when damaged by players or tamed wolves? If so, if the timer is >0 on death, drop XP orbs.
This sounds reasonable. Though probably time consuming to implement.
WIP: Mobs should not drop XP when dying by fire from sunlightto WIP: Mobs fix crash and not drop XP when dying by fire from sunlightThere's an easier way. When a player damages the mob, store the os.time. When the mob dies, compare os.time to the stored time to see if it's within the allotted timeframe, and act accordingly.
WIP: Mobs fix crash and not drop XP when dying by fire from sunlightto Mobs fix crash and not drop XP when dying by fire from sunlightI have added crash fixes to this and it is ready for review. As it is a crash, I will likely move it in sooner, but any feedback I can happily implement after the event if anyone catches anything as I do plan to work further on this code later.
0261529264
tob834e790a7