Skip to content

convert PLAYER_ACTION from byte to unsigned byte, replace -1 (1.7 client not looking at block)#629

Closed
Term4 wants to merge 2 commits intoViaVersion:masterfrom
Term4:master
Closed

convert PLAYER_ACTION from byte to unsigned byte, replace -1 (1.7 client not looking at block)#629
Term4 wants to merge 2 commits intoViaVersion:masterfrom
Term4:master

Conversation

@Term4
Copy link
Copy Markdown

@Term4 Term4 commented Nov 22, 2025

Prevents bug where 1.7 clients get kicked from non spigot based servers when cancel digging packet is sent.

Copy link
Copy Markdown
Member

@florianreuth florianreuth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you show the bug / a way on how I can reproduce it? The type didn't change in Minecraft, so it has to be something else.

@Term4
Copy link
Copy Markdown
Author

Term4 commented Feb 5, 2026

Can you show the bug / a way on how I can reproduce it? The type didn't change in Minecraft, so it has to be something else.

Sorry didn't see this sooner. The only time I've seen it is on minestom using velocity + viarewind on a proxy & bungee auth. When a 1.7 client joins & blocks their sword while digging, they get kicked (helps if they're walking forward as well).

@florianreuth
Copy link
Copy Markdown
Member

Could you make a video + show the kick message/logs?

@Term4
Copy link
Copy Markdown
Author

Term4 commented Feb 5, 2026

Could you make a video + show the kick message/logs?

Sure, https://youtu.be/sdzyI0DHEww

If you need more logs I can provide em, didn't feel like removing my IP.

@florianreuth
Copy link
Copy Markdown
Member

Juse use https://mclo.gs/, it will remove them

@Term4
Copy link
Copy Markdown
Author

Term4 commented Feb 11, 2026

Juse use https://mclo.gs/, it will remove them

PS C:\Users********\Desktop\Development\Velocity> java -jar velocity.jar
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/C:/Users/********/Desktop/Development/Velocity/velocity.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

[02:58:44 INFO]: Booting up Velocity 3.5.0-SNAPSHOT (git-7e01491e-b574)...
[02:58:44 INFO]: Connections will use NIO channels, Java compression, Java ciphers
[02:58:44 INFO]: Loading localizations...
[02:58:44 INFO]: Loading plugins...
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::staticFieldBase has been called by com.google.inject.internal.aop.HiddenClassDefiner (file:/C:/Users//Desktop/Development/Velocity/velocity.jar)
WARNING: Please consider reporting this to the maintainers of class com.google.inject.internal.aop.HiddenClassDefiner
WARNING: sun.misc.Unsafe::staticFieldBase will be removed in a future release
[02:58:45 INFO]: Loaded plugin viaversion 5.7.2-SNAPSHOT by _MylesC, creeper123123321, Gerrygames, kennytv, Matsv, EnZaXD, RK_01
[02:58:45 INFO]: Loaded plugin viabackwards 5.7.2-SNAPSHOT by Matsv, kennytv, Gerrygames, creeper123123321, ForceUpdate1, EnZaXD
[02:58:45 INFO]: Loaded plugin viarewind 4.0.14 by FlorianMichael/EnZaXD, Gerrygames, creeper123123321
[02:58:45 INFO]: Loaded 4 plugins
[02:58:45 WARN] [viaversion]: Already set upper bound 1.8.x (47) overridden by 1.21.11
[02:58:45 INFO] [viaversion]: Loading block connection mappings ...
[02:58:45 INFO] [viaversion]: Replacing channel initializers; you can safely ignore the following two warnings.
[02:58:45 WARN]: The server channel initializer has been replaced by java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
[02:58:45 WARN]: The backend channel initializer has been replaced by java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
[02:58:45 INFO] [viabackwards]: Loading translations...
[02:58:45 INFO] [viabackwards]: Registering protocols...
[02:58:45 INFO] [viarewind]: Registering protocols...
[02:58:45 INFO] [viaversion]: ViaVersion detected lowest supported version by the proxy: 1.7.2-1.7.5 (4)
[02:58:45 INFO] [viaversion]: Highest supported version by the proxy: 1.21.11 (774)
[02:58:45 INFO] [viaversion]: Finished mapping loading, shutting down loader executor.
[02:58:45 INFO]: Listening on /[0:0:0:0:0:0:0:0]:25565
[02:58:45 INFO]: Done (1.14s)!
[02:58:45 INFO] [viaversion]: You are running a development version of the plugin, please report any bugs to GitHub.
[02:59:09 INFO]: [connected player] Term4 (/...
:54568) has connected
[02:59:09 INFO]: [server connection] Term4 -> lobby has connected
[02:59:09 WARN] [viabackwards]: (1.17->1.16.4) Increased world height is NOT SUPPORTED for 1.16 players and below. They will see a void below y 0 and above 256. You can enable the bedrock-at-y-0 config option to replace the air with a bedrock layer.
[02:59:19 INFO]: [connected player] Term4 (/...:54568): kicked from server lobby: An internal server connection error occurred.
[02:59:19 INFO]: [server connection] Term4 -> lobby has disconnected
[02:59:19 INFO]: [connected player] Term4 (/...:54568) has disconnected: You were kicked from lobby: An internal server connection error occurred.
[02:59:24 INFO]: [connected player] Term4 (/...:54586) has connected
[02:59:24 INFO]: [server connection] Term4 -> lobby has connected
[02:59:32 INFO]: [connected player] Term4 (/...:54586) has disconnected
[02:59:32 INFO]: [server connection] Term4 -> lobby has disconnected
[02:59:34 INFO]: [connected player] Term4 (/...:54603) has connected
[02:59:34 INFO]: [server connection] Term4 -> lobby has connected
[02:59:36 INFO]: [connected player] Term4 (/...:54603): kicked from server lobby: An internal server connection error occurred.
[02:59:36 INFO]: [server connection] Term4 -> lobby has disconnected
[02:59:36 INFO]: [connected player] Term4 (/...:54603) has disconnected: You were kicked from lobby: An internal server connection error occurred.
[02:59:40 INFO]: [connected player] Term4 (/...:54615) has connected
[02:59:40 INFO]: [server connection] Term4 -> lobby has connected
[02:59:42 INFO]: [connected player] Term4 (/...:54615): kicked from server lobby: An internal server connection error occurred.
[02:59:42 INFO]: [server connection] Term4 -> lobby has disconnected
[02:59:42 INFO]: [connected player] Term4 (/...:54615) has disconnected: You were kicked from lobby: An internal server connection error occurred.
[02:59:58 INFO]: [connected player] Term4 (/...:51678) has connected
[02:59:58 INFO]: [server connection] Term4 -> lobby has connected
[02:59:58 INFO]: [connected player] Term4 (/...:51678) has disconnected
[02:59:58 INFO]: [server connection] Term4 -> lobby has disconnected

Screenshot 2026-02-11 030155

@couleurm
Copy link
Copy Markdown

couleurm commented Mar 22, 2026

Using SniffCraft and Pakkit, here's what I captured in '7, '8 and '21

1.21.11 (SniffCraft) (does not get you kicked)

Sword blocking/unblocking (sword had block_attacks component)

Initiating a sword block sends an ID:64 Use Item

hand: 0
sequence: 7
x_rot: ...
x_rot: ...

and an ID:4 Block Changed Ack

sequence: 7

unblocking does an ID:40 Player Action

action: 5
direction: 0
pos: x/y/z all 0
sequence: 0

and a Set Entity Data ID: 97

entity_id: 4
packed_items: [ 8, 0, 0, 255]

1.8.9 (pakkit) (does not get you kicked)

Sword blocking/unblocking

Starting to block a sword (holding right click) sends a 0x08 block_place

location: { x: -1, y: -1, z: -1 },
direction: -1,
heldItem:
{ blockId: 276, itemCount: 1, itemDamage: 0 },
cursorX: 0, cursorY: 0, cursorZ: 0

when releasing it sends 0x07 block_dig

status: 5,
location: { x: 0, y: 0, z: 0 },
face: 0

Bow pull/release

pulling:

location: { x: -1, y: -1, z: -1 },
direction: -1,
heldItem: { blockId: 261, itemCount: 1, itemDamage: 0 },
cursorX: 0, cursorY: 0, cursorZ: 0

release:

status: 5,
location: { x: 0, y: 0, z: 0 },
face: 0

1.7.10 (pakkit) (gets you kicked)

Sword blocking/unblocking

Starting to block a sword (holding right click) sends a 0x08 block_place

location: { x: -1, y: 255, z: -1 },
direction: -1,
heldItem: { blockId: 276, itemCount: 1, itemDamage: 0 },
cursorX: 0, cursorY: 0, cursorZ: 0

then, when ublocking, a 0x07 block_dig

status: 5,
location: { x: 0, y: 0, z: 0 },
face: -1

Bow pull/release

pulling back a bow sends a 0x08 block_place:

location: { x: -1, y: 255, z: -1 },
direction: -1,
heldItem: { blockId: 261, itemCount: 1, itemDamage: 0 },
cursorX: 0, cursorY: 0, cursorZ:0

and also a 0x1c entity_metadata:

entityId:6,
metadata: [0:{ type: 0, key: 0, value: 16 }]

then releasing the bow causes the same 0x07 block_dig

status:5,
location: { x: 0, y: 0, z: 0 },
face: -1

Note: Kicks when bow releasing/sword unblocking can be avoided by switching slots (0x09 held_item_slot) instead of releasing right-click

With hope these observations may help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants