The bug
If you stand on soul sand with the Soul Speed enchantment and switch to spectator mode you will keep the speed boost.
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
relates to 11
Attachments
Comments 14
Can confirm in 21w06a. Feel free to use the following command to make reproducing this much easier:
/give @s minecraft:netherite_boots{Enchantments:[{id:"soul_speed",lvl:3}]}Code analysis
Tested in 1.18.2 with yarn mappings
net.minecraft.entity.LivingEntity
protected boolean shouldRemoveSoulSpeedBoost(BlockState landingState) {
return !landingState.isAir() || this.isFallFlying();
}This piece of code is responsible from removing the speed boost from an entity.
Suggested Fix
@Override
protected boolean shouldRemoveSoulSpeedBoost(BlockState landingState) {
return super.shouldRemoveSoulSpeedBoost(landingState) || this.isSpectator();
}Simply override the check in PlayerEntity check if the player is in spectator mode. If so, return true!
Hi there!
I can confirm in release 1.16.1 and snapshot 20w30a.