-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fake Players take no knockback #745
Comments
Knockback is client-side IIRC. Therefore the server is expecting the fake players to make their own knock back, that won't because they are server-side. Therefore, the knockback would need to be reimplemented (unless it's available in the server-side) (possible, just maybe not the most important thing) |
not the most important thing. I was aware of that, but knew that knockback is a client thing, that's why everyone is so laggy in uhcs. Likely noones gonna work towards it. Feel free to close it. |
Knockback is not a client-side only thing. The reason why fake player doesnt take knockback from player is that there's a // in net.minecraft.entity.player.PlayerEntity#attack
if (target instanceof ServerPlayerEntity && target.velocityModified) {
((ServerPlayerEntity)target).networkHandler.sendPacket(new EntityVelocityUpdateS2CPacket(target));
target.velocityModified = false;
target.setVelocity(vec3d); // reset the target's velocity
} Since fake player ( It's not hard to be fixed. It can be fixed by a redirect mixin for example: @Mixin(PlayerEntity.class)
public abstract class PlayerEntityMixin
{
@Redirect(
method = "attack",
at = @At(
value = "FIELD",
target = "Lnet/minecraft/entity/Entity;velocityModified:Z",
ordinal = 0
)
)
private boolean velocityModifiedAndNotCarpetFakePlayer(Entity target)
{
return target.velocityModified && !(target instanceof EntityPlayerMPFake);
}
} |
Fixed #745 (Fake Players take no knockback)
Intentional? If so, could you consider adding the option to enable it?
The text was updated successfully, but these errors were encountered: