这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@siyFred
Copy link

@siyFred siyFred commented Nov 15, 2025

Closes #4830. This PR moves part of onHitGround logic (which only applied to Living) to Entity so ItemEntity can use it.

The Living::onHitGround method was updated to call the parent method first, ensuring fall damage is only calculated after a block (like Slime) has a chance to reset the fall distance.

I also fixed a logic bug in Slime where sneaking players would not bounce (correct) but would still take fall damage (incorrect).

I have tested the following in-game scenarios:

  • ItemEntity (dropped items) now correctly bounce on slime blocks.
  • Players correctly bounce on slime blocks and take no fall damage.
  • Players holding "sneak" land on slime blocks without bouncing and without taking fall damage.
  • Players still take normal fall damage when landing on any other block.
  • Players who bounce off a slime block and then land on a normal block correctly take fall damage (confirming fallDistance resets and re-accumulates properly after the bounce).
  • Arrows, Snowballs, and Eggs correctly break or stick on Slime blocks (they do not bounce).

@siyFred siyFred requested a review from a team as a code owner November 15, 2025 15:45
public function onEntityLand(Entity $entity) : ?float{
if($entity instanceof Living && $entity->isSneaking()){
$entity->resetFallDistance();
if($entity instanceof Living && $entity->isSneaking()){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation is not correct

if($fallBlock->getTypeId() !== BlockTypeIds::AIR){
$this->broadcastSound(new EntityLandSound($this, $fallBlock));
}
return $newVerticalVelocity;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same again here


if($fallBlock->getTypeId() !== BlockTypeIds::AIR){
$this->broadcastSound(new EntityLandSound($this, $fallBlock));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to make dropped items, XP orbs, arrows etc have step sounds

@dktapps dktapps added Category: Gameplay Related to Minecraft gameplay experience Type: Fix Bug fix, typo fix, or any other fix Status: Waiting on Author labels Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Gameplay Related to Minecraft gameplay experience Status: Waiting on Author Type: Fix Bug fix, typo fix, or any other fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ItemEntity doesn't bounce on slime block

2 participants