1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[ViaVersion] Get player's client version.

Discussion in 'Snippets' started by Dovias, Feb 11, 2020.

  1. Dovias

    Dovias New Member

    Joined:
    Dec 8, 2019
    Messages:
    6
    Likes Received:
    0
    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.)

    Code (Text):
    1. import:
    2.     us.myles.ViaVersion.api.Via
    3.  
    4. expression %player%'s protocol version:
    5.     get:
    6.         return Via.getAPI().getPlayerVersion(expression-1)
    Usage:

    Code (Text):
    1. command /getversion:
    2.     trigger:
    3.         set {_protocolnumber} to player's protocol version
    4.         if {_protocolnumber} > 47:
    5.             message "Your client is 1.9+"
    6.         else if {_protocolnumber} = 47:
    7.             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
     
    • Friendly Friendly x 2

Share This Page

Loading...