#velocity-dev
164 messages Ā· Page 8 of 1
yea then i would need to wait for it im already halfway done porting im just tuck
PlaceholderAPI is a plugin for Spigot servers that allows server owners to display information from various plugins with a uniform format.``` wait whut
in this part
it doesn't have kyori-adventure-platform-bukkit, maybe delete it and see what goes wrong 
then you'll know where it's being used and find alternatives
i mean i cloned the repo
okay
it doesn't have kyori-adventure-platform-bukkit, maybe delete it and see what goes wrong š¤·
then you'll know where it's being used and find alternatives
yea so got a couple of errors
now you know where it's being used and can find alternatives
hmm i'll check
damn its working
it was using adventure for the ecloud list command
i deleted the whole class lol
lol
yes it does, like every single expansion is gonna be using bukkit stuff
so you'll port it but it'll be useless as nothing else will work
I think he's forgoing existing expansions
i only need the math expansion rest my plugin will handle
oh sure, so like the entire point of the plugin then :')
he's basically using it as an advanced replace("xyz", "xyz")
you'd be better off just making a math minimessage placeholder, save yourself some time
or just use the js engine to do math which I'm pretty sure is what that expansion does
like i will limit the number of downloadable expansion
and put some custom coded expansion so that it will work like a smaller version of placeholder api on both bungeecord and velocity
it will be usefull in the future for accessing values across plugins
what
id must be lowercase and cannot contain spaces, numbers or special characters outside of -
Ah, okay
Thank you
Still
ohh I think I know what might be the issue
I was developing a placeholders plugin based on minimessage with support for Paper 1.18.2 and Velocity 3.1.2, if you want to see it, here it is https://github.com/4drian3d/MiniPlaceholders/
Hi is there a way to make a player perform a command to my spigot servers directly without sending it to velocity
Wdym? The command has to always pass through the proxy. If you choose not to handle it on the proxy/if there isnāt a registered command to take it then it will be forwarded to your current server
Like I have created a guild system on my velocity server the problem is that I wanted to add some commands to open guis. As I know, velocity doesnāt support guis, so I registered these guis on my spigot server
and I wanted to forward the command from velocity to my spigot server in order to open the gui
yea, unless a command with the same name exists registered on velocity or a plugin on velocity is blocking it then it should just work
/guild is registered on velocity and I created /guildgui on my spigot server but is there a way to like when someone use /guild gui it forwards it to my spigot server to open the gui?
https://jd.velocitypowered.com/3.0.0/com/velocitypowered/api/event/command/CommandExecuteEvent.html
the full command (without /) can be gotten using getCommand()
you can forward it by: CommandExecuteEvent#setResult(CommandExecuteEvent.CommandResult.forwardToServer())
Iād do something like getCommand().toLowerCase().startsWith(āguild guiā) ā¦.
thank you so much
no problem
pray for australia š¦šŗ
Seems like there could be a way to force a chat message or a command for a specific user and just throw the command downstream - without the event
A better way if your commands use Brigadier is to return https://jd.velocitypowered.com/3.0.0/com/velocitypowered/api/command/BrigadierCommand.html#FORWARD from your executable nodes
There is no clean way to do this with InvocableCommands
I agree; however I assumed since it was a subcommand that it has to be registered; and that wouldnāt be the case if it were a Brigadier command
Is there an event that is invoked if a connected server comes online/shutdsdown?
public static LiteralCommandNode<CommandSource> rootCommand() {
return LiteralArgumentBuilder
.<CommandSource>literal("vss")
.executes(context -> {
//
Component message = Component.text("§4Too few arguments! §e/vss help§4 for help");
context.getSource().sendMessage(message);
return 1; // indicates success
//
}).build();
}
how can add suggestions for my Child commands?
I get this but I have 2 commands [ start, help]
and when I input anything I get this:
Please do not use legacy color codes with components, it is the worst combination. If you want to use that kind of deprecated characters, use the LegacyComponentSerializer#legacySection
it was only for testing š
first time coding with brigadier so yea I have nothing I can work on
how do i make a command in evelocity
?
the doc seems outdated
this dont work
the interface is empty
Is there a tutorial for SimpleCommand, which shows me how I can suggest a list for argument 0, if I enter something or leave it blank and then for argument 1?
And please don't direct me to the docs.
You can look at this: https://github.com/PaperMC/Velocity/blob/dev/3.0.0/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/VelocityCommand.java#L127
You add SuggestionProviders to the corresponding nodes (the RequiredArgumentNodes)
Thank you very much. 
You're looking at the wrong documentation then. See https://velocitypowered.com/wiki/developers/command-api/
Can you add a link to those docs to the channel topic or pin that message?
I'm not an administrator but someone who is can
It's not perfect, I need to explain better the RequiredArgumentBuilder, but I think it works
If any, it should link to the new docs under the papermc domain. https://docs.papermc.io/velocity/developers/command-api
its not marked as such but that's still a bit todo. the velocity docs are a mess right now
but as its been public on the site for a while/not marked as that i'll add redirects for anything changed
Really nicely explained
I have sent a pull request summarizing a little of this tutorial and improving the documentation of the commands https://github.com/PaperMC/docs/pull/46
Is there any way to send additional information to a server that you're forwarding a player to while you're forwarding that player? Things like a location to move them to?
(or really just any arbitrary data)
If you're intending to make calls to a paperMC server without any players connected, your only options are to either use websockets, or some database like system (like redis with pub/sub).
I'm not too sure as I was trying to do something similar, but it seems that plugin messages require a player to be connected to the server you're sending them to.
Yeah, I guess I'll just send something to the target server ahead of time out of band
Was hoping there was an in-band way with login requests or something
But whatever works lol
Is there a stable alternative to "https://jd.velocitypowered.com/" ? 2 months ago it was announced that it would stop working in ||3 days|| but so far there is no replacement as far as I can see
that one is updated
Important service announcement:
jd.velocitypowered.com, ci.velocitypowered.com, and friends will be turned off on March 7th, 2022. I will ensure historical Velocity downloads will be archived and remain accessible.
in velocity discord
oh idk
wait...
"March" š¤
So... will it still be available or will it move with the other PaperMC javadocs on https://papermc.io/javadocs ?
probably get moved? since everything else is getting moved
When things go get moved, will there be a single source of truth for docs? Right now I get most Google results going to the ReadTheDocs-style site instead of the wiki where current docs seem to be
Making a plugin with a gui, however all my item lore and names are italic
setItem(49, new ItemBuilder(ItemType.EMERALD).name(VelocityChat.color("&a&lCreate new")).lore(VelocityChat.color("&7Click to create a new announcement")).build());
Disable the italic on the root component
this is gui stuff in velocity - I don't think it's supported at all
but yeah - you need to explicitly disable it, if that doesn't work then 
Cheers you two, ill try that
At some point, yes. Although papers jd stuff will be changed as well in the future. For the moment jd.velocitypowered.com is your best bet
#paper-dev message source
Worked! Thanks
Does velocity have some documentation on it's internal structure? Been reading through it's network code for a while and some things there are kinda confusing
Wait, GUI's are supported in Velocity?
no
Unfortunately, Velocity implementation is mostly undocumented.
GUIs are not supported but, I mean, it's just packets
I know that there exists some Library for it
No
š¦
RegisteredServer rs = proxyServer.getServer("servername");
boolean rsState = rs.isPresent();
rsState should be true, if the server is online, right?
No
no?
okay
then I don't have any ideas, how I can check, if a server is online š¤£
can someone tell me, how I can ping the server to check, if it's online?
I don't get it to work
have you looked at the javadocs?
Generally the only way to know it's online is to ping it or have some external system which tracks that
That could be a problem. I needed over 3 months to understand the discord.js docs. JavaDocs are a little bit harder š
the ping method is not the latency, right?
wrong ping
So I have to do
CompletableFuture<ServerPing> result = registeredServer.get().ping();```?
youāre motivated to add a complete listener to that. If thats not an option force it to wait with .complete() but be sure to catch any exceptions that might be thrown
where do I need to add the .complete() ?
the .ping() gives you a future that will be completed at some point. if you want to wait for it to complete then do .complete() to wait for the future
this may thrown an exception if the server is down or some other interruption occurs
That's the reason I want to ping the server ^^"
I want to check, if it's online or offline
Do I have to do it like this?
Btw. I saw, what you wrote here, Five š
sec
@Inject
private ProxyServer proxyServer;
public boolean testIsOnline(String serverName){
Optional<RegisteredServer> toTest = proxyServer.getServer(serverName);
if (toTest.isPresent()){
RegisteredServer server = toTest.get();
try{
ServerPing response = server.ping().get();
return true;
} catch (Exception err){
// Ideally check for IO error or interrupt here
}
}
return false;
}
something like that
I get an error, when I insert that into the code
my bad; it was .get() remembered wrong
is this intentional
Thank you ^^
Hi, where can I change this text?
you can't - velocity does not support removing attribution
I just have a few proxies and I need to know which one the player is on
I was thinking of writing a number there
Hello, is there any way to execute the command via console on velocity? Like dispatchCommand on bukkit
thanks a lot bro!
is there a way to get players ip via PostLoginEvent?
havenāt looked at it. Will on the weekend
PostLoginEvent#getPlayer().getRemoteAddress() returns an InetSocketAddress from the player
thanks
That text is set by the minecraft:brand plugin channel
The payload is a single UTF-8 string
Thanks
It looks like Velocity adds its own info though by MITM'ing the packet: https://github.com/PaperMC/Velocity/blob/2586210ca67f2510eb4f91bf7567643f8a26ee7b/proxy/src/main/java/com/velocitypowered/proxy/protocol/util/PluginMessageUtil.java#L123-L140
I think just adding the word "Velocity" to it
Yes, I have already found this class
Now I'm trying to output this value to the config for convenience
ive got a very simple problem and its kinda awkward that i have to ask that but i never worked with path objects and i want to create a config file for my plugin so..
how do i create my plugins directory using this datadirectory path?
nvm got it
Thank you for the nice explanation! It did really help me understand how brigadier works.
But it is really a mess for reading bcs everything is connected in 1 node from the start.
How can you split them?
you could split it into several CommandNode and concatenate one with the other by using an addChild... but personally, I totally prefer the way I explained it
Ok thank you!
how does velocity handle configs?
How to get/set/save them?
someone has an example code?
The wiki is for v4 in Velocity is v3
Do you have any example plugin I could look into?
In the same repository there are examples of its v3 https://github.com/SpongePowered/Configurate/tree/3.x/configurate-examples
Can I text you in direct messages? I really dont get it.
I have no idea how to use Configurate 3, I tried to use it, but it never worked xd In my plugins I use Configurate 4 or Toml4j
Ok then could you help me to get configurate 4 working?
To use Configurate 4 you must shade and relocate Configurate, from there, the Configurate wiki explains its use well https://github.com/SpongePowered/Configurate/wiki
sponge also has a discord
what
did you shade configurate 4?
cos, I mean, whatever you're doing, you have a version mismatch
Configurate?
im using simple yaml
yes, i'm shading both snakeyaml and simple yaml i've tried it doesn't work idk it can't find a method
You need to relocate snakeyaml if you're using a different version
As velocity already includes it
ye
it doesn- which version of velocity are talkin about
im using 3.1.2-SNAPSHOT
Let me double check. I'm not very familiar with velocity at all but I swear it does
Not simple yaml, snakeyaml
mh
Simpleyaml depends on snakeyaml and it looks like you've got a version mismatch
So you need to shade and relocate a matching version
Or downgrade/upgrade simpleyaml to match the version of snakeyaml in velocity
ye
apparently is 1.26
btw what you mean by relocating a matching version, like i know how to relocate by i mean wdym by matching version
Ignore that part. It'd be a transitive dependency of simpleyaml so you don't need to care. What I meant was ensure your jar ships the version simpleyaml is expecting
i mean i need some features of simpleyaml
i tried using the 1.7.2 which uses snakeyaml 1.26 but it doesn't contain some stuff that i need
so its best relocating
and shading
For some reason I can't run velocity plugins built with gradle if they have redis, I get the following error on startup and don't understand it
This line seems to cause it
implementation("redis.clients:jedis:4.2.1")
I'm guessing it's something to do with the slf4j shading but I can't seem to fix it
lol, found it finally, I was excluding the thing wrong, solution is to change the dependency to this
implementation("redis.clients:jedis:4.1.0") {
exclude("org.slf4j")
}
Iām really sorry; this is a remnant from the log4j bug; thereās a filter in some versions of velocity that collides with that namespace
Iāll put that on my list of things to address if not already taken care of
Yeah saw some old bug related to it but figured it was on my side, thanks!
So I am using protocolize, and its fine the only problem is that I do not know how packet classes are called
(for ex Bungee has a packet class named Chat, what would the equivalent be? Note: not doing stuff with chat just wanna know if there is a list of packets for velocity)
You can look in the Registry
I think it's like StateRegistry or something
don't see it
velocity doesnāt have a scoreboard api yet iirc
protocolize is able to send scoreboard packets
id just have to make like
everything myself
is there a way i can change the max player count?
show-max-players
cool
hi, is there a way I can make a spigot plugin that connects with velocity?
so like, from the spigot plugin i should be able to get the server id
and also redirect players to other servers
channels
can I get the server ID from channels?
Would anyone have an advice on how to open a book with Velocity? I am using Protoclize but believe I need a custom packet. Not sure if anyones done this before?
https://github.com/james090500/VelocityBook/blob/master/src/main/java/com/james090500/VelocityBook/helpers/BookLauncher.java#L47-L69
it uses the custom payload packet last I knew
I'm fairly new at custom packets. Are they accessible through the API or is there a guide I can read up on?
it's not a custom packet
it's literally part of the mojang protocol
Oh, wait, it's now its very own packet
need to know this (or something along the lines of this) too
I plan on maybe rolling out support for book Interfaces alongside plugin intents
My opinion is that proxy doesnāt have to load or keep features open that arenāt being used and specially these tend to create strain even if not required
But scoreboards are still the first ones with that limitations
@nova sparrow @merry trellis https://github.com/bolt-rip/nerve/blob/master/src/main/java/rip/bolt/nerve/protocol/RegisterPackets.java#L32
your pom.xml will need the velocity-proxy (I use system scope & a local file)
public void playDing(float volume, float pitch) {
player.getConnection().write(new DingSoundEffectPacket(position.x, position.y, position.z, volume, pitch));
}
Thank you for the help
Say I want to convert a legacy string to json is the best way really
Component component = LegacyComponentSerializer.legacyAmpersand().deserialize("&6Hello &b&lworld&c!");
String json = GsonComponentSerializer.gson().serialize(component );
Just feels a bit to component from component situation
yes that basically is the best way
the component structure is the middle ground, you need to go from legacy -> component if you've got any hope of getting it back out again into json
Ah that's fine by me. I just didn't want to be doing it a wasteful way!
Ok, hopefully my final question. I've made a plugin on Velocity which puts a fake written book into a players inventory, opens it and removes the book. Basically to create a pop up notification.
Obviously, the problem is that velocity has no way of knowing what original items was in the players inventory, so at the moments it replaced with air.. not helpful!
I assume.. I'd need to send a packet to the paper server to say initiate an inventory update, basically to resend the players inventory back to them... is this possible? Or am I look at this the wrong way
I assume, I somehow need to get the server to send this... https://wiki.vg/Protocol#Window_Items
I don't remember having to put a book into a player's inventory to open a book?
you do now at least, give them the book and then tell them to open what's in their hand basically
ah okay
Hi do you guys know why PlayerAvailableCommandsEvent is marked at Beta is there still some bugs? And will the next version fix the problem?
and could you give me an example of how use it?
to remove some available commands from the list
Iirc it was marked @Beta due to the integration with Brigadier, I think it's safe to use by now. You get the root node and modify it as you please (see Mojang's docs for more details)
How are you guys writing the velocity.toml ? I want to make a config file for my plugin, but I don't know, how I can write my config like you wrote yours š
configurate!
https://github.com/SpongePowered/Configurate
Configurate is a simple configuration library for Java applications that provides a node-based representation of data, able to handle a wide variety ofĀ ...
||toml4j||
Jackson >
is there a way to communicate from server to velocity without a player present on the server? the simplest way I can think of to do that is just add a plugin to velocity with a custom server running to listen for requests but is there a more idiomatic way to do it?
I donāt believe so
Youād need to have a plug-in or something
I'm not sure, but maybe this helps https://github.com/PaperMC/Velocity/issues/68
if that's the way to communicate, that you mean
no
no that's an api that allows you to send messages to velocity via a person connected to the server, I'm looking for a means of connecting without anyone on the server
Lots of options out there, take your pick. Redis PubSub, RabbitMQ, PostgreSQL LISTEN/NOTIFY, ... - the list of ways to talk to two different processes are numerous, you don't need a proxy for that
yeah I'm aware of ways to communicate between servers not using a proxy, just didnt know if there was a way built into velocity
we're using redis
tl;dr: the answer is no, other solutions do a fine job of providing this
cool cool
I personally recommend RabbitMQ, it offers way more options than those other
Is there way to hold an event till a completable future joins? for LoginEvent
Or do I just block the thread
think that events had a continuation thing?
Oh yea found that
Hi guys do you know if there is an event PlayerChangeServerEvent or a way to get when a player change server
Is there a way to use something like ChatColor.translateAlternateColorCodes in velocity?
I mean, ideally, don't use legacy text.
otherwise, if you must, use the legacy serialiser
yes
how i'm supposed to work on yaml file with velocity?
you can use configurate, which velocity ships with (although i dont think it includes yaml stuff)
https://github.com/SpongePowered/Configurate
Configurate is a simple configuration library for Java applications that provides a node-based representation of data, able to handle a wide variety ofĀ ...
Use SimpleYAML
yeah the thing is, i need to have comments
You donāt need to
how i'm supposed to save directly the config then?
config.save(directory)
take a look at that
i use it there
Can I create fakeplayers global tablist using velocity api, or should I create global tab using that api, and add fakeplayers using e.g paper api
how can I get a ip address
like I know InboundConnection#getRemoteAddress
but the problem is how do i continue to get a plain xyz.abc.def.ghi version
// InboundConnection as conn
Optional<InetSocketAddress> host = conn.getVirtualHost();
if (host.isPresent()) {
String hostName = host.get().getHostName();
}
the inetsocketaddr is an unresolved object in this case so getHostName is the correct way to go
and its optional because the client may omit (empty) the field in any type of situation. Protocol doesnt require it to be filled
^
no
Not sure what youāre trying to do
the API does not cover sending that stuff
ofc, you can do it, it's just not something that the API supports afaik
Can a velocity permissions plugin's permissions (such as luckperms) be read by player.getEffectivePermissions() in paper?
No. You can only ask the provider for certain permissions but not get a list because depending on context it may be different
they're two entirely different processes with two entirely seperate chunks of RAM, state, etc, etc
the only way to get that info between the two of them would be if you had a plugin to send that info over, or if your perm plugin lets you get that another way
ofc, LP won't expose "effective perms" for the proxy in the server if they don't apply, which, depends on how you setup perms
LP is also no stranger to conditional permissions so an āeffectiveā permission is effectively worthless
Is there any news on velocity getting scoreboard api?
There is but itās a bit more complicated
Scoreboard will be the first api part to be a privileged api component
And the framework for that is nearly done
Ideally velocity should only inject in scoreboard communication if a plugin requires it and by requiring plugins to declare intentions so the feature can be deactivated while itās unused will save CPU and resources
Ideally by the next release everything except commands will require declaration
For now this is going to be the first step
should I use gradle kotlin build script for velocity or not? (iirc for paperweight userdev I used gradle kts)
I mean, use whatever build script format you want
just note that kts tends to be more supported in these parts
Privileged?
Thatās just a fancy way of saying you need to tell the proxy that you need it.
@fossil sundial thanks
what will it look like for kts? I'm not good at it, I haven't had much contact with gradle
is there a way to display ä,ö and ü properly in a textcomponent?
You use utf8
make sure that your compiler is configured to use utf8 and that your source files are in utf8
alright
^
Take a look at other projects using kts, etc
umm, any examples?
no
Is there any possibility to publish the current progress in a separate branch for experimentation and feedback?
should it be enough?
add annotationProcessor("com.velocitypowered:velocity-api:3.1.1") under dependencies as well
otherwise looks fine. you can also replace the velocity repo with the paper repo as the velocity one is deprecated, https://papermc.io/repo/repository/maven-public/
with old repo i cant use 3.1.2 version, with actual repo it should works?
3.1.2 is a snapshot still
Awe you decided to not make brigadier an intent?
not yet
what are differences between that?
one is asynchronous one is not
hey, im trying to build the proxy module, but it is not showing up in my maven repository, is there something special i need to do? api and native show up in my repository
i did build it the way the readme tells you
The proxy part is not api. It will not show up in maven because itās not designed to.
yeah i realize that now
is there a way to get my plugin instance?
would i just implement the plugin or plugincontainer class?
I think you could do server.getPluginManager().getPlugin("plugin_id"); if I'm not crazy to get the container and then the instance
this is kind of confusing, is my main class my plugin instance?
The one you use the @ Plugin annotation on is (sorry random person named sub, I'm dumb)
It's the entry point
okay
is there something i can implement/extend?
cuz i have a non-platform specific command api and the way it works is checking instance of proxyplugin, javaplugin, etc
so i need an equivalent for velocity
there is no equivalent, you'd need to make it up
well originally i was registering commands using the proxyserver instance which i have no issue retrieving
but i dont know if thats proper
as in spigot and bungee you register commands through the plugin interface
well you're supposed to use the proxyserver's command manager
ah okay i guess that makes sense
private void setupCommands() {
CommandManager commandManager = this.server.getCommandManager();
for (String command : new String[]{"glist", "server", "shutdown", "velocity"}) {
commandManager.unregister(command);
}
...``` as such
the command manager is a global thing
commands aren't tied to plugins
Hi, is there a Component that allows backline? One that basically does \n
Component.newline()?
you can also just use a newline character in most cases
and you know why colors with § dont work when going to a newline
becuase legacy section sign colouring is not supported at all inside components
don't use them
okay
because Ive created a system to send messages to players between my velocity instances
but I cant really send any other color sign that §
So ig imma create a parser for this
yes you can - you can use the format minecraft uses to transfer components over the wire
adventure's gson serializer handles this
or, if you wanted to use the legacy format for whatever reason, you can just use the legacy component serializer
im not using json, im using bytes lol thats why
what do you think bytes are?
yes, and that's everything
ik
these messages are bytes
yh
so ofc you can turn a json string into bytes
thats why I actually do
but the thing
is that I prefer not using json bc of performances
Do you know Charal?
have you genuinely noticed a performance issue
or are you just preemptively optimising for no reason
its a big company that made an minecraft event recently. It uses something that sent a lot of packets
and the developer used json but that was pretty risked and finally their server crashed
there is no way that transferring json caused a crash lmao
no I just dont want to change my system after
look, minecraft uses json in every component related packet
it did, like they created a system that showed all the players around x blocks on all servers even if we werent in the same server
what has that got to do with json?
and thats why a simple game consumes a lo
bc to send the packets with rabbitmq to others servers
they used json
and it took so many time
I really dont want to change my system after bc it will be a lost of time
i mean that sounds completely unrelated to sending json encoded chat packets between servers
bc it sends a lot of messages
chat messages are going to be infinitely less intensive than players
don't waste time, use json and just change it later if you notice an issue (you wont)
How can I connect a player to the server and automatically set his location? For example, if the player uses /test, he will teleport him to the given server and coordinates 0 0, but if he reconnect, it is in the place where he was
you need a plugin on the server and the proxy for that.
the proxy can send the extra tp request to the server via plugin messaging
Oh, ok, thx!
And one more question. Can I somehow send console message to the plsyer's current server?
plugin on the server and proxy and send a plugin message
This would be the perfect case where the login plugin messaging api velcoriy provides would be useful; sadly however paper doesnāt support it as api yet
it's kinda been on my todo list but I didn't figure out the best way to really expose it nicely given the existing API
Iām all for doing it like itās done on velocity- with a callback
How to show title using velocity?
Thank you
also another question, why does the /server command not work
?
I think you dont have the permission
Hey all, Iāve been developing a velocity plugin and would like to get some basic communication back and forth between the velocity plugin and the bukkit/spigot plugin (in production there are 6 servers in the network). Iāve been reading all the docs I can find.
To communicate between plug-ins on the various servers in the velocity network (including the velocity server itself). Can I just create a custom PluginChannel, register it on both servers and send information that way? Does this require a player to be online or is it possible to send the message as the server? I figure if this is possible I would just setup an event listener when the servers receive messages on that channel.
Am I understanding this right?
@woeful granite I wrote some code that uses PluginChannel a little while ago and I think you're on the right track. If u want I can send you some code later but I'm about to sleep rn š
Honestly that would be super helpful. Iāve been looking at some existing plugins but I think it will be much easier to understand whatās going on with a simpler implementation. Thank you, and no rush at all.
Yes, you''d just register the channel on the proxy and it'll let you send stuff back over
it needs a player online as it just hijacks the players connection for it
if you require reliable/without a player, you'd be better off using some form of message broker
e.setResult(PreLoginEvent.PreLoginComponentResult.denied(create(configuration.getNode(webMsg).getString())));
I'm just stuck in "Connecting" until it timed out on the client
not sure if this is a bug or am I doing something wrong?
@fossil sundial did you look into that issue I talked about over the weekend btw? https://github.com/PaperMC/Velocity/issues/633
@woeful granite I guess I was mistaken. I remembered looking into cross-server messaging with velocity but that notion I think was misguided. You might look into using something else in addition to velocity. So yeah pretty much what electroniccat said.
Redis is a popular solution I believe.
Nope
The command straight up doesn't exist
All other default commands do
also should mention that it responds in the console, just not for my player (or other people)
latest snapshot
If you don't have permission, it doesn't exist for you
In Velocity, if a user (or the console) does not have permission to execute a command, the command will be hidden and when the command is executed, it will be sent to the server where the user is connected (in case the executor is a player) ||and to think that in bungeecord it shows you an error message, how antiquated||
I have the * permission in LPV
then use /lpv verbose command (username or "me") "command" https://luckperms.net/wiki/Verbose
Hello! How can I dispatch command with velocity API, when I'm using spigot API, it's method Bukkit.dispatchCommand(consoleSender, command). Is it possible to do that with velocity?
proxyServer.getCommandManager().executeAsync(CommandSource sender, String command)
Command source is either a player or the proxy with proxyServer.getConsoleCommandSource()
thank you!
Side-note if you donāt want this to fire a CommandExecuteEvent you could also use .executeImmediatelyAsync(ā¦)
okey, thanks for note about it 
hey, i've got a problem with my velocity proxy or with a the plugin api. i wanted to code a warp all players to a server but proxy.getServer(...) returns an optional datatype. this is why i cant warp any players to a different server because it wont accept a optional data type
any ideas?
Can I get luckperms prefixes / sufixes from database or should I do it with their api?
you should do it with their API
Is there a way to move player from one server to another using API without firing ServerPreConnectEvent?
Not really - what are you trying to achieve
player#createConnectionRequest does not work but without any exception throwing
did anybody got an idea
you have to use .connect or .fireAndForget, see https://jd.velocitypowered.com/3.0.0/com/velocitypowered/api/proxy/ConnectionRequestBuilder.html
Is there a way to dynamically register/unregister servers in velocity?
Thank you š
Doing fakeplayers tablist using velocity api is a good idea or doing it with paper api is better way?
Paper, purely based on the fact that the api is very limited on velocity
Ok, and what about global chat and direct messages between the servers? Better way is doing it with paper or velocity is ok for it?
You are trying to initialize your plugin in the constructor. Don't do that. Listen to ProxyInitializeEvent. The init block is the Java class constructor.
In relation to this, when is tab/scoreboard api releasing?
Oh yes, thanks
I said this once and Iām going to say it again, I donāt do ETAs. Iām welcoming to outside contributions though since I seriously donāt have the time currently
hello, I have problem with executing command in velocity api
server.getCommandManager().executeImmediatelyAsync(server.getConsoleCommandSource(), "/adminchat example");
/adminchat is command from my other velocity plugin
It doesn't work, also in console there aren't any errors
I guess, remove the /
define "doesn't work"
tried using a debugger and stepping through it?
is the command registered properly in the proxy?
etc
it doens't execute command
yea, I can use this command in minecraft
this is my code, message is sending, but command doesn't execute
What does the command do? Do you see any output/errors in the console?
You're executing the command for the console, not the player
So the player will get no feedback about the command execution
it send message to all players with permission
Can we see the command implementation?
first thing I see is a blind cast
where?
literal first line of your execute methods
oo
So Audience sender = (Audience) invocation.source();
Hello.
port = ((VelocityConfiguration) server.getConfiguration()).getBind().getPort();
I have this thing in my velocity plugin
using maven to compile, error:
pom xml here
pom.xml by @elfin gorge: https://paste.gg/a26c4e396a5d4749bcf651b6942aaae6
port = ((VelocityConfiguration) server.getConfiguration()).getBind().getPort();
If I remove this line, the plugin can successfully made.
yes it's a plugin
Yes and this makes sense
You also donāt need to use proxy internals to get the proxy port
Thereās the ListenerBoundEvent
You can get the port form that
this line is triggered when the plugin enabling
I just want to store the port in somewhere
so.. I think I don't need to use event?
The config isnāt exposed for the reason that the data there may not be accurate. What youāre reading in the config maybe transformed by the system so the port or address may not match
This is the sole reason it isnāt exposed
But to get rid of that error you need to compile against the same java JDK version as velocity
I changed the jdk to 11
but there's still some error
git bash: mvn clean install
instead, I can build using this clean install in the intellij
Velocity builds against JDK 17
alright, it's working
I'm using 3.1.1 velocity build 98
so.. should I build the plugin with java 17
it should be better... ?
----------Another question--------
In waterfall, I can set the player's uuid in PreLoginEvent
Is it possible to do it in the velocity ?
How to check if a server is joinable?
Literally all you can do is try
API wise
Like how do you check if a server is joinable
Whitelist etc
You literally can't
Velocity doesn't know if you're whitelisted or not
velocity doesn't know if the server is full or not
Unless you're storing that data somewhere that velocity can access it, the only way to know if X player can actually join a server is to join the server and see if it allows you in or not
I guess? But honestly doesnāt matter a lot for normal plugins
GameProfilRequestEvent
Note for that event: whatever you set will be ignored if you have forwarding disabled (to not break the client)
^
depends
Works on velocity well enough imo
Unless you need data from the server
many people preach for offloading stuff on the proxy, but, bearing in mind that the proxy doesn't have the info that the server does if you're wanting to deal with stuff like prefixes, etc
Would it at least be possible to check if the server is online via ping
If so what method of ServerPing tells if it's online or not
yes
Youāll get an exception instead if the server isnāt online
I can't seem to find a method under ping isOnline or whatever
You wonāt get a ping response is what Iām saying
If you want this to run if the ping fails youāll need something that also accepts an exception as continuity
Or a separate .exceptionally(ā¦
I had no idea thenAccept did not run if the server was actually offline?
That's even better.
Thanks.
Someone correct me if Iām wrong here but Iām pretty sure thatās how it works with futures
Yea, you'd either have an exceptionally or whenComplete, iirc
Ah whenComplete was the one I was thinking of for both thanks cat
Just to confirm
ifPresent/isPresent is regarding to
[servers]```
Not toml try = ["shard_1", "shard_2", "shard_3", "shard_4", "shard_5", "shard_6", "shard_7", "shard_8"]?
Iām a bit confused to as what youāre asking but Iāll assume youāre asking about proxyServer.getServer(name)
That's right
The is/if present there is only about whether the proxy has a registered server by that name or not
Nothing else
How does the proxy register a server?
Via this list?
[servers]
# Configure your servers here. Each key represents the server's name, and the value
# represents the IP address of the server to connect to.
shard_1 = "172.18.0.1:3001"
shard_2 = "172.18.0.1:3002"
shard_3 = "172.18.0.1:3003"
shard_4 = "172.18.0.1:3004"
shard_5 = "172.18.0.1:3005"
shard_6 = "172.18.0.1:3006"
shard_7 = "172.18.0.1:3007"
shard_8 = "172.18.0.1:3008"```
Either through the config like that or using the api
proxyServer.registerServer(ā¦)
How do I get this list?
Oh hold on
getAllServers()
Lovely
proxyServer.getAllServers()
Yea
Judging from this youāll probably also want to check out the ChooseInitialServerEvent and the KickedFromServerEvent.RedirectPlayer
So a good way to get a list of online servers would be to iterate through .getAllServers(), pinging them all, .thenAccept'ing them into the list
Or there is a better way you'd recommend?
That works but be sure to make that list access thread-safe
How?
What does this mean, first and foremost
Thread safety in this case is about data integrity.
Make sure youāre not writing to or reading from the same data from more than one angle at the same time or this stuff blows up basically
The SynchronizedSet or one of the dynamically mutable sets from google guava may work for this
Youāre concentrating multiple threads/tasks into one end. Chances are youāre doing two things to it at the same time, and to prevent this from blowing up you need to ensure whatever youāre writing to is equipped to handle those scenarios
thank you.
so I'm guessing building on an m1 mac isnt supported right now? My first time cloning the velocity repo and I get a missing dep error when I try to build for netty-transport-native-epoll-4.1.75.Final-linux-x86_64.jar
or am I just totally missing smth
I mean, it's just a dep, it should pull it just fine?
well idk, it says it only looked for a file in my local m2 repo
* What went wrong:
Could not determine the dependencies of task ':velocity-proxy:shadowJar'.
> Could not resolve all files for configuration ':velocity-proxy:runtimeClasspath'.
> Could not find netty-transport-native-epoll-4.1.75.Final-linux-x86_64.jar (io.netty:netty-transport-native-epoll:4.1.75.Final).
Searched in the following locations:
file:/Users/jake/.m2/repository/io/netty/netty-transport-native-epoll/4.1.75.Final/netty-transport-native-epoll-4.1.75.Final-linux-x86_64.jar
> Could not find netty-transport-native-epoll-4.1.75.Final-linux-aarch_64.jar (io.netty:netty-transport-native-epoll:4.1.75.Final).
Searched in the following locations:
file:/Users/jake/.m2/repository/io/netty/netty-transport-native-epoll/4.1.75.Final/netty-transport-native-epoll-4.1.75.Final-linux-aarch_64.jar
actually, pretty sure that file exists
on no, only one of them exists
It only looked in maven local doe?
apparently, thats what the error says
I literally just cloned, and ran ./gradlew build
I mean, it failed to find the native for x86 and aarch from there, so, er
maybe relevant that our repo is shitting the bed, but, surely that woulda shown up in the list as a place it looked? o.O
err well I just deleted the 4.1.75.Final folder from my local repo and then it works
so who knows what was happening
well, the thing likes to cache where it pulled something from and stick to fetching from there, so, something went sideways
how do I determine if a player is connecting through a forcedhost?
hello, does anyone know how can I sync permissions from database to velocityās permissions ?
I guess itās related to PermissionsSetupEvent but I donāt know how can I do that
that event is where you register your permission provider
the provider can recalculate its perms whenever it wants to, i.e. you can pull them on setting the provider, periodically, etc, velocity doesn't care about that
This is likely a noob thing but im getting this error, how do I make intelij shade a velocity plugin (maven)
java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser
I have it added like this
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
</dependency>```
you need to make sure that you setup the maven shade plugin
is that like an intelij plugin or part of maven
it's a maven plugin
you just add some things to the pom
this?
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<!-- put your configurations here -->
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>```
yes
then i do package?
yes
check the build log
shade didn't run
do i use this package
yes
the default scope is what i want right?
default scope was compile iirc
ig my problem is shade not running as u siad
anyone have suggestions
can gradle shade
yes
i would say, on maven it's easier
basically not
ok
well
um
does this look right for plugins
https://paste.gg/p/anonymous/5983cc5ac82b4a1a9be998089ca6d492
why would that be wrong
@jovial timber noah look here
if youāre having trouble with maven
also @jovial timber let me join on vpns on your server!
is it possible to get player gamemode in velocity?
Can I somehow sort players on tablist with velocity api or can I somehow create globaltablist with paper api where sorting is easier imo?
(if it is possible to create the global tab with paper)
@boreal shore not at the moment
so can I somehow sort tab with velocity
no, the api doesn't exist yet
well you see thats the problem
how do I shade it!
if youāre using that mc plug-in for intellij it does it for u
try updating that plugin @jovial timber
Would it be a good idea to start annotating new methods or classes implemented in the API with the @since annotation? Since Velocity is the only PaperMC project that uses semantic versioning, I think it could be applied
i updated it. should it automatically shade the dependancies from pom.xml when i run package
Yeah it should, the auto generated pom works for me
good luck noah!
?
How can I set a player's permission ?
I remember there's a ProxiedPlayer#setPermission
in waterfall
but I don't know how do achieve that in velocity
check out the event, it's like PermissionsSomethingEvent or something idk
Setup
^
Is there a services manager (like in Bukkit) in Velocity?
I just want a simple way to register a service provider and grab it in another plugin
A what now? Sorry youāll have to explain what you mean
Thereās no such concept on velocity
š thanks
still attempting to shade
does it put a shaded jar in another directory or something
im trying to use https://code.google.com/archive/p/json-simple/
it seems to shade automatically if i make a spigot plugin
but not velocity
nvm got it
how do i do run things async in velocity or is it just async in nature
scheduler, also thereās no main thread
how do i get server
the Audience returned by ProxyServer#getConsoleCommandSource seems to drop all messages, is this expected?
i think it's because it's overriding the wrong method here https://github.com/PaperMC/Velocity/blob/acc407a6d5663eaeddf5051dbaaf1f0a30fa77f7/proxy/src/main/java/com/velocitypowered/proxy/console/VelocityConsole.java#L68
(sorry to push you somewhere just to reply there, i got curious :p )
easy PR if you want it, just change that to override the right one
yeah it needs to override the one with identity, component, messagetype?
I guess a nice opportunity to clone velocity and make a PR
yup i think so!
not sure what the difference is between "system" message type and "chat"
seems ok to just ignore
yeah that fixed it
amazing
system is "the system", so the messages are always displayed (can be death messages, etc) and chat is player chat messages (which are ran through the social filter client side, and probably the text filter eventually)
yeah so it probably doesn't matter for console messages
funny how velocity uses the legacy component serializer
yeah the tca thingy does legacy to ANSI so there's no real other way to do it
until adventure writes an ansi serialiser :')
I think it does already
and it would be nice if the named text colors were translated into the proper ansi escape sequences so it worked with light terminal themes
or that might be a paper only addition
currently it results in white-on-white text
but very few people use light themes in terminals anyway
you accidentally added a new line in the imports btw :p
i am one of those people
intellij defaults I guess
gotta love them
only moved from eclipse this year lol
How does ConnectionRequestBuilder#connect() work? I tried using it, but it didn't do anything. Do I have to disconnect the user from their current server before running this?
You should check the result of the returned CompletableFuture. Alternatively, just call fireAndForget and Velocity will deal with that for you
Thanks! Iāll try that tomorrow
How does the forced-hosts config option work? I'd like to make a plugin that replicates this.
Where can I find the code that's in charge of that?
For context, I'd like to run different code on the player depending on the subdomain entered. Each subdomain still points to the same subserver tho but just has a diff function
Figured it out. I needed the following code
String virtualHostStr = event.getConnection().getVirtualHost().map(InetSocketAddress::getHostString)
.orElse("")
.toLowerCase(Locale.ROOT);
System.out.println("connected from the subdomain: " + virtualHostStr);```
Hi, is it possible to write (images) on maps in Velocity?
I guess there's no official api for it, but is there anything unofficial?
need to do that on backend
You don't
It's just all packets
I'm just looking whether anyone has experience with it
Don't really see the benefit of doing that on the proxy tbh. Imo all content-related things should usually stay on the backend
I need it to show a QR code to the player
probably easier to do it in chat
yeah, at least a version 1 QR code should fit nicely in chat.
If really want to do maps, you will need something to convert the image to map data. there are libraries out there for that, but im not sure if any of them would work on velocity. The rest is just three packets, that should be easy, but the map data is a bit complicated
Eeeh, I need QR code of this size. I doubt it would fit in chat
does it really need to be that big? thats quite a lot of data
It will be Authenticator QR code
I think it can't get smaller than that
yup
It can't
yeah then you will need to figure out the map data stuff.
Or just do it on the backend and put them in a void world or black room or something until they have authenticated, then you can just use the Bukkit API and MapCanvas#drawImage

Do you (at least) have any libraries which do similar map stuff for bungeecord?
I can port it to Velocity easily (I believe)
Not aware of any, and a quick search also found nothing.
https://github.com/cerus/maps this is for bukkit, but it is completely packet-based. that might be helpful
Thanks š
Is the velocity forums the only place to advertise / publish a velocity plugin?
Is there something like ore on Sponge or Spigots plugin repo?
not yet. Hangar will have a place for that when its finished eventually as far as I know
Sounds good, thanks!
I'll probably write something up later today or tomorrow. Need to do like one or two more features before I release
Just want to check im understanding this correctly. if i had 100 players on my velocity server and ran this...
AtomicInteger currentPlayers = new AtomicInteger(VelocityMain.getServer().getPlayerCount());
VelocityMain.getServer().getAllPlayers().forEach(player -> {
currentPlayers.set(VelocityMain.getServer().getPlayerCount());
player.disconnect();
getLogger().info(currentPlayers.get());
});
I am assuming the getLogger().info(currentPlayers.get()); would output from 100 to 0? I unfrotunately dont have a lot of players to test with
My ultimate goal is to kick any "alts" from the server and if the alt leave room allow a player to join...
should probably kick first then set or decrement
I don't see the need for that atomic variable, you're already calling getPlayerCount on each disconnect, save that to a variable inside the lambda and then log it
The solution to non-effectively final type usage inside a lambda isn't prefixing everything with "Atomic"
Is there any examples code wise I can look at for storing data?
Specifically, I just want to store a specific hashset
There's multiple approaches, but it's out of scope for Velocity. For example, you could use a database, a text file, etc. depending on its purpose
If the set contains configuration-related data, we recommend Configurate https://github.com/SpongePowered/Configurate Check their wiki for examples
Hey, where are the Recipes stored in paper/spigot/bukkit? wrong channel
- Wrong channel
- provide context towards what you're doing
Oh sorry
is there any way to use ${project.version} from pom.xml in @Plugin annotation?
or a corresponding gradle version property, I don't care which build system to use yet as I've just created a project
cleanly? no
I know it's doable, 2 second google points towards stuff like the maven templating plugin, I'd imagine gradle has a similar thing, but, it's generally not ideal
so if not using that templating thing, I would have to specify version in 2 places, right?
Hello
I was trying to make a caching system.
The idea is to cache data about the player on PostLoginEvent then send it to all Paper servers using plugin messaging.
I realised this might not work, then I tried to send it to the server on ServerPostConnectEvent.
It is working but is there any way to send the cached data to all the Paper servers via plugin messaging on PostLoginEvent?
This is what I originally tried.
@Subscribe
public void onPostLoginEvent(PostLoginEvent event) {
for (RegisteredServer server : proxyServer.getAllServers()) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
...
server.sendPluginMessage(CACHE_CHANNEL, out.toByteArray()));
}
}
well, that will send the cached data towards all servers in which there is a player connected in a state where it can send such data
When I tried to join and the event fired the sendPluginMessage returned false
Maybe I'm trying it in a wrong way, but I really want to send the data to all the servers even if there is no player on it
plugin messaging uses the players connection
if theres no player connected to that server, theres no player to send that data over through
Oh
if you want reliable message sending you really need to look into stuff like message brokers, etc
I might just try to use redis for caching my data, anyway thanks for the explanation.
In Gradle you can use Kyori's blossom
RabbitMQ ā¤ļø
how can i change 'Not authenticated with minecraft.net' message to something else
Hello, can i use velocity with paper in 1.8.8 ?
Because velocity is using java 11 and paper java 8
install both java versions
i did
and run each jar with the /path/to/java for it version
in command line ?
yes
ahhh okay thanks you so much !
how can I send plugin message from velocity to paper plugin?
i try to send the message when the pluginmessageevent is fired with:
ByteArrayDataOutput output = ByteStreams.newDataOutput();
output.writeUTF("Test");
output.writeUTF("Heyo!");
event.getTarget().sendPluginMessage(event.getIdentifier(), output.toByteArray());``` but plugin message listener in paper plugin doesn't catch this
make sure that you registered the channel
also noting that a player needs to be online on that server in order to be able to be sent a plugin message
i registered the channels on velocity and paper, and the player is online
i send test message from paper to velocity, and it works
and i want to send it back to paper, when pluginmessageevent is fired
on paper i registered the channel as outgoing and incoming (with listener)
why do i get this stack? adventure is built-in isnt it?
stack.txt by @nova knot: https://paste.gg/6af726de77cf49dfbd3ae743bc4787f4
probably building against outdated API
i am using velocity 3.1.1 and velocity-api 3.1.0?
that looks like old adventure though
its v4.10.1 tho
so what should i do? i can tell that in the velocity.jar this class does not exist even though i am using v3.1.1-98
i could try using a dev build but i cant think of another fix
ill try it thank you
doing a "stable" release is something I've been asking about doing, just, er, brain, ouch, facedesks
any ideas?
Ok, fixed! I have to send plugin message with server connection, not ChannelMessageSink (event.getTarget())
but then how can I catch the message sent with event.getTarget().sendPluginMessage(//)?
Both the Player and ServerConnection can be a source and a target
You need to check instanceof on the sender
Yes, but I mean how can I catch plugin message on paper, when i do target.sendPluginMessage paper event doesn't fire
event only fires if the channel is registered I think
and the player sending the message is actually in the world
Paperjava getServer().getMessenger().registerOutgoingPluginChannel(this, "x:essentials"); getServer().getMessenger().registerIncomingPluginChannel(this, "x:essentials", new Test());Velocityjava proxyServer.getChannelRegistrar().register(new LegacyChannelIdentifier("x:essentials"));
oh, doesn't care about the channel being registered, just cares about the state and the listener being registere
LegacyChannelIdentifier
that sounds wrong
Legacy is pre 1.13, i.e. not namespaced
ok, i changed it to MinecraftChannelIdentifier.create("x", "essentials") and target works good
thx!
is ProxyPingEvent async?
Yes but no,
It runs on a separate thread for each event but itās an @AwaitingEvent so whatever you do on the event has to finish before the event completes
is there anything like bukkit's PluginDisableEvent on velocity?
no
No because the plugin canāt be disabled.
But thereās a proxy shutdown event https://jd.velocitypowered.com/3.0.0/com/velocitypowered/api/event/proxy/ProxyShutdownEvent.html
If you need to do anything like write cached data before exit this is the one you need
I need my plugin to unregister other plugins from its API in case if someone uses some plugin like ServerUtils to disable or reload their plugin at runtime
You cannot load unload or reload plugins on velocity
That will be done during restarts of the proxy
there is ServerUtils plugin, it uses some reflection stuff to do this
not sure if I should support such cases to be honest
Weāve learned from the mess that is runtime dynamic loading and the horrible issues that come with it.
If at all Velocity may support soft restarts in the future
But we wonāt support things such as this
so I probably shouldn't either, should I?
If you want you can look at how that plugin did it. However be warned it will cause issues and it may break at some point because of internal changes
ok, thanks. one more question: where can I see the full list of fields that I can have with@Inject? and I'd also like to read about how this injection thing works, because there doesn't seem to be much information about it at docs.papermc.io/velocity
Why has velocity Not implemented MiniMessage By default?
afaik it's part of the API now
U sure?
No
make sure that you're targeting the latest snapshot
3.1.2-SNAPSHOT
ServerUtils calls ProxyShutdownEvent for the plugin that's being disabled
and if you really want to detect ServerUtils' disable action specifically, you can listen for the VelocityPluginDisableEvent (PRE stage) from the SU api
minimessage isn't part of the core adventure API, it is a separate module
however it is included in velocity as of the latest snapshot version
There's these https://github.com/PaperMC/Velocity/blob/aa38d3e561862d92c1a62f296cfdb6cdf983871a/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityPluginManager.java#L134 and these https://github.com/PaperMC/Velocity/blob/aa38d3e561862d92c1a62f296cfdb6cdf983871a/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/java/VelocityPluginModule.java#L48
The modern, next-generation Minecraft server proxy. - Velocity/VelocityPluginModule.java at aa38d3e561862d92c1a62f296cfdb6cdf983871a Ā· PaperMC/Velocity
Is there any reason why the ProxyServer interface extends the Audience interface instead of ForwardingAudience when the VelocityServer class that implements it does implement ForwardingAudience?
sounds like an implementation detail to me
Hello, how i'm supposed to ping a server to see if is online?
No result/exception is thrown if offline
There is any code example?
Wdym, that code would be highly situational
So tell us what youāre trying to do
Do you need the result right away
What do you mean?
you need to wait till the ping completes to get a result
Thatās why Iām asking and thatās why the code is highly situational
It returns a future
On bungeecord is pretty easy, on velocity is a pain
ping().get() is how you wait for it to complete while blocking your current execution
Thatāll throw an exception if no data is there

That means that the server is offline?
Yes.
Usually
K seems easy then
Youāre in reality supposed to use .thenAccept(ā¦) and .exceptionally(ā¦) or .whenComplete(ā¦,ā¦)
^
Yeah i saw, thanks
boolean isActive returns if player is connected to the server?
How can I make a command for the plugin so that it reloads after the execution of the command, like:
/velobby reload
?
Hi, how can I create a shorter version of /server lobby, best would be if I could make it "/l"
does the BungeeCord plugin message channel (https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/) work the same in Velocity? (https://github.com/PaperMC/Velocity/issues/247)
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
yes
alright thanks
Hi I'm getting this error and idk why, it should work fine.
The code:
@Inject
public VMain( ProxyServer proxy, Logger logger, @DataDirectory Path dataDirectory ){
this.proxy = proxy;
this.logger = logger;
this.dataDirectory = dataDirectory;
}
I'm trying to use this library https://github.com/SpongePowered/Configurate
But when the server starts that error pops up
exclude the signed stuff
Thx bro!
Thinking about switching from Waterfall -> Velocity. Can anyone give me a rundown of the major differences?
Thanks, does Velocity support plugin messaging out of the box, or would I have to make a custom plugin for this? I'm trying to move a player from one server to another within a bukkit plugin.
it implements bungees messaging channel
Awesome
Hey. I'm starting with writing a plugin for velocity as my first java project. Now, there's the first choice: Maven or Gradle?
I've looked at a few other plugins for velocity, and it seems Gradle is a bit more common, which would of course help with me getting questions answered.
Another question is of course, is there a decent boilerplate project I could use?
there isnāt really but I highly recommend using IntelliJ Idea and the minecraft development plugin to create the project; it sets up most of what you need to get started
Thanks! Got that going luckily š Doing development without a Jetbrains IDE would feel weird to me.
How can I check on proxy if message was send from player or server?
check the source of the message and instanceof it?
this doesn't work event.getSource() instanceof Player player
and I send plugin message like player.sendPluginMessage(...)
and you sent that from where?
cos, if you ran that code on the server, the source will be the server
from paper to velocity
also, see what that getSource() thing returns as I don't recall it being a Player instance directly that was returned but some other object
ah, yea, either Player or ServerConnection
but, if you sent if from paper, that's the server
oh, ok, so If I want to get player in the proxy I have to send their uuid/username via messages?
what?
I mean that player which I tried to get from source š
get it from the ServerConnection I'd guess
are there any velocity plugins, which are made with maven and use bstats?
Maven is bad
yet still the only thing that works on my pc c:
you add the repo, and add a relocation pattern to the shade plugin
well, add the dep, idr if they use a custom repo
but, last I knew they documented how to do that
<dependencies>
<!-- https://mvnrepository.com/artifact/com.velocitypowered/velocity-api -->
<dependency>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>3.1.1</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.moandjiezana.toml/toml4j -->
<dependency>
<groupId>com.moandjiezana.toml</groupId>
<artifactId>toml4j</artifactId>
<version>0.7.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.kyori/adventure-api -->
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.10.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.kyori/adventure-text-minimessage -->
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.10.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bstats/bstats-velocity -->
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-velocity</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>eu.prellberg.nick.velocityplus</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
that's the content of my pom.xml
it should be working
as far as I know
but the error I get is: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) on project velocityplus: Error creating shaded jar: null