Sniffer digging does not account for scale attribute
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:
Code Analysis:
(From haykam 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.
Linked Issues
relates to9
Created Issue:
Sniffer digging does not account for scale attribute
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:generic.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:
Notes:
relates to
relates to
relates to
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:generic.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:
Notes: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:generic.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:
Code Analysis:
From haykam in [link title|]
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:generic.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:
Code Analysis:
From haykam in [link title|]
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:generic.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:
Code Analysis:
(From haykam 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.
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:generic.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:
Code Analysis:
(From haykam 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.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:
Code Analysis:
(From haykam 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.
Cats with a large scale attribute set cannot properly pathfind themselves on top of applicable blocks like furnaces, beds, chests, or other blocks (currently blocked by MC-227216) and will not sit down as they would at a normal scale of one.
Steps to Reproduce:
- Summon/Spawn a cat
- Tame it
- Modify its scale attribute
/attribute @e[type=cat,sort=nearest,limit=1] minecraft:generic.scale base set 4 - Place down one of the following blocks:
- Bed
- Furnace (lit)
- Chest
- Wait for the cat to attempt to sit down
Observed Behavior:
The cat will properly pathfind on top of the block, but will not walk far enough on top of it to actually allow itself to sit down. The end result is the cat stands on the edge of the block, never sitting down.
Expected Behavior:
The cat would walk on top of the block, and sit down.
Screenshots/Videos:
Notes:
Related to MC-267486 MC-268415 MC-269476 MC-268010 MC-268009 MC-270878
The position of turtle scutes spawned from turtles growing up do not account for the scale attribute, resulting in them always spawning in the same place regardless of the entity's size.
Steps to Reproduce:
- Freeze game ticks:
/tick freeze
- Summon a baby turtle which is about to grow up
/summon minecraft:turtle ~ ~ ~ {NoAI:1b,Age:-1} - Increase its scale value
/attribute @n[type=minecraft:turtle] minecraft:generic.scale base set 30 - Advance the game by one tick
/tick step 1
- If necessary, move inside the turtle entity and observe where the scute spawned
Observed Behavior:
The scute spawns inside the turtle, where it normally would at a regular scale of 1.
Expected Result:
The scute would consistently spawn above the turtle.
Screenshots/Videos:
Code Analysis:
This is the code that handles spawning the scute item. Notice how it simply "spawns at location" and never considers the scale value of the entity.
protected void ageBoundaryReached() { super.ageBoundaryReached(); if (!this.isBaby() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { this.spawnAtLocation(Items.TURTLE_SCUTE, 1); } }



Code analysis (Yarn mappings)
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.