-
Bug
-
Resolution: Unresolved
-
None
-
1.14.4, 20w18a, 1.16.1, 20w27a, 20w28a, 20w29a, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3, 1.16.4 Release Candidate 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 1.16.5, 21w10a, 21w11a, 21w13a, 21w14a, 21w15a, 21w17a, 1.17.1, 1.18.2, 1.19, 1.19.2, 23w13a, 1.20.4
-
None
-
Confirmed
-
Mob behaviour
apparently this was a bug in 1.13. i haven't tested it in 1.14 but i saw in a video that in 1.13 slow falling affected every entity except flying mobs (obviously) and squids/glow squid (the glitch) you can test it in 1.14 and tell me if its still a problem then i will update this post. by the way i own a copy of the game, just am lazy, here's the video: https://www.youtube.com/watch?v=Jyr1XdePVJI&list=PL7VmhWGNRxKi1ikLc2b_pi6EIGOCdF10d&index=13
Command to Reproduce
(squid)
/summon minecraft:squid ~ ~30 ~ {active_effects:[{duration:-1,amplifier:0b,id:"minecraft:slow_falling"}]}
(glow squid)
/summon minecraft:glow_squid ~ ~30 ~ {active_effects:[{duration:-1,amplifier:0b,id:"minecraft:slow_falling"}]}
Code Analysis
Code Analysis done by Thumpbacker
The issue here is that there is no check for the effect causing vertical movement to stay the same in the aiStep method
Current Code
net/minecraft/world/entity/animal/Squid.java
... else { this.tentacleAngle = Mth.abs(Mth.sin(this.tentacleMovement)) * (float)Math.PI * 0.25F; if (!this.level.isClientSide) { double d1 = this.getDeltaMovement().y; if (this.hasEffect(MobEffects.LEVITATION)) { d1 = 0.05D * (double)(this.getEffect(MobEffects.LEVITATION).getAmplifier() + 1); } else if (!this.isNoGravity()) { d1 -= 0.08D; } this.setDeltaMovement(0.0D, d1 * (double)0.98F, 0.0D); } this.xBodyRot += (-90.0F - this.xBodyRot) * 0.02F; }
Fixed Code
net/minecraft/world/entity/animal/Squid.java
else { this.tentacleAngle = Mth.abs(Mth.sin(this.tentacleMovement)) * (float)Math.PI * 0.25F; if (!this.level.isClientSide) { double d1 = this.getDeltaMovement().y; if (this.hasEffect(MobEffects.LEVITATION)) { d1 = 0.05D * (double)(this.getEffect(MobEffects.LEVITATION).getAmplifier() + 1); } else if(this.hasEffect(MobEffects.SLOW_FALLING)) { //Adding a check for slow falling and changing the speed fixes MC-167008 d1 = -0.05D * (double) (this.getEffect(MobEffects.SLOW_FALLING).getAmplifier() + 1); } else if (!this.isNoGravity()) { d1 -= 0.08D; } this.setDeltaMovement(0.0D, d1 * (double)0.98F, 0.0D); } this.xBodyRot += (-90.0F - this.xBodyRot) * 0.02F; }