#Server-side hook into ALL player attacks
20 messages · Page 1 of 1 (latest)
@spark heron more specific question here ^
Client doesn't really sent air attacks aside of the swing. You could technically hook into ServerPlayNetworkHandler#onHandSwing to catch client initiated ones, but it will also trigger in other cases causing false-positives.
Question level: Patbox
You could attach Interaction entities to catch the action and then do the math to raycast it more precisely
just a continuation of #mod-dev-2 message
Using multiple can improve the shape
And making them ride that display (or others with position offset) will smooth out it's movement (entities riding other entities get 1-tick teleport interpolation)
What kinds of false positives will onHandSwing yield?
It's activated on item dropping and item usage
And more tbf
More or less any time swing is initiated from the client
You could possibly find what caused it by looking at other packets sent at the same time
I'll probably just put an interaction entity on the player and call it good
was just hoping there'd be an easy way
That may affect when right click dogs, boats, cats and Villagers🤔
gotcha
Depending on the end goal that might be non issue