If you light a block on fire using flint and steel, and then click with a spawn egg on the block, it will spawn that animal, and it will take damage, but it won't light on fire. If you do this with pigs, it will drop uncooked flesh instead of the cooked flesh it should drop.
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 2
Attachments
Comments 5
Please link to this comment in the description
The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.
The reason for this is that the method net.minecraft.entity.Entity.moveEntity(double, double, double)
always increases the Fire
value by 1 if the entity is standing in fire. However it only sets it to 8 ticks of fire if the Fire
value was -1 before. The problem is that after this if the entity is not standing in fire and the Fire
value is 0 or lower it is set to the negative amount of net.minecraft.entity.Entity.fireResistance
. This acts kind of like a cooldown which is for players 20 and for all other entities 1. This means a player can stand 19 ticks in fire before actually catching fire and all other entities catch instantly fire. As this value is set after setting the Fire
value if the entity is in fire however, the Fire
value is at that point still 0 which means the 8 ticks of fire won't be applied.
This is a general problem because methods like net.minecraft.entity.Entity.onEntityUpdate()
(also by reducing the Fire
value by 1 only if it is higher than 0), net.minecraft.entity.Entity.extinguish()
and net.minecraft.entity.Entity.handleWaterMovement()
use 0 as default value instead of the value of net.minecraft.entity.Entity.fireResistance
.
Confirmed in 1.8.3. This seems to be a combination of two bugs. One, if a mob starts existing in fire (either from a spawn egg or /summon (I haven't been able to test with breeding because of MC-78688)), it will have its Fire tag set to 1s, instead of the correct value. Two, the fire tag is shifted up by 1, meaning that a mob with Fire:1s won't be on fire at all, a mob with Fire:2s will only be on fire for one tick, etc.