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
- Try to knockback a player via the API method.
- Note that it does not work.
- Try with setting
hurtMarked to true.
- 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).
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
hurtMarkedtotrueafter setting the knockback appears to work properly.Steps/models to reproduce
hurtMarkedtotrue.Plugin and Datapack List
I did not have any datapacks at the time of testing. The only plugins I had were
packetevents,ViaVersionand my own, private minigame plugin.Paper version
Other
As I already mentioned, knockback seems to be correctly applied after setting the
hurtMarkedflag totrue. It is also whatsetVelocitydoes (however the knockback method does not call the Bukkit method, it calls the NMS method, but it probably should remain like that).