Sniffers digging into the ground does not account for the scale attribute, resulting in the sniffer being able to dig multiple blocks away from their own position, or dig far too close to their inner hitbox at larger scales.
Steps to Reproduce:
Create a super flat world
Summon/spawn a sniffer
Scale it downward to 0.25
/attribute @e[type=minecraft:sniffer,limit=1] minecraft:scale base set 0.25
Wait for it to sniff a block
Observed Behavior:
The sniffer will play the animation as expected, but the block they dig over (and the block that shows particles) will be upwards of 2-3 blocks away from themselves. The behavior when scaling the sniffer upwards will be that the sniffer digs central to it's hitbox, disregarding it's head position.
Expected Behavior:
The sniffer in all cases would dig where it's head enters the ground, underneath it's hitbox.
Screenshots/Videos:
[media]
Code Analysis:
(From @unknown in this comment)
The SnifferEntity#getDigLocation method uses a constant value of 2.25 when calculating the magnitude of the vector from the entity's rotation and bottom-center position, which is proportional to the typical sniffer's dimensions. A scaled sniffer, however, does not scale this constant value. A proposed fix is to use the expression 2.25 * this.getScale() instead.
Code analysis (Yarn mappings)
The
SnifferEntity#getDigLocation
method uses a constant value of2.25
when calculating the magnitude of the vector from the entity's rotation and bottom-center position, which is proportional to the typical sniffer's dimensions. A scaled sniffer, however, does not scale this constant value. A proposed fix is to use the expression2.25 * this.getScale()
instead.