#Can you stop players from dealing more knockback when they're sprinting?

1 messages · Page 1 of 1 (latest)

mossy ibex
#

I notice that players do a set amount of knockback while not sprinting but when they're sprinting they do more, is there anyway to have them do only a set amount of knockback no matter what?

graceful arrow
#

Probably. Detect if the player is sprinting and if they are detect when you hit them and set custom velocity onto the hit player.

velvet jungle
graceful arrow
# mossy ibex 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
ornate bane
#

Doesn't applyImpulse not work on players?

graceful arrow
ornate bane