mojira.dev
MC-271739

Scute items from a baby turtle growing up are spawned too high

Scutes spawned from a baby turtle when they grow up will be positioned too high above the entity.

Steps to Reproduce:

  1. Tick freeze the game for observation:

    /tick freeze
  2. Summon a turtle 1 tick away from growing up:

    /summon minecraft:turtle ~ ~ ~ {NoAI:1b,Age:-1}
  3. Advance the game by 1 tick

    /tick step 1

Observed Behavior:

The scute will be positioned too high above the turtle entity.

Expected Result:

The scute would be positioned directly above the top of the turtle when it grows up, similar to other items created from entities by game events/interactions.

Screenshots/Videos:

Showcase of the scute item spawning compared to other items created by game events:

[media]

Notes:

  1. Code analysis by @unknown in the pinned comment

  2. Related to: MC-262667 MC-269147 MC-270213

Attachments

Comments 3

Can confirm.

[media]

Can confirm. The scute is indeed spawned up too high.

Code analysis (Yarn mappings)

The turtle scute dropping behavior is implemented in the TurtleEntity#onGrowUp method:

@Override
protected void onGrowUp() {
	super.onGrowUp();

	if (!this.isBaby() && this.getWorld().getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
		this.dropItem(Items.TURTLE_SCUTE, 1);
	}
}

As indicated by the integer literal 1, the item entity will be spawned 1 block above the Y position of the turtle's feet. Note that turtles are 0.4 blocks high and baby turtles are 0.12 blocks high, so this offset is far away from the turtle.

Because a hardcoded offset is used, this also means that the turtle's scale attribute will not affect the item entity's position.

[Mod] Jingy

(Unassigned)

Confirmed

Gameplay

Low

Items, Mob behaviour

turtle_scute

Minecraft 18w07a, 1.20.6, 24w18a, 1.21, 1.21 Release Candidate 1, 1.21.3, 24w45a, 1.21.4

Retrieved