Want to get player's client version, but ViaVersion is overwriting player's packets which at the end provide spoofed client version? No problem, just use ViaVersion's API! here's a simple expression which i made in 5 minutes. Add this to new .sk file or at the top of your skript of choice. You could use this without the expression but i know there's a lot of people who are new to skript, so i tried to make it as simple as possible.
Requires:
- Skript-Mirror. (Preferably skript-mirror 2.0-SNAPSHOT)
- Skript plugin which is compatible with skript-mirror addon. (Preferably Skript 2.4.1)
- ViaVersion (ViaRewind, ViaBackwards, ProtocolSupport is compatible with this.)
Usage:
! This expression returns protocol numbers! To get protocol numbers of all minecraft client versions, use this neat website which lists all minecraft's client version numbers:
https://wiki.vg/Protocol_version_numbers
Requires:
- Skript-Mirror. (Preferably skript-mirror 2.0-SNAPSHOT)
- Skript plugin which is compatible with skript-mirror addon. (Preferably Skript 2.4.1)
- ViaVersion (ViaRewind, ViaBackwards, ProtocolSupport is compatible with this.)
Code:
import:
us.myles.ViaVersion.api.Via
expression %player%'s protocol version:
get:
return Via.getAPI().getPlayerVersion(expression-1)
Usage:
Code:
command /getversion:
trigger:
set {_protocolnumber} to player's protocol version
if {_protocolnumber} > 47:
message "Your client is 1.9+"
else if {_protocolnumber} = 47:
message "Your client is 1.8.x"
! This expression returns protocol numbers! To get protocol numbers of all minecraft client versions, use this neat website which lists all minecraft's client version numbers:
https://wiki.vg/Protocol_version_numbers