#Can you stop players from dealing more knockback when they're sprinting?
1 messages · Page 1 of 1 (latest)
Probably. Detect if the player is sprinting and if they are detect when you hit them and set custom velocity onto the hit player.
yeah, but from what i can tell its wonky
how would i go upon doing that
world.afterEvents.entityHitEntity.subscribe((eventData)=>{
if(eventData.hitEntity.isSprinting) {
eventData.hitEntity.clearVelocity()
eventData.hitEntity.applyImpulse(eventData.damagingEntity.getViewDirection())
}
})
``` make something like this
Doesn't applyImpulse not work on players?
It was changed in the latest update so both apply impulse and clear velocity work on players, but yes if you are on an older version applyKnockback will need to be used.
Oh, cool!
Thanks for the info, then