The bug
Shulker bullets shot at a specific player in survival mode continue to follow that player after switching to creative mode.
Linked issues
is duplicated by 1
relates to 1
Attachments
Comments 19
This issue likely stems from ShulkerBullet.class, where within the tick() method, the code only checks if the target is in spectator (confirmed ingame - Shulker bullets do NOT target the player when initially in Survival, then switching to Spectator).
public void tick() {
super.tick();
Entity finalTarget = !this.level().isClientSide() ? EntityReference.getEntity(this.finalTarget, this.level()) : null;
HitResult hitResult = null;
if (!this.level().isClientSide()) {
if (finalTarget == null) {
this.finalTarget = null;
}
if (finalTarget == null || !finalTarget.isAlive() || finalTarget instanceof Player && finalTarget.isSpectator()) {
this.applyGravity();
} else {
// other code
}The if statement only checks finalTarget.isSpectator(), whereas Mob.class has a method called asValidTarget, which has checks for both spectator mode and a player.isCreative() check, on line 267 in the deobfuscated code:
protected @Nullable LivingEntity asValidTarget(final @Nullable LivingEntity target) {
if (target instanceof Player player) {
if (player.isCreative() || player.isSpectator()) {
return null;
}
}
Confirmed in 1.16-pre5. Please, change the reporter to me so I can keep the ticket up-to-date.