#velocity-dev
164 messages · Page 5 of 1
where i can modify the velocity language message?
at this moment, modifying the jar is the only supported way
can extract the locale file and place it back in
the file location?
don't remember, see the search 🤷♂️
:/
com/velocitypowered/proxy/l10n/
i'm having a kinda of an weird issue where the first item of the message is not colored
all the rest of the message is normal
except for this first [
and it makes no sense for my why
.style sets the entire style of the component
as you've created a style that just contains bold text, the colour will not exist in that style
just do Component.text("hi", NamedTextColor.RED, TextDecoration.BOLD)
is there a documentation on how to use Configurate ?
found, i let it here for those who wonders
https://paste.gg/p/anonymous/09b778cfb9704f83a0777e995a136d5a
i'm getting this weird error when trying to run my plugin, and it only seems to happen if i have a ProxyInitializeEvent listener registered
Can I see your event code?
¯_(ツ)_/¯
I have no idea.
I have ran into this before with a different event.
I never found a solution.

That’s the wrong logger
Inject the Log4j logger
is this not the log4j one?
Are you sure about that? Same logger I use.
org.slf4j.Logger is definitely the one you are meant to use.
i'm just confused lol
@patent portal I suspect something wen't wrong when building your plugin, have you tried a clean build?
if what you're referring to is ./gradlew clean build, then it still yeilds the same results
ok i fixed it
i'd forgotten to add that org.xyz.something folder structure to my src, and thus the files were at the root of the jar
i'm no java wizard but for some reason that fixed it
off-topic, but which font is this?
Fira Code (nerd font variant is used for my terminal - you may not need it)
Heya
Interesting query for anyone familiar with Velocity internals
A little while ago I ported the FakeProtocol plugin to Velocity so I could do a network migration from bungee to velocity because... well velocity 🙂
Everything in principle operates fine. I can define my list of allowed protocols. If the client is unsupported, I can display my custom message showing what versions our network supports. Happy days.
However. If the client is using an allowed version. They can connect OK. And they see the player count format expected and stuff. But the ping status shows incompatible version (as per the attached screenshot). Has anyone got any thoughts on this? I can't make sense of it for the life of me!
Actually
Ignore this completely!
As soon as I posted this I had another thought of where the issue lies and it turns out the bug is with ServerListPlus - not my port of FakeProtocol. I'll direct the query their way.
Is there any possibility to fork Velocity like one can fork paper or waterfall?
Yes
Is there any documentation on this topic or maybe even an example?
hi it tells me this velocity error when i run a command how can i fix it?
No need to cross post
ah ok
how can i fix that error?
By not crossposting and patiently waiting for a reply, by providing the most information possible.
ok sorry i tagged you but it's an urgent problem
That doesn't change anything
ok
Or Is there even an tool for this like the userdev plugin? Or can I use the Userdev plugin for this in any way?
Work on it like you’d work on any other open-source java project that uses gradle. Velocity isn’t a fork and doesn’t use any kind of patching system; its just a normal project. You dont need any special plugins in your JRE other than the ones automatically provided by gradle.
I want to send a player message containing a link, but it doesn't seem to be clickable
anyone can help me?
just add a .clickEvent(ClickEvent.openUrl(String/URL)) to your component
thanks
right now i have a network library that hooks into paper plugins on my subservers and automatically loads and saves data from MongoDB. the issue i am currently having is figuring out how to update this data when someone does /link (from a velocity plugin). would redis be the best way to do this?
Also, would it be better to just cache playerdata on the velocity plugin and put it in the redis database, so that when a player joins a subserver i dont have to query mongodb but rather redis? not sure what is best for data synchronization
Absolutely yes you want to be querying redis for sync data
it's what I do and its fkn quick. If I made a DB query of any kind I'd be introducing a lot of overheads.
How would I go about getting the ip address the player is using, when connecting to the proxy server? I know I need to listen on the server ping event, and I believe I need to use the getConnection method on the event. But I'm unsure how Velocity passes the IP from there.
InboundConnection.getRemoteAddress()
Please check the javadocs in future.
@valid bone
maybe they want getVirtualHost, unclear wording
maybe?
I want the forced hosted ip
What do you mean by that?
IP being domain.com, then getting subdomain.domain.com
I would say it's the getVirtualHost method, but the InetSocketAddress class link returns a 404.
Also, I did check the javadoc. But thanks.
This is probably what you want
https://docs.oracle.com/javase/8/docs/api/java/net/InetSocketAddress.html
I'll check it out. Thank you.
the getVirtualHost return the hostname the player used to connect to the server with. For e.g if the player connect with "play.google.com", the virtualHost will be "play.google.com"
Alright. Thank you.
it can be null, but I don't under which circumstances it could be
I'll keep an eye out for that. Thank you for the heads up.
so I should load mongo on the proxy, and cache it in redis, and then when a player joins a subserver take the information from redis instead of directly mongodb? also is pub sub the best thing to use for this? i have all of the sub servers subscribed to the proxy and the proxy pushes updates to the other servers?
If both the proxy and the server need to get information from MongoDB, just get it.
k, and ill just use redis to push msgs
Use Plugin Messaging Channels
yes, all commands are executed asynchronously
Is the velocity still updating ? Because I didn't see any new commit since a long time
Yes it is
Ok, and is there a branch of somethings else to know the development status ?
There are a few PR's open that will likely be merged in the future. Tux, the primary author of Velocity has a full-time job, and is very limited on how much he can contribute
ok thanks 🙂
is there a way to disable velocity tablist overriding ? I'm trying to send tab from server, but doesn't work on velocity
I know this was brought up before, but I would like to get some opinions on adding a trailing comma to the versions in ProtocolVersion, the only benefit of this is to not override git commit history
i always use trailinmg commas in programming because of that
How/why would it affect git commit history? I don’t think I’m fully understanding
With how it is currently setup, the last version enum has a ";". With that, every time a new version is added the version before it has a new commit message
for example, this is the current way we do it:
Do note, my commit message has changed the message for MINECRAFT_1_18
this is what I am proposing
yeah
So, I cloned Velocity and needed to edit log4j2.xml, however now Gradle refuses to build. Is configuration editing forbidden?
no, but you don't need to edit velocity directly to do that. you can specify a custom log4j config file by starting velocity with -Dlog4j2.configurationFile=file.xml before -jar.
I actually do that to fix a bug that occurs in Velocity.
So this is intentional.
why not contribute
That is indeed what I am attempting
ah alright
yeah of course, I am not familiar with velocity, but my guess on your issue is that you accidentally edited the license header at the top of the file which it checks on build
Oh lol, I did not, but I added a comment which didn't have space after the license declaration, it works now, thanks :D
Bungee plugin messages (especially the one to move player to another server) work on velocity too? Or there are changes
They work
They work by default, however, it can be disabled in Velocity config
Can I open a Inventory through velocity
Velocity can not access information about the servers state*
That means i can not?
Exactly
You cant
But depends on what you want
You can manage to open inventory gui
But not listen to a click? Or what you mean
In theory yes, but in practice not really and Velocity doesn't offer any API for it afaik
Hey, a quick question, does Velocity have a broadcast method? (I can't find one)
Anything that is an Audience has sendMessage methods - this includes ProxyServer and RegisteredServer, etc
So f.e. ProxServer#sendMessage sends to all connected players, and RegisteredServer#sendMessage to all players on that server?
yes
thx
what event is handled when spigot server shuts down and kicks players? And can I move players to another spigot server?
Actually this is kinda odd, I've found out that Purpur does indeed kick the players, however paper and it's "predecessors" seem to just disconnect the player
Tho it would need some more testing to prove.
is this a #paper-dev question?
No I guess.
Just saying, that whether disconnect or kick event will fire may vary on the server you are using.
That wasn't meant for you, the question that was responded to was deleted.
Oh lol, thanks, it seemed kinda odd.
paper kicks players too
all of them do, it's literally a vanilla thing
big thing is gonna be the order of which stuff occurs
I have a feeling that purpur fucked with that one
Idk, it is possible. I am just saying what I've observed
On all server's except Purpur I just received a general disconnect.
don't mention
oh ok
player are kicked late in the process
so, you're not gonna even get an event fired because your plugin is disabled before then
iirc, purpur messed with the order so that the events are fired or something
but, I don't really care to track what they do, I just remember there being some complaints around that
I think that the question was about which event will fire for the players on the proxy, when the server they are connected to will close.
So if you have a velocity plugin, it is still going to be enabled when players get kicked from those servers 
Hi, where do i find list of all events and description of it?
channel topic
Um, okay but i need help which event is called when player just disconnect from proxy, not get kicked
the connection closing is the connection closing
that's the cleverly and aptly named "disconnect event"
Hello! I want to create a Velocity Plugin with Kotlin. But, I have following error: ```com.velocitypowered.api.plugin.InvalidPluginException: Did not find a valid velocity-plugin.json.
at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.loadCandidate(JavaPluginLoader.java:64) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:92) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:324) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:222) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.Velocity.main(Velocity.java:64) ~[velocity.jar:3.1.1]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at de.dytanic.cloudnet.wrapper.Wrapper.lambda$startApplication$5(Wrapper.java:487) ~[wrapper.jar:3.4.3-RELEASE-cca9610]
at java.lang.Thread.run(Thread.java:833) [?:?]
you need to use kapt to run the annotation processor, iirc
how?
idr
um, sorry but I don't understand?
I don't remember

kapt processor
Where in velocity's code are the log files?
need to make some edits to how velocity logs things for my server but can't find it
I need to remove the player IP from logs
here ya go
👍
ty
playerIp string
I mean, it's just a very bad way to solve the issue, you can just replace IPs in the filter
and how exactly would I do that? I don't know this log4j stuff
https://logging.apache.org/log4j/2.x/manual/layouts.html
Pattern layout - %replace method, match on IP regex
or match whatever thing you want
Cool but where do I put that
in the log4j configuration file, one is already provided by velocity, and since you have the source open it's in one of the resources folders, you just have to look for it
yep
https://stackoverflow.com/questions/12579468/how-to-set-log4j-property-file then this kind of explains how to use a different file than the default provided
can also use -Dlog4j2.configurationFile=file://file/path/log4j2.xml sys property
mind giving me a code example?
tried it to no success
what did you try?
of setting the config file?
just use the sys property
java -Dlog4j2.configurationFile=/home/fixed/server/log4j2.xml -jar server.jar
there's some example usage
That wouldn't work as we run multiple proxies that often get changed over multiple networks
only takes one person to fuck up
GDPR is not a fun thing
You don’t have control over your command line flags?
I do, of course, but I just don't find having something this important in a startup command very appealing
Don’t modify the source of the proxy, that’s such a bad idea
It forces you to constantly maintain the fork rather than taking a non intrusive approach
I mean, you can make a java agent
And pre main set the sys property
This contains code examples of setting system properties, I’m not gonna teach you how to make a java agent tho
I don't think hitting "fetch upstream" and rebuilding is that hard lol
Then feel free to just modify the log4j config file built into velocity
well that's the problem
in the year that I'm working with java I never did anything with that
Just modify this
but what do I modify inside it
Read the documentation for log4j
I’m not gonna write your config for you
Use the PatternLayout and use %replace to match IPs, I gave you a resource for regex matching IPs earlier
This essentially
How can I get the plugin config in Velocity from a plugin?
Hey, I have a small issue with Velocity.
How can I redirect a player when a server went down ? According to velocity's java doc, It should be done when the KickedFromServerEvent is fired and then I should use KickedFromServerEvent.RedirectPlayer to redirect player to another server but it doesn't works for me. Player is kicked from the proxy with "Disconnected" message.
Here is what I use to do that :
KickedFromServerEvent.RedirectPlayer.create(foundServer());
foundServer() is a private method aims to found a available server, it's return a RegisteredServer object
I've also tried to done that redirection with the following code :
player.createConnectionRequest(foundServer()).fireAndForget();
Thanks for your help.
redirect player is definitely the correct thing to use
are you sure you're setting it correctly?
I found my mistake : I did not use the event.setResult(), I thought that what I wrote above was correct but not.
The correct way to do that is :
event.setResult(KickedFromServerEvent.RedirectPlayer.create(registeredServer));
There's no predefined config file, although you can use Configurate to load and save config files. You can inject the plugin's data directory with the @DataDirectory annotation
How do i send player to server X in paper plugin?
Okay, thanks
I found this
server.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); but i didnt know if i have to change Bungee to Velo
No need to change anything, it works the exact same, otherwise having it built into velocity would be somewhat pointless
Hm i got a little problem, i have
Player player = playerAll.get(0);
player.sendPluginMessage((Plugin) this, "BungeeCord", out.toByteArray());```, intellij marks me `(Plugin) this` but i dont know how to fix it, my error
```java.lang.ClassCastException: class pl.siecmc.siecmcqueue.SiecMCQueue$1 cannot be cast to class org.bukkit.plugin.Plugin (pl.siecmc.siecmcqueue.SiecMCQueue$1 is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @28#0703af815b; org.bukkit.plugin.Plugin is in unnamed module of loader 'app')```
wrong channel
it wants the Plugin instance, you can't cast random things to random things and expect it to work
Is there an easy way to create a new @Inject instance?
Or I would have to use the guava injection stuff?
Hi how can I get the absolute path of the plugins folder?
@DataDirectory Path path
Hey guys, how can I kick by ip in the event.connection.ConnectionHandshakeEvent?
The player object has not been created yet
See the javadocs...
if you look at that event class on the JDs it'll basically spell it out
hello do you know how to solve this error when i try to connect tell me this how i can solve i await answer thanks: 0
[19:56:41 ERROR]: [connected player] MrRaffus_ (/(IP) ): unable to connect to server lobby-1 com.velocitypowered.proxy.util.except.QuietRuntimeException: The connection to the remote server was unexpectedly closed. This is usually because the remote server does not have BungeeCord IP forwarding correctly enabled. See https://velocitypowered.com/wiki/users/forwarding/ for instructions on how to configure player info forwarding correctly.
it basically tells you what's wrong
How do I load a plugin runtime?
You don't load a plugin after Velocity is already running
The plugin should be loaded during startup
Yea well what I have is a jar loader which downloads the jar at runtime and loads
And one solution would be to just include in the class path and load it, but that is not an option since that would have breaking changes
I guess I'd have to use some reflection magic
hi
how can i port https://github.com/TeamKun/ServerTeleport/tree/v1.0 to the latest Velocity?
the docs site includes information on porting
I just don't get it
I know basic command and I learn new commands
You can help me or you can port this version
no
do you know someone who will help me?
sorry
it is out of habit
So I've got a ticket management plugin that I'm looking to make work with Velocity. Would it be better to make a Velocity-specific plugin that gets placed only on the Velocity server, or should I make the individual Paper plugins communicate with each other? Not sure how it all works and what is/isn't possible
depends on needs
if it's just using commands/chat, etc, no reason it has to be on the server
except for the idea of having dumb proxies
something like that would be trivial to abstract out into being able to run it in multiple environments
Weird question, but is there a way to asynchronously send out a channel message and wait for a response inside the same function? Trying to grab permission groups for particular users, and I was going to delegate that to some plugin on the individual server
Luckperms-velocity + LP api
Yeahhh, that's the first thing that came to mind. I was just trying to not rely on a particular permission system
Sounds like the only practical route though
I mean, it pretty much is outside of sync calls off main and praying that the perm plugin deals with that properly (and, many just don't)
theres no built-in way to wait for a response to a plugin message, you'd basically need to do that yourself and implement the entire layer yourself
I just updated it, if you want you can try it https://github.com/4drian3d/ServerTeleport/releases/tag/1.1
Tip: instead of collecting multiple streams to lists in https://github.com/4drian3d/ServerTeleport/commit/f10bb76ccb39aac7532b172dba92c0cbbb96caa4#diff-1e89f04b31b77ba6eaf7031357d96a5af632b2df4394892397c3a52911de15d1R77, concatenate the streams (see Stream.concat, https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/stream/Stream.html#concat(java.util.stream.Stream,java.util.stream.Stream)) and then collect (that way you avoid unnecessary allocations)
There's no way to mess with arbitrary packets being sent, right?
Only chat and plugin messages?
What do you mean by arbitrary packets
Also C2S or S2C, they both have different specs for what’s even decoded
S2C, trying to replace colors in chat, books, signs (obviously all three of those work differently and I'm aware of that, I've just never used Velocity before)
Honestly, what I'm doing might be out of scope for Velocity now that I look at it more
All I want to do is intercept chat messages, items being put in slots (so I can intercept book text), and block entity data being sent
Protocolize might be able to pull it off, actually
maybe, it's going to put A LOT of strain on your proxy
is there any reason you're not doing this on the server?
like is there a specific reason for it to be going on the proxy? The server can handle it in a much better way
Sponge doesn't really make it easy to do this either, honestly, just because of how its API is
I mean sure, doesn't put less strain on the proxy though
Ideally this would just be a client mod, honestly
the issue is the proxy needs to take care of 1.7~1.18.1, that's quite a lot of versions - the less packets it has to take care of the better
and that's true for any proxy
That's fair
the server has to take care of all of em
so they're already in their raw form when you need to intervene
intervening before they get dumped into bytes and sent into those channels is probably the best way to go about it
creates the least amount of strain on the system since you're not doing a bunch of translations to get there
or put it on the client - that's always a good way to go
Yeah, that'd be ideal, I was just trying to avoid Mixin hell, but if it's not gonna work well on the proxy, I'll go back to trying to do it on the server. Thanks for the advice on that!
Anyone familiar with using Luckperms with Velocity?
yes
Is there a way to (a) get the roles on a particular server, and (b) check a user's permission for a particular server? The server in question is the server the player is actively on
Not sure if when you check a player's permissions it checks for the server they're actively on or not. The lp documentation seems to be written mostly under the impression that it's operating on a single server
That and I'm also rather unfamiliar with the LP api. Read the documentation, but it feels more oriented towards single-server stuff
configure luckperms to sync its data
https://luckperms.net/wiki/Syncing-data-between-servers
then use context
thanks
I don't suppose there's any documentation relating to manipulating the tab list with Velocity?
given that theres no scoreboard API, yet; etc
If i want to use a plugin in all other servers. It's good if i develop one plugin in bungeecord ? or i can add one by one plugin in all servers ?
This is the channel for velocity, not bungee; and it depends, if you can do everything on the proxy that generally makes a good chunk of sense but that's not always possible or sometimes it's just easier/more viable to be on all the servers
Need help registering a velocity command, I'm doing this correctly, right? https://www.toptal.com/developers/hastebin/uxeseruxiy.kotlin
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
No you need to have the result of the “build()” function as the command meta
You can’t just cast it
Thank you! I'll try that
So, can I integrate Spring into my Velocity plugin?
So I tried that, and it still doesn't seem to work
no errors
plugin is registered too
Show me the code
Like the whole file
Not just a snippet
Hey. Is it possible for a velocity plugin to read the hostname that the user uses to connect to the server?
Hey, a questions, is there a way in velocity to do sth. like sending a PacketPlayOutCustomPayload to send the player some message over PluginMessaging?
Hey, how can you enter something in a config in a Velocity plugin and read it out?
It is, see the InboundConnection class for such methods
Does Velocity support 1.18?
yes
Is there a possibility to integrate Configurate 4 into Velocity and deprecate the use of Configurate 3 as happened with text and adventure in Velocity 1.1.x?
It's entirely possible to shade the configuration library you want to use into your plugin. There's very little downside.
this has to be something obvious, but i'm trying to build velocity with ./gradlew build but the file build/libs/velocity-3.1.2-SNAPSHOT.jar is 261 bytes, with only a META-INF/MANIFEST.MF file in it and that's it
go in proxy/build/libs
proxy/build/libs/velocity-3.1.2-SNAPSHOT-all.jar how bout this file
make sure to specify -all otherwise people will come in here and talk about how it won't start

yep that one works
sweet 👍
I do that currently, I mean that Velocity integrates Configurate 3, which is a configuration library that already has a more current, better and stable version
https://bin.birdflop.com/uvudamenug.xml
I have no idea what the issue is but im getting this error
Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) on project VelocityJoinLeaveMessages: Error creating shaded jar: null
update maven shade 🤷♂️
otherwise, can't really say as there ain't too much info there
anyone know a tutorial on making a config for a velocity plugin idk how toml works
you don't have to make your config in toml
how could i in yml then since i know the way i do for spigot plugins won’t work sine it uses bukkit api
Hi!
How can i dispatch command in console from code?
Hey, I was wondering if it is possible to send data between servers, for example: A request Velocity -> PaperMC and PaperMC -> Velocity
plugin messaging
Pass the console command source to CommandManager#executeAsync
Is there a way to get all network servers?
What do you mean by that
Like get all the registered servers?
Is https://jd.velocitypowered.com/1.1.0/com/velocitypowered/api/event/connection/DisconnectEvent.html the correct event for when the player leaves?
Anyone know which event I have to use to change which server the player connects to? seems like PostLoginEvent or LoginEvent doesn't have a .setTarget method or something
or should I use LoginEvent and run
event.getPlayer().createConnectionRequest(someserver).connect()
choose initial server event
Thanks!
i havent touched velocity for like a year, is there any documentation on the config api?
it is yes, but that's just what is bundled
feel free to use your own
I think snakeyaml is open sourced and publicly available
so is Jackson, gson, etc...
not sure, I use jackson or gson
jackson yaml is pretty solid if you want yaml configurations, I prefer json personally
VelocityConfiguration configuration;
try (BufferedReader reader = Files.newBufferedReader(configurationPath)) {
configuration = new Yaml(
new CustomClassLoaderConstructor(VelocityPlugin.class.getClassLoader())
).loadAs(reader, VelocityConfiguration.class);
} catch (IOException | YAMLException exception) {
JsonLogger.error("Error loading configuration: ", exception);
this.server.shutdown(Component.text("Failed configuration load."));
return;
}``` this is what we use in production actually
idk if this is standard or the recommended way but
it's not bad
ahhh i see
legacy ip forwarding doesn't support the velocity in paper.yml does it?
correct, that's for modern forwarding
gotcha
is there a method that gets u the main container or the data folder
Yep
Look at the “getting started” page of the documentation section of the website
I think
there it is
xD
Yee
thank u :d
No problem
Configurate is really good tbf
configurate is built in right because fixed did say it's bundled
yes
epic
But you don’t have to use it if you don’t want to
It just decreases final jar size - but if you don’t care about storage or this is personal it really doesn’t matter
There’s a few good toml loaders out there
If you want a reference on how to use configurate for toml, velocity is open sourced so you can see how it does it
ahh alright epic, i may just stick to yaml for rn 😅
doesnt velocity have like annotations for keys or am i thinking of something else
"Expose"
how do yu determine whether a server is online with RegisteredServer#ping
if throwable is not null then server is offline? else its online?
is there a TabCompleteEvent alternative to use on 1.12.2 and above?
No, the client now handles suggestions mostly on its own
Use the appropriate methods on Command or add a suggestion provider to Brigadier nodes
Okay Thank you
Velocity works on 1.18.1?
Yep
where download dev velocity?
I think velocity has a ci you can download it from, or you can just build it yourself
git clone git@github.com:PaperMC/Velocity
cd Velocity
./gradlew build
# success```
how do you make a command source run a command?
found it
its CommandManager#executeAsync right
is it possible to edit single strings in a component? i.e. i have a placeholder in a string and i want to replace that string with a clickevent
for example someone inputs in a config file
format: {back} Test {forward}```
I could do a component and replace back and forward with their specific characters and click events?
oh it's replaceText i think
yup, that's the set of methods to use
note that you're better off just doing the placeholders before you have a component with a tool like minimessage
ahh epic! is there a documentation on minimessage on kyori's website i assume
yup
epic! thank you :d
Hello, is there any equivalent to ```java
|ChatColor.translateAlternateColorCodes('&', SomeString);
use the legacy component serialiser
a where to pick up the jar file?
after I collected
proxy/build/libs
there are two of them, which one to take to run through
Java -jar velocity.jar?
i am assuming the legacy component serializer wont work for hex colors
since its legacy
it does given spigot shoe horned that crap in
ahhh alright thank you
is there an event that gets the player on login without sending the login message
so i can check for perms
i think its chooseinitialserverevent i hope
is there not a change server event?
the way i did it in my plugin was using ServerConnectedEvent, and then checking event.getPreviousServer() which is an Optional<RegisteredServer>
how would I get the server being connected to
also what is an Optional?
Can I get it to return the server name
nvm I can just getcurrent server
but also returns an Optional
look up how to use Optional in java for more info, but you can use .isPresent() and .isEmpty() to check if it has a value, and then after checking that, you can use .get() to get the actual value
is value in int or string I can't tell from docs
it returns an Optional<RegisteredServer>, so after checking if it has a value, then using .get() would give you a RegisteredServer
insteafd of doing this you could do .getServer() in the ServerConnectedEvent to get the server that they just connected to (this one is just a plain RegisteredServer)
ahh alright ty all :d
how do you use RegisteredServer.ping() properly? is it .whenComplete?
i've been looking into it but i cant figure out how to properly loop through multiple server pings because im trying to make a /glist command that shows whether a server is online or offline as well
serverping just tells me if its off or on but the registeredserver gives me the server information
Pings are not synchronous, it takes time for Velocity to ping a server
Most likely you want to get info for each server from RegisteredServer, ping all the servers then wait for responses to all those pings
just create a list of futures or something, think there is even a Future util which will let you wait until you have a list of them completed
So when I annotate my class with @Plugin, fill in the info package and then open the jar in zip viewer,
velocity-plugin.json appears out of nowhere with the info from the annotation.
This seems very interesting, how does it work?
annotation processor
but for that, I would need to have some kind of velocity plugin installed when building right?
https://github.com/PaperMC/Velocity/tree/dev/3.0.0/api/src/ap/java/com/velocitypowered/api/plugin/ap
thanks, gonna look into it, seems very interesting
It’s the annotationProcessor dep
So that just get's called by my build system automatically at compile time?
#velocity-github ???
looks like someone is setting off a code reformat on the entire bloody project..?
anyone knows how to load an integer from a yaml file? (YAMLConfigurationLoader)
rootNode.getNode("redis.port").getValue(new TypeToken<>() {}),
Doesn't seem to work
@agile ore
ignore me
im doing that accidentally
sorry, i forgot the compare thing
yup! i figured it out haha thanks
yeah! had to figure out how to do it with hashmaps
[19:17:57 ERROR]: Couldn't pass ProxyInitializeEvent to serverstatus
com.zercraft.server_status.internal.redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
Caused by: java.net.UnknownHostException: {redis={ip=127.0.0.1, port=6379, password=somelongpassword}}
at sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567) ~[?:?]
Any idea what's happening here? redis isn't able to connect and the host format looks kinda weird but idk, worked fine on bungee but fails on velocity
UnknownHostException
pterodactyl?
eeeerrrrr
make sure that the Redis server is up & firewall etc
Yeah I know, but using 127.0.0.1 or the actual ip fails, worked fine on bungee and same config works fine on paper servers running on the same machine
nah just starting the server from the shell
Yeah I get you 😅 I'm just confused as everything seems fine, service is up, everything else can contact it fine, can telnet on it,
[19:17:57 INFO]: Listening on /[0:0:0:0:0:0:0:0%0]:25565
not sure if that's normal but guess that's just the ipv6 showing,
also have never seen an UnknownHostException with the message formatted like that, "{redis{ip= etc.."
well, I mean
it shouldn't be
that suggests that something passed in the redis instance or something, but 🤷♂️
yeah, wonder if it parsed the host wrongly or something
does your Redis instance have ipv6 enabled?
should be, config says:
The server only accepts connections from clients connecting from the
IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
sockets.
what do you have it set to?
Found the issue, was using
rootNode.getString("redis.ip")
instead of
rootNode.getNode("redis").getNode("ip").getString();
🙃
It looks like that guy just ran IntelliJ cleanup on it
speaking of that someone should do that, looking at !something.isPresent() annoys me
hehe
Is it possible to Register Brigadier Commands on runtime or do i HAVE to register them on initialization
It seems like my command just wont register...
@EventHandler
public void onPrexorCommandRegister(CommandRegisterEvent event) {
CommandInstance instance = event.getInstance();
LiteralArgumentBuilder<CommandSource> parent = LiteralArgumentBuilder.literal(
instance.getLabel());
if (instance.hasChildren()) {
instance.getChildrens().forEach(children -> {
String label = children.getLabel();
parent.then(LiteralArgumentBuilder.literal(label));
});
}
PrexorProxy.getInstance().getServer().getCommandManager()
.register(new BrigadierCommand(parent.build()));
}
I already debugged everything -> LiteralCommandNode is setup perfectly everything how i want it to be It's just that in game it tells me Unknown Command
Why not
idk actually
why
because it has argument parsing
So now the command is working but it wont suggest the command itself? I have to type it myself any idea why?
hmmm
i have no idea how brigadier works but there is documentation on velocity's website
yes this documentation is crap if we're being honest hahaha The test's in the source has helped me so far
I think I'll try my luck using SimpleCommand
PrexorProxy.getInstance().getServer().getCommandManager().register(
instance.getLabel(), new PrexorVelocityCommand(instance)
);
I don't understand what I'm doing wrong hahahaha The command just won't register
(I'm now using SimpleCommand)
Sorry the command is getting registered but it just won't suggest it
Make sure you have permissions setup properly
What exactly do you mean by "setup"
I mean I can execute the command itself but it just won't suggest it so I have to type it out entirely
That’s odd
are u registering on init
proxyinitialize event
Yes, I mean would the command even work in the first place if I'm not doing it on Init
Is there even a way to register command on runtime?
try using a commandmeta instead of a label call
Ight gonna try that tomorrow, thank you
I mean, afaik there is nothing preventing ou registering commands whenever you want
Just, note that it won't show in tab completion unless the backend server resends the command definitions to the client
So that's my Problem
Can I force the server to resend the command definitions?
don't mention
from paper, there is a method on Player
but you'd need to send a message to the server to do that
Sounds complex you don't got any code example by any chance do you?
stop mentioning
Ah sorry hahah
You'd need to have a plugin on the server and use plugin messaging or something
Hm okay will try that tomorrow thanks for the help
Both approaches didn't work unfortunately I tried using ComandMeta instead of String and I've updated the Commands for the Player
what mc version are u on
1.17.1
I legitimately don't get what I'm doing wrong.... like why isn't it suggesting my commands 😂
electroniccat already told you, new command registrations aren't sent right away to all clients. The proxy waits for a new command tree to be sent by the backend server (e.g. during server switch) to inject its own commands
This is a wontfix since live command tree updates require lots of memory, and arguably this is a bit of an edge case
Hello, I'm encountering io.netty.util.IllegalReferenceCountException after handeling a packet
It seems like it's getting double deallocated somewhere
o shit, just fund out why. Sorry for bothering you
The channelRead function in Minecraftconnection.java automatically deallocates but since I already did that on my side, it throws that error
Agreed. However posting a huge PR without explanation that is almost impossible to review, is indeed kinda bad.
If I use "FORCE_ONLINE" in preloginevent, will a new player receive an online mode uuid? Or will it still be generated using offline mode method?
it does.
For test purposes I created a "TestCommand" and registered it on the ProxyInitializeEvent. The Command still doesn't get suggested if I try to tabcomplete it
Could it have something to do with that I'm using Velocity and Tuinity?
Alright. For anyone ever encountering this problem you have to set "announce-proxy-commands" to "true" in velocity.toml
that's on by default...
well I definitely didn't turn it off... Maybe it was set to false by default in older versions perhaps?
I really have no clue
Nah, has always been true
the fact that that was the problem is so sad and i am sorry u had to deal w such pains

Bruh, why is the modern forge support taking so long?
It was 5 major mc updates ago modern forge came
But only basic support like joining a server?
No need for re-syncing
It's only a small modification in the code and it's done
I have already got it to work and it took about 3-4 hours
Can't understand what's taking so long
Any sane implementation needs changes to Forge as well as to Velocity, and people are busy
no need for resyncing
sigh
yes, if you wanna go for a half baked solution which has many dozens of issues with server switching,etc, yea, sure, it can "work"
if you wanna actually have cross server switching which actually works long term and allows shit to handshake properly vs the years of bastardisation which has consistently caused issues, no, the client needs to support re-handshaking in some respect and resyncing data, etc
hello i am new to velocity development. coming from bungee/spigot development. i am getting this stacktrace and i am unsure as to what to do. cant find anything relating to it on the docs
com.velocitypowered.api.plugin.InvalidPluginException: Did not find a valid velocity-plugin.json.
at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.loadCandidate(JavaPluginLoader.java:64) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:92) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:324) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:222) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.Velocity.main(Velocity.java:64) ~[velocity.jar:3.1.1]```
your plugin is missing the file it says
depends on how you're building the plugin, make sure that you're using gradle or maven
or, if you're using the IDE thing, make sure that you've at least got annotation processors running
(also, make sure that you have the annotation on your main class)
figured out i needed an annotation processor
except im confused on how i actually implement one
velocity includes the annotation processor
like, it's part of the API
do you have the Plugin annotation added or whtever it was?
how are you building the jar?
maven
make sure that you're running the package task and not building with your IDE i'd guess
if i try to do that it just tells me
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project velocitytest3: Compilation failure
if building with maven blows up then you've not been building with maven
however it does build if i use jar
there is a way to see the full output of the task
Well, there you go
in the mven config set the version of java to something newer
(or, update the compiler plugin)
(I have a dream where maven stops using multi year old plugins by default...
yea, I mean, gradle has its own set of issues, but, I mean, outside of tryna learn it it seems to generally be a much smoother experience
true
half of my bungee and spigot plugins are maven so i just got used to it
and the plugin i need to make a velocity port of is maven so thats fun
Why is it that this method doesn't exist but it does on javadocs? https://i.imgur.com/Tbr0Lx3.png
I'm using 3.0.1
Sorry but why do you think that getCommandManager does not exist?
My apologies, I mean getCommandMeta.
and how do you know that it exists on the javadocs? The thing you showed is about getCommandManager
gimme a sec gonna check JD
wait
which version do you use?
previously I was using 3.0.1
but I was looking at 3.1.2-snapshot javadocs by accident
I bumped the version to 3.1.0
oh ok
and it worked
the thing was added in 3.0.2
Mojang has one, it's called online mode
breh
is there a way to get the proxy's minecraft version?
found it
fastlogin does something similar, however if an online player changes their nickname they lose their stuff
building my project (with annotation-processor and api 4.0.0) generates a jar with a velocity-plugin-info.json
trying to load it within the latest velocity (3.1.2) gives an error
that the velocity-plugin.json files doesn't exist
uhhh shouldn't it be velocity-plugin.json instead of velocity-plugin.info.json ?
renaming velocity-plugin-info.json to velocity-plugin.json doesn't solve the issue
as it's now complaining about invalid json structure
yea, but that's the file that it's generating
do you use gradle or maven?
ye?
you are using velocity api v4 on velocity 3.1.2
yeah, I wasn't able to use api v3.1.2 nor velocity 4
why wouldn't you?
- can't find api v3.1.2 in any repo (paper, velocity, central)
- can't find velocity 4 (download page, repo)
just do
annotationProcessor 'com.velocitypowered:velocity-api:3.1.2'
compileOnly 'com.velocitypowered:velocity-api:3.1.2'
in your dependencies
it works for me
what repos are you using
maven { url 'https://nexus.velocitypowered.com/repository/maven-public/' }
make sure to use 3.1.2 not v3.1.2
alright
my bad, 3.1.2 does not exist, use 3.1.0
still can't find it
(talking about 3.1.0)
wait no
Try using the paper repo, might've moved over there
it can only not find the ap now
repositories {
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
}
dependencies {
compileOnly("com.velocitypowered:velocity-api:3.1.1")
annotationProcessor("com.velocitypowered:velocity-api:3.1.1")
}
``` i've been using this
ok let me try that repo
pretty sure I've already tried that
but let's give it a go
nope
also doesn't work
can't find the ap this time either
where's 3
ok using 2.0 works
but now it can't find any events
nvm they just moved packages
uh
the annotation processor has the same name like api
nvm lol now the ap crashes lol
huh?
can you please send your build.gradle again? (the new one)
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
btw, the paper repo might be redundant
np
let me try running it now
nice it works now
just a lil' encoding problem now :p
thanks for the help
badlion client
hmm, ok.
Hi, how can I register plugin messaging channel without colon? I need it for FastLogin becase FastLogin use plugin messaging channel force.
are you sure it uses that channel? To my knowledge, bukkit should also throw an error if you attempt to do that
fastlogin has a velocity port, lemme check
well according to their source code, they do not use channel force at all but only
FastLogin:ch-st
FastLogin:succ
There is a channel named force: https://github.com/games647/FastLogin/blob/main/core/src/main/java/com/github/games647/fastlogin/core/message/LoginActionMessage.java
I've tried FastLogin:succ but it return nothing.
then try FastLogin:force
the protocol literally does NOT allow channels to exist without a :
Tried, but nothing received. I only received: fastlogin:succ
yup, that's why it is really odd
wait, are you using fastlogin on velocity?
Yeah
Then it probably uses lowercase name
If you look at their code for more than 5 seconds, you'd see that they combine it with a namespace everywhere it gets used
and that makes sense, the fastlogin port for Velocity does not use the force channel
ikr?
I've tried it in lowercase
what? fastlogin:force? As I've said, as far as I can see, fastlogin on velocity does not use that channel.
Yeah, exactly: fastlogin:force
they only use succ and ch-st
not force
or at least, I cannot find it
they only register these channels:
this.successChannel = MinecraftChannelIdentifier.create(plugin.getName(), SuccessMessage.SUCCESS_CHANNEL).getId();
this.changeChannel = MinecraftChannelIdentifier.create(plugin.getName(), ChangePremiumMessage.CHANGE_CHANNEL).getId();
Yeah, I receive only fastlogin:succ. But it doesn't contain any other data like username.

I need to add FastLogin compatibility for my Auth plugin in Velocitypowered.
well GL then
😩
tho if your auth plugin is on velocity and fastlogin is also on velocity, why don't you just hook into it?
Does FastLogin for Velocitypowered has API?
no idea
I didn't found any documentation
it should
i mean in worst case scenario you can just hook into it and hope it won't break with future updates
Ok, I found these events: VelocityFastLoginAutoLoginEvent, VelocityFastLoginPreLoginEvent, VelocityFastLoginPremiumToggleEvent but none of these events run when connecting to the server.
This is how it looks like:
@Subscribe
public void onTest(VelocityFastLoginAutoLoginEvent e) {
main.getServer().sendMessage(Component.text("Test message"));
}
I tried also: FastLoginAutoLoginEvent, FastLoginPreLoginEvent, FastLoginPremiumToggleEvent
When I use e.setResult(PreLoginEvent.PreLoginComponentResult.forceOnlineMode()); in PreLoginEvent it changes UUID of player.
Is there any way to keep same player UUID?
you can store it somewhere or generate it on
GameProfileRequestEvent
if you want to know how uuids are generated defaultly take a look in velocity src
But iirc it is done by taking bytes from string OfflinePlayer:player_name and then making uuid from it
Hey everyone 😃
I'm looking to remove certain commands from the 1.13 'command suggestion' system through Velocity.
This event is definitely related:
https://jd.velocitypowered.com/3.0.0/com/velocitypowered/api/event/command/PlayerAvailableCommandsEvent.html
...but it contains no methods (unless I'm missing something) that allows me to cancel the command from being sent to the player.
Any assistance would be much appreciated. Thank you!
Hi, I'm creating plugin for authentication tokens like BungeeGuard, and my question is how I can do it on velocity?
what stage are you currently at?
I think BungeeGuard is built in to velocity btw :)
Now i have all created for bungeecord and spigot.
i know about this, but I wand create own plugin 
Does anyone here know of or have documentation on custom packets via the proxy; specifically keepalive packets?
You access the root command node with getRootNode() and mutate it as you want
maybe thatll help
Is it possible to hide it for a certain player?
You can get the player for which the root node is for with getPlayer(). Do your own logic with it
that's how patches work
patches show the code that surrounds the changes you've made, meaning if you make changes to similar areas of code in different patches then you'll get stuff like this happening
also, #paper-dev
you can somehow ask the developers to correct the translations a little, they have a color in the code at the beginning of each message of the type chatColor.RED
можно как то попросить разработчиков чтобы они немного подправили переводы, у них в коде указ цвет вначале каждого сообщения по типу chatColor.RED
because it is strange to do this if you can set the color of the text inside the message itself
потому что странно так делать если внутри самого сообщения можэно задавать цвет текста
and sometimes you have to call the server like §fLobby§r
и иногда приходится называть сервер, например §fLobby§r
Ooo it looks as though it will help quite a bit, thanks!
its not recommended to use chatcolor over namedtextcolor i believe
Hi, is it possible to get which player sent message via plugin messaging channel?
I found player is stored in getSource() and getTarget() but I don't know how can I get the player from there.
see the JDs
iirc those methods return some object which contains the relative thing
may need to cast towards something else from that result
I looked at JDs but I didn't found anything useful. https://jd.velocitypowered.com/3.0.0/com/velocitypowered/api/proxy/messages/ChannelMessageSource.html
Sorry, I forgot.
I found Player and ServerConnection subinterfaces.
But I didn't found anything useful there.
instanceof Player
Worked, thank you so much!
Actually, it doesn't work. The getSource() is not instanceof Player.
or, well
that assumes that the client sent the message
if it came from the server, see the ServerConnection
I'm sending message in bukkit plugin message channel using: p.sendPluginMessage(main, "test:plugin", out.toByteArray());
oh, so, yea, server connection
Now worked, thanks.
my command just doesnt work. it just says it doesnt exist
this is all the code
im stumped
ive looked at references, everything
cant find anything that works
theres no errors in the editor
and no stacktrace
infact heres it loading just fine
but when i do the command
That’s the wrong Subscribe annotation
You’re using one from google’s event bus - not the velocity one
Since this is so common it might be nice if velocity threw a warning for methods tagged with this
which interface is your command implementing?
i figured it out
i was using Command but i tried SimpleCommand and its working for the moment
Yea thats how the command system works
rn im just referencing off source code i can find on the internet lol
cant really find any forums threads relating to issues with this stuff
those references didnt do much for me
At least the command api is explained there correctly xdd
Really?
yeah
It looks correct to me
it was a lot more of a struggle than just popping in some dependencys
mainly cause my ide refused to build it
What was the issue?
unsure
just knew that my ide was like what is this garbage
and decided not to compile
it did eventually work after a bit of fiddling with the settings
velocity work is a lot different than bungee work
and i have to convert an entire bungee plugin over to velocity soo
yikes
After you get the basics it's much easier and cleaner to work with the velocity api xD
true
it was kinda the same with bungee and spigot
its hard at first but once you have some references and some knowledge on how they work its pretty straight forward
How would I go about executing a console command on a proxied server? (knowing that sometimes the server could be empty)
Tried plugin messages & no luck, or I'm just really bad with them but onPluginMessageReceived just never gets called on the spigot server, despite me in the proxy plugin calling getServer("factions").get().sendPluginMessage(MinecraftChannelIdentifier.create("test", "testchannel"), out.toByteArray());
if the server is empty you can't
otherwise you'll need to make sure that your plugin message channels are registered properly, idk how velocity deals with that one
if you need reliable message sending, use a message broker
i.e. rabbit, redis, etc
Thank you, will look into redis.
anyone know why im unable to load my config
Exception in thread "main" com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: org/spongepowered/configurate/hocon/HoconConfigurationLoader
im unsure of what im suppost to do
i did exactly as followed on the docs for configurate
you are supposed to shade and relocate the hocon loader
plenty of online guides/tutorials for how to shade and relocate libraries for your build tool
it has hocon, gson & yaml
errr, I think that’s configurate v4? velocity only has 3.x iirc
Can someone from the development team update the velocity site, please? Site currently says that the newest supported paper version is 1.17.1, but that's not true, it should be 1.18.1.
Ah, cool.
Wait, github points you to the site. So how is the site deprecated, if it's the main download point for the jar?
fun area where much of our own web content needs redoing, offering downloads on the velocity site directly makes little sense given our own downloads page which is more smrt
I think in the meantime I'll just make the dev build button link to our own downloads page and update the text
Anyone know how I merge player count for sever lists when I have multiple proxies? Can I just return another number on the ping or will sever lists think I'm faking player count then?
(already got player count synced to each instance)
well, what's the server lists' methods of detecting if you're fakng player coumt
Good question haha, was thinking it maybe did a query to get player list
The proxy substitutes the info it has for some stuff in the correct config, iirc
otherwise you'd need to like, sync counts across proxies
i.e. store counts on redis
and then populate the info in the events
I'm trying to make custom events, which Event class do I need to import?
I'm on there, doesn't tell you which class to use...
Look at "Creating an event class"
it says implements Event, which Event class?
From velocity
I though so too, but...
Oh
I think the docs are old..
I've looked in the other events, you don't need to implement anything
Reading the docs again it says under the example;
You'll notice that your events don't need to extend or implement anything. They just work.
But in the example they do implement Event... kinda annoying
really old example. u'll see addListener takes an object not an event instance
u just need an instance of a class with @subscribe on the methods
It doesn’t tell you to implement anything?
message.txt by @visual adder: https://paste.gg/7087b6583b9a41629eb0f95e2be9008f
something apparently managled a packet
given that the auth api at that phase is basically 100% irrelevant, I'd imagine it's some plugin on the server
any idea how i would go about figuring out which plugin it is
as this only occurs completely randomly
lol
then itll only last a few min, 30min to an hour and its done
cleanly, no
most things are often a binary search or modifying the server to try to detect such states
that doesnt sound good
So what steps should I realistically take to fix this?
Find a dev that can modify the server to detect such states?
is it this?
yes
how can you get the server address a player joined with?
Should be in the logs. If not, there are a couple of other files laying around within the server that should tell you.
not talking about plugins, but that could tell you too if it's meant to
So Im struggling with something. Im using the essential player plugin for velocity to handle my tablist and my global msgs. Ive succeeded in altering the source, compiling and running it on my server. But I am struggling to add color to the "join" messages.
The source is as follows, and I thought I could simply just add "&e" in front of it to change the color, so like :
private void connectNote(ServerConnectedEvent event){
Player player = event.getPlayer();
String sendMessage;
if (event.getPreviousServer().isPresent()){
sendMessage = **"&e" +** player.getUsername() + " has joined the "
+ event.getServer().getServerInfo().getName() + " world";
But ofcourse, that doesnt work. Can anyone help me along? 🙂
Cause this, will just output the msg like "&ePlayername has joined the XX world"
^ is probably what you're looking for
Is it possible to not respond to a ping request (i.e. can I "pretend" that a server is offline)?
Does Velocity have a built-in basic messaging channel system like Bungeecord's default message channel?
And can the get virtual host method read from the proxy something like a random srv address (ex. play.server.com) entered by the player on the client?
uh.. well, 1) gs4 isn't the server list ping and 2) im not asking in paper help :')
ah no, i meant for pings coming into velocity with the ServerPingEvent
Ip?
Not that I'm aware of. Try to see what happens when passing null to #setPing
id be surprised if that worked but i suppose it's worth a shot
How did it end up?
haven't got a chance to test it yet, will keep ya posted
ty
I mean technically you could make your listener block for a minute or something so it times out
That's a horrible idea though
Hello I am trying to convert BossShopPro bungeecord part to velocity, a PluginMessageEvent. I tried changing it to velocity functions and still doesn't work, The debug messages even dont show.
Here's the code:
public void onPluginMessage(PluginMessageEvent e) {
System.out.println("result - " + e.getResult());
System.out.println("identifier - " + e.getIdentifier().getId());
System.out.println("data - " + e.getData());
if (e.getIdentifier().getId().equalsIgnoreCase("BungeeCord")) {
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(e.getData()));
try {
String subchannel = dis.readUTF();
if (subchannel.equalsIgnoreCase("BossShopPro")) {
String type = dis.readUTF();
if (type.equalsIgnoreCase("Command")) {
String command = dis.readUTF();
server.getCommandManager().executeImmediatelyAsync(server.getConsoleCommandSource(), command);
}
}
} catch (IOException e1) {
e1.printStackTrace();
}
}
}```
did you use the correct import for @Subscribe? Its not the google one. https://velocitypowered.com/wiki/developers/event-api/
hi all, i am getting a weird Guice error with a Velocity plugin I'm trying to get to run (velocity-api:3.0.1 with the latest version Velocity 3.1.2-SNAPSHOT (git-7bd0f9ea-b114))
[17:05:05 ERROR]: Can't create plugin arcoviaproxy
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) [Guice/ErrorInjectingConstructor]: IllegalArgumentException: ArcoviaProxy does not have a container.
at ArcoviaProxy.<init>(ArcoviaProxy.java:28)
at VelocityPluginModule.configure(VelocityPluginModule.java:48)
while locating ArcoviaProxy
this is literally the whole class, which leads me to believe i'm missing something super basic in my project setup, but I couldn't find any discrepancies while reading the docs
@Plugin(
id = "arcoviaproxy",
name = "ArcoviaProxy",
version = "1.0.0",
dependencies = {
@Dependency(id = "luckperms", optional = true)
}
)
public class ArcoviaProxy {
@Inject
public ArcoviaProxy(final @NonNull ProxyServer server) {
if (server.getPluginManager().isLoaded("luckperms")) {
final LuckPerms luckPerms = LuckPermsProvider.get();
server.getEventManager().register(this, new ChatEventListener(this, luckPerms));
}
server.getEventManager().register(this, new ServerJoinListener(this));
}
}
I don’t think you can register events in the constructor?
oh
my god
yeah I read the section on ProxyInitializeEvent but I guess I decided to not comprehend it, thank you catching that
is the massaging service api is same as bungee?
How does using the EventTask.async() method in Velocity's event handler work differently compared to not using it?
If I use EventTask.Async() , is there no blocking on player handling to do something that takes a long time like a web API?
So, you mean if I apply Thread.sleep(9999 Minutes) 100 times with EventTask.Async() , it won't cause any problems handling other players' events, right?
I was wondering if there is a similar function in velocity like intents of event api used in bungeecord.
but doesn't velocity have no main thread
??? Velocity does not have main thread
ik that I'm annoying, but still not anything?
haha nope, ill get to it and some point dw
will most likely just submit a PR to add the ability to prevent a ping if not

What method should I use to check if a specific server is online among the registered servers to Velocity?
basically, ping it
Is ping() the only way?
Well, yea
only way to see if something is online is to make a connection to it, basically
unless you tracked that state yourself using some form of system
thanks sir
well, before doing that, you could check whether there are some players on it




