Comments (6)
Hi, how do you get the protocol version of a player with ViaVersion api? It seems you need the Player object which you can't get on ping event.
from cleanmotd.
For spigot, you can add it to your maven like so:
<repository>
<id>viaversion-repo</id>
<url>https://repo.viaversion.com</url>
</repository>
<dependency>
<groupId>us.myles</groupId>
<artifactId>viaversion</artifactId>
<version>2.2.2</version>
<scope>provided</scope>
</dependency>
and then use it in your code like this:
Player player = // some reference of the player
int protocolVersion = Via.getAPI().getPlayerVersion(player.getUniqueId());
For bungeecord this is not needed, you can just use event.getConnection().getVersion();
from the ProxyPingEvent.
from cleanmotd.
I will try to implement this for BungeeCord. It will not be possible to do in Bukkit as you can't get the "Player" on ServerListPing.
from cleanmotd.
I will try to implement this for BungeeCord. It will not be possible to do in Bukkit as you can't get the "Player" on ServerListPing.
You can do it with ProtocolLib tho... We will probably have an implementation soon :)
from cleanmotd.
Closed with 4f13ced
from cleanmotd.
I had to revert the changes because they broke some stuff and only work on BungeeCord if ViaVersion is installed.
from cleanmotd.
Related Issues (13)
- Is it possible to centre the MOTD? HOT 1
- Sometime \n (newline) doesn't get parsed. HOT 1
- The icon of the server cannot be read HOT 1
- Can't put the first motd line in the middle HOT 1
- Velocity Support HOT 2
- HEX support HOT 4
- Request: Add Profiles HOT 3
- cleanmotd help not work HOT 1
- Plugin is not working in 1.19+ servers with ProtocolLib installed HOT 1
- 1.16 hex color support HOT 4
- No escape character for '&' HOT 1
- Protocol changing option is broken (Bungee) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cleanmotd.