The bug
After stunning a ravager, and quickly go to spectator mode, the roar will still knockback players in spectator mode.
To reproduce
Summon a ravager
Get a shield
Switch to survival mode
Let the ravager bite the shield your holding and wait for the ravager to get stunned
Hold
F3
and pressF4
to open the game mode switcher and choose spectator modeGo near the stunned ravager
→ ❌ The spectating player gets knocked back
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 1
Attachments
Comments 13
I can confirm this behavior in 1.19 and 1.19.1 Release Candidate 1. This issue can also be seen with creative players that are currently flying and isn't exclusive to those in spectator mode. My reasoning for believing that the ravager's roar shouldn't knockback players that are flying in creative mode is because players (that are in creative mode and are flying) do not receive knockback from TNT explosions and aren't able to be pushed by flowing water.
Here's a code analysis regarding this issue.
Code Analysis:
The following is based on a decompiled version of Minecraft 1.19.1 Release Candidate 1 using Mojang mappings.
net.minecraft.world.entity.monster.Ravager.java
public class Ravager extends Raider {
...
private void roar() {
if (this.isAlive()) {
List<Entity> list = this.level.getEntitiesOfClass(LivingEntity.class, this.getBoundingBox().inflate(4.0), NO_RAVAGER_AND_ALIVE);
for (LivingEntity livingEntity : list) {
if (!(livingEntity instanceof AbstractIllager)) {
livingEntity.hurt(DamageSource.mobAttack(this), 6.0f);
}
this.strongKnockback(livingEntity);
}
...
If we look at the above class, we can see all living entities that are alive and are not considered illagers will receive knockback from the roars of ravagers. Since players in spectator mode are considered alive and living entities, this allows them to receive knockback from this source.
in 1.19.2 i was in spectator while having another player in adventure mode, the player triggered the ravager roar and i got knocked back, defo a bug that should be fixed cus it kinda feels dumb to keep bugs in the game for what feels like it should be a relatively easy fix?
Can confirm for 1.16.1