Stop sprinting for criticals
This commit is contained in:
parent
0632528416
commit
3736a86842
1 changed files with 9 additions and 0 deletions
|
@ -6,6 +6,7 @@ import codes.som.hibiscus.events.SendPacketEvent
|
|||
import codes.som.hibiscus.mixins.MixinExtPlayerInteractEntityC2SPacket
|
||||
import codes.som.hibiscus.player
|
||||
import codes.som.hibiscus.util.ext.requireExtension
|
||||
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket
|
||||
|
||||
|
@ -19,6 +20,14 @@ class Criticals : Feature("Criticals", FeatureCategory.COMBAT) {
|
|||
if (packet.typeHandler.type != PlayerInteractEntityC2SPacket.InteractType.ATTACK)
|
||||
return@on
|
||||
|
||||
player.isSprinting = false
|
||||
player.networkHandler.sendPacket(
|
||||
ClientCommandC2SPacket(
|
||||
player,
|
||||
ClientCommandC2SPacket.Mode.STOP_SPRINTING
|
||||
)
|
||||
)
|
||||
|
||||
player.networkHandler.sendPacket(
|
||||
PlayerMoveC2SPacket.PositionAndOnGround(
|
||||
player.x,
|
||||
|
|
Loading…
Reference in a new issue