Skip to content

LivingEntity#knockback does not work for players #13840

@Codestech1

Description

@Codestech1

Expected behavior

The method ought to work properly for players as well.

Observed/Actual behavior

The method does not seem to do anything for players, it works only for non-player entities. Setting hurtMarked to true after setting the knockback appears to work properly.

Steps/models to reproduce

  1. Try to knockback a player via the API method.
  2. Note that it does not work.
  3. Try with setting hurtMarked to true.
  4. Note that it appears to work properly now.

Plugin and Datapack List

I did not have any datapacks at the time of testing. The only plugins I had were packetevents, ViaVersion and my own, private minigame plugin.

Paper version

ver
[12:32:05 INFO]: Checking version, please wait...
[12:32:06 INFO]: This server is running Paper version 1.21.11-130-ver/1.21.11@c5a2736 (2026-04-11T11:14:19Z) (Implementing API version 1.21.11-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.11-128-1fdbce1 (MC: 1.21.11)

Other

As I already mentioned, knockback seems to be correctly applied after setting the hurtMarked flag to true. It is also what setVelocity does (however the knockback method does not call the Bukkit method, it calls the NMS method, but it probably should remain like that).

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.version: 1.21.11Game version 1.21.11version: 26.1.2

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions