The bug
Unlike ender pearls chorus fruits do not reset the fall distance and therefor the fall damage is applied after you were teleported.
How to reproduce
Teleport yourself multiple hundreds of blocks in the air
While falling eat a chorus fruit
Related issues
relates to
Attachments
Comments


Confirmed for 1.13.1.
Confirmed for 19w14b

Confirmed for 1.15.2

Still in 1.16.1 and 20w29a

Related to MC-109060 - same issue, but the teleportation method is different.
Can confirm in 21w03a.
Can confirm in 21w05b.
Can confirm in 21w06a.
Can confirm in 21w17a.
I can confirm this in 1.18.1. Here's a code analysis of this issue. 🙂
Code Analysis:
The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.
net.minecraft.world.level.item.ChorusFruitItem.java
public class ChorusFruitItem extends Item {
...
 public ItemStack finishUsingItem(ItemStack itemStack, Level level, LivingEntity livingEntity) {
ItemStack itemstack = super.finishUsingItem(itemStack, level, livingEntity);
if (!level.isClientSide) {
double d0 = livingEntity.getX();
double d1 = livingEntity.getY();
double d2 = livingEntity.getZ();
for(int i = 0; i < 16; ++i) {
double d3 = livingEntity.getX() + (livingEntity.getRandom().nextDouble() - 0.5D) * 16.0D;
double d4 = Mth.clamp(livingEntity.getY() + (double)(livingEntity.getRandom().nextInt(16) - 8), (double)level.getMinBuildHeight(), (double)(level.getMinBuildHeight() + ((ServerLevel)level).getLogicalHeight() - 1));
double d5 = livingEntity.getZ() + (livingEntity.getRandom().nextDouble() - 0.5D) * 16.0D;
if (livingEntity.isPassenger()) {
livingEntity.stopRiding();
}
Vec3 vec3 = livingEntity.position();
if (livingEntity.randomTeleport(d3, d4, d5, true)) {
level.gameEvent(GameEvent.TELEPORT, vec3, GameEvent.Context.of(livingEntity));
SoundEvent soundevent = livingEntity instanceof Fox ? SoundEvents.FOX_TELEPORT : SoundEvents.CHORUS_FRUIT_TELEPORT;
level.playSound((Player)null, d0, d1, d2, soundevent, SoundSource.PLAYERS, 1.0F, 1.0F);
livingEntity.playSound(soundevent, 1.0F, 1.0F);
livingEntity.resetFallDistance();
break;
}
}
if (livingEntity instanceof Player) {
((Player)livingEntity).getCooldowns().addCooldown(this, 20);
}
}
return itemstack;
}
...
If we look at the above class, we can see that the resetFallDistance()
method is never called throughout this piece of code, therefore resulting in your fall distance not being reset upon eating chorus fruit.
Fix:
Simply calling the resetFallDistance()
method where appropriate within this piece of code will resolve this problem. The following line of code can be used to fix this:
livingEntity.resetFallDistance();
Can confirm in 1.18.2.
I can confirm this behavior in 1.19.2.
Following on from my code analysis, I've double-checked my proposed fix and I can confidently confirm that it's fully functioning and works as expected, so I've attached two screenshots to this report, one of which shows the current code and the other that shows the fixed code. I feel this information may be quite insightful hence my reasoning for providing it. 🙂
[media][media]