Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Fix MC-121706

Open 5jd opened this issue 3 years ago • 3 comments

A follow up PR of #8436 This PR is using a seperate branch instead of using master.

Reminder :

When a skeleton targets someone from a height, they just keep looking forward instead of up at their target.

This patch is directly a solution proposed by the reporter : https://bugs.mojang.com/browse/MC-121706

5jd avatar Oct 09 '22 16:10 5jd

I think there is more here.

            if (this.strafingTime > -1) {
                // ...
                this.mob.getMoveControl().strafe(this.strafingBackwards ? -0.5F : 0.5F, this.strafingClockwise ? 0.5F : -0.5F);
                this.mob.lookAt(var0, 30.0F, 30.0F);
            } else {
                this.mob.getLookControl().setLookAt(var0, 30.0F, 30.0F);
            }

in the strafing path, lookAt is called, but it has no effect? I don't know the difference between getLookControl().setLookAt and lookAt rn, but that seems to be the root cause? there is a reason the control one is only called in the else, I am sure. else you could just omit the lookAt all and call lookcontrol setLookAt for both cases?

MiniDigger avatar Nov 03 '22 15:11 MiniDigger

I think there is more here.

            if (this.strafingTime > -1) {
                // ...
                this.mob.getMoveControl().strafe(this.strafingBackwards ? -0.5F : 0.5F, this.strafingClockwise ? 0.5F : -0.5F);
                this.mob.lookAt(var0, 30.0F, 30.0F);
            } else {
                this.mob.getLookControl().setLookAt(var0, 30.0F, 30.0F);
            }

in the strafing path, lookAt is called, but it has no effect? I don't know the difference between getLookControl().setLookAt and lookAt rn, but that seems to be the root cause? there is a reason the control one is only called in the else, I am sure. else you could just omit the lookAt all and call lookcontrol setLookAt for both cases?

            if (this.strafingTime > -1) {
                // ...
                this.mob.getMoveControl().strafe(this.strafingBackwards ? -0.5F : 0.5F, this.strafingClockwise ? 0.5F : -0.5F);
                this.mob.getLookControl().setLookAt(var0, 30.0F, 30.0F);
            } else {
                this.mob.getLookControl().setLookAt(var0, 30.0F, 30.0F);
            }

It seems that lookAt rotates the skeleton body to its target, since replacing this.mob.lookAt(var0, 30.0F, 30.0F); with this.mob.getLookControl().setLookAt(var0, 30.0F, 30.0F); only rotates the skeleton's head towards the targeted entity and keeps the skeleton's body orientation in the first attack state.

5jd avatar Nov 03 '22 21:11 5jd

While this new approach works at the first glance it seems that some oriantation issues still persists.

5jd avatar Nov 04 '22 15:11 5jd

I'm unable to continue working on this issue at this time, so I'm closing the pull request. Thank you for your understanding.

5jd avatar Jan 07 '23 01:01 5jd