#velocity-dev
164 messages · Page 9 of 1
you probably also should shade it into something like eu.prellberg.nick.velocityplus.bstats so it does not conflict with your own classes. At least iirc thats the correct way of doing that
and what do I need to add to the class?
Okay. I need to go to sleep now. It's 1 AM for me đ
I made a Metrics Class, but how do I get my plugin id in there?
You create an instance of bstats Metric class
the plugin id you get from bstats when you create the plugin on there
how can I do that?
like you create an instance of any class
Sorry, if I ask too many questions đ I'm a little bit sleepy right now
Okay. :/ I can't get it to work. I'm trying it later.
Good night 
Uhm, is normal that velocity isn't recognizing Title method contained into kyori?
what do you mean by "isn't recognising"?
here is the error
you're building against a version of velocity that includes an adventure api higher than the one your server is using
that specific method was only added one or so minor adventure versions ago
if your server isn't running on 3.1.2-SNAPSHOT then yes
so I don't think there's a reliable way to check if a player truly disconnected if they were connected from velocity
DisconnectEvent fires for various reasons even if they didn't disconnect, you could check if the server is present but that wouldn't work either since there's a bug where if you get kicked the server isn't present in the event
reported the issue a while back but there hasn't been any signs it's getting fixed or even if it's supposed to do that
there's also a similar bug with the kick event so I'm afraid that won't work either
Could somebody point me in the right direction for sending and receiving data from a backend server (fabric/quilt if it makes a difference)
There are 3 ways to do this
Sql: good for large amounts of data, but needs a sql server set up
Plugin messages: easier to do, but requires a player connected to the server
Sockets: doesn't require an external server, works without players online, but is probably the most difficult to set up
Redis is also good for latency, but it does also need a redis server
Yo is there any tutorials on how to use plugin messages in velocity cant seem to find any
Sockets are not difficult to setup - thereâs tutorials everywhere along with tutorials about proper and secure messaging
Thereâs even a tutorial on the javase site about creating an echo server which is all most people need to know about sockets when running an MC server
Any message broker would probably be ideal here, rabbit, nats, etc
I mean, sockets require a central server still, and you're basically going to start going down a potential rabbit hole of solving issues already solved by other solutions
There are message brokers written in pure java which are probs a better bet unless you're just shoving crap together
they're not really all that hard to create, however, it's just a stream of data and a bit of glue
Not if you treat the proxy as the server - but at that point you lose the capability to scale at the proxy side
sending data over sql is cancer, but, I mean, within this community, theres hosts which don't think MySQL servers are even important enough still (and people still stupid enough to be paying them) o.O
I mean, that's just making the proxy your central server
Yeah but that solves the âwe need a third part serverâ to help host
for private stuff, generally, prefer a broker
Either way - rabbit or nats is going to be better than whatever people could whip up in the 10 minutes itâd take to make a socket system so itâs better that way
for public plugins, bahahahahaaaa
Well yeah
Just implement all the brokers, ez
there was some benchmarks somewhere, I kinda wanna say that velocity was slower in some respects but more stable overall vs what bungee did to speed that up
entity metadata rewriting
they didn't do anything to speed it up, just that horror show means that they avoid resetting the client state properly when switching servers, etc
first connection, idk if anybody ever really compared that
oh no thatâs just because mojang added a 2s delay before closing the âLoading terrainâ screen
Mojang stupidity!
yup
Shouldn't
@Inject
@Named("pluginIdHere")
private PluginContainer container;
correctly inject the plugin container for the specified id?
plugin manager has bindings for it so I'd assume it works 
hm
you can try debugging by injecting the com.google.inject.Injector and using Injector#getAllBindings()
Yes but you canât inject yourself, only other plugins (dependencies)
Yea that makes bungeecord even slower because they send a redundant respawn packet
I have never been able to reproduce a scenario in which this event doesnât fire when a user leaves the proxy. For the rest Iâve had next to no time, heck, Iâve barely started on the snapshot process. I didnât overlook this and Iâm sorry itâs taking so long
just /kick
server is null
the problem is, I only want to detect if they disconnected if they truly connected to the proxy, like were connected to a server
but you can't, because if you get kicked server is null
Thatâs the part that confuses me- whatâs the login-state during that issue?
unsure
If itâs not PRE_SERVER_JOIN then the server is present when the event is fired
someone responded to the issue trying to break it down, idk if you saw
it's really easy to replicate at least
How does one listen for plugin messaging channels on velocity?
I can't manage to figure it out
can that get pinned? it was pinned in the velocity discord
is there an api for config files or unlike bukkit do I have to take care of this myself?
Velocity ships Configurate
But you can just shade and use whatever
Any thoughts as to why this (paper-API code)
this.getServer().getMessenger().registerIncomingPluginChannel(this, "trials:request", new RequestListener());
would not receive requests from this?
player.sendPluginMessage(MinecraftChannelIdentifier.create("trials", "request"), new byte[0]);
the player is on the server
Youâre sending the message to the player
You want to send it to the serverconnection
ah
thank you! works perfectly
When I use shadowJar plugin with velocity api should I use jar builded by shadowJar task as the plugin jar, right?
i mean, why would you use the shadow jar without using the shadow jar
Iirc it ends with -all.jar, and yes, you should use that one
Im working on converting some classes from bungee to velocity can anyone help me with that and is it ok to ask here
yes
ok
TextComponent component = new TextComponent(TextComponent.fromLegacyText(pData.get("message").getAsString()));
if (pData.get("clickEventAction") != null)
component.setClickEvent(new ClickEvent(ClickEvent.Action.valueOf(pData.get("clickEventAction").getAsString()), pData.get("clickEventValue").getAsString()));
if (pData.get("hoverEventAction") != null)
component.setHoverEvent(new HoverEvent(HoverEvent.Action.valueOf(pData.get("hoverEventAction").getAsString()), TextComponent.fromLegacyText(pData.get("hoverEventValue").getAsString())));
for (JsonElement element : pData.getAsJsonArray("extras"))
component.addExtra(toTextComponent(element.getAsJsonObject()));
return component;
}```
Im trying to figure out the TextComponent events having lots of issues
the first link I think i can translate to TextComponent component = Component.text(pData.get("message").getAsString());
but the events are an issue for me
adventure đ„”
use GsonComponentSerializer
this: GsonComponentSerializer.gson().serializer()
so just this: GsonComponentSerializer.gson()
what should i be passing?
ok
GsonComponentSerializer.gson().deserialize(pData.get("clickEventAction").getAsString())
no
why no adventure 
you should serialize your component to a json string
that doesnt look like adventure or is it
then deserialize it back to a Component
i swear their events were like .hoverEvent and .clickEvemt
event
not set
oh
nvm i read ur msg
ur trying to move from bungee to velocity
yeah
yeah if u want to use adventure make ur life easier and use minimessage tbh
the issue is this isn't my plugin it's someone elses who is trying to add a feature to the velocity version that is already on the bungee version
so the classes were just dropped on me
sad
yeah i'd recommend just using minimessage, add placeholders, then use replaceText
and I have never done velocity coding so I have no clue what im doing
ah
ive only done forge and spigot
hence why im just looking to like make it work
though velocity is on like 3.1.2 now or smthn the old documentation somewhat works still
yea
how can I disable these stacktraces?
if this is even possible
also, are there any plugin channels that always have some messages sent through it (to test the listener)? listening on PluginMessageEvent doesn't seem to work, but PlayerChannelRegisterEvent shows that channels are registered.
Listener code:
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.connection.PluginMessageEvent;
import com.velocitypowered.api.event.player.PlayerChannelRegisterEvent;
public class VoiceProxyListener {
@Subscribe
public void onPluginMessage(PluginMessageEvent e) { // no output
System.out.println("e.getIdentifier() = " + e.getIdentifier());
}
@Subscribe
public void onRegisterChannelEvent(PlayerChannelRegisterEvent e) { // shows a bunch of fabric-specific channels and some mods' channels
System.out.println("e = " + e);
}
}
Listener registration code in the main plugin class:
@Inject
private ProxyServer proxyServer;
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent e) {
this.proxyServer.getEventManager().register(this, this.voiceProxyListener = new VoiceProxyListener());
}
You can try the Lunar channel and test with lunar client
minecraft:brand, but that might be filtered out
it seems to be
it's a part of login sequence, so probably it's filtered out
[13:10:15 INFO]: [connected player] l_MrBoom_l (/***:35492) has connected
[13:10:16 INFO]: [server connection] l_MrBoom_l -> main has connected
[13:10:16 INFO]: e = PlayerChannelRegisterEvent{player=[connected player] l_MrBoom_l (/***:35492), channels=[transfer:channel (modern)]}
[13:10:16 INFO]: e = PlayerChannelRegisterEvent{player=[connected player] l_MrBoom_l (/***:35492), channels=[worldedit:cui (modern)]}
[13:10:16 INFO]: e = PlayerChannelRegisterEvent{player=[connected player] l_MrBoom_l (/***:35492), channels=[worldedit:cui (modern)]}
still no output from VoiceProxyListener#onPluginMessage(PluginMessageEvent)
should it be lunarclient:pm channel?
Am I able to listen on the main bungeecord plugin messaging channel on Velocity somehow? I've got these in the main class and getting no logging, even though the backend plugin should be sending messages
You are able to listen to it if you disable the proxyâs builtin ability to use it in the velocity config.
If you need to send custom data to and from a plugin you should really use your own channel and not a subchannel
are PluginMessageEvent listeners called for all plugin messages in all plugin channels or only those channels that the plugin has registered to itself?
Theyâre called for all registered channels on the proxy with the exception of the bungeecord:main channel if the proxy has it activated
The Minecraft channels brand register and unregister can also not be used
^
Reply didnât work
can you look at this? @fossil sundial
sorry for pinging if you don't like it
it's either me doing something wrong or it's a velocity bug
I donât see whatâs wrong here. Other than youâre not expecting anything because you donât have anything registered so this wonât do anything
I have PlasmoVoice plugin installed on the backend (Paper), it should send something through plasmo:voice plugin channel
Theyâre called for all registered channels on the proxy
by registered, you mean only those that I register with the plugin on the proxy, not all client/server-registered channels?
Those arenât registered on the proxy
The proxy only acknowledges channels as registered if (some) plugin registered it
ok thanks
The player/server channel register event exists so you can see whatâs going on and dynamically choose to listen to it (by registering them)
Iâve got a pretty bad headache I hope that was at least somewhat understandable
won't registering the channel (that exists on the server) on the proxy break something?
oh, get well then
No, why should it- the proxy intercepts a lot of things by principle like chat and you can decide what happens before it gets to the server or before it gets to the client
You can totally break plugins and stuff yes
But thatâs to be expected if youâre tampering with data
In any case the plugin message event has a result. How the data is handled is decided by the result (pass it on to the other end or donât)
ok, thanks, I got it
I wish Mojang would add some way to set the custom player order in the tablist
but they won't do it probably, since it will be unused in the vanilla server/client
The current solution is to put each player in a team, and then give the teams numeric names to sort them.
But velocity does not let you do that. 
yeah, that's how I do it (not just I, that's how everyone does), but it's very very very complex way
And that folks is why I switched to Waterfall.
not sure what's better, because I've never used waterfull or bungeecord, but velocity looks more modern to me
Well it is
But if you can't get the functionality you need, then the choice is made for you.
I can dm someone about this actually, but I don't think they'll add it to their internal to-do-list
off-topic: do you have transparent avatar or is it discord having issues or me?
Check my about.
it's very confusing when reading quickly lol
Lol
I have had people complain about it
I had one server permanently mute me for it.
I don't care.
use teams
it works by alphabetically order
so you can't use 1,2,3, 4 and stuff
except if you are below 10
yes, I solve this problem with teams
if i were to set a placeholder for the version string in the plugin annotaton, how would i have gradle (kotlin dsl) replace it on build?
you can use a tool like kyori's blossom to do source file replacement
is there any way to set this thing programatically?
https://github.com/PaperMC/Velocity/blob/5ee96606f6ad55a80f46a4d6b927c9bedf6d7039/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java#L516
you can just listen to the choose initial server event and override that behaviour entirely
okii
how can I modify data that is sent with a plugin message in PluginMessageEvent? should I set result to handled and then send a new message to the target from getTarget() method?
amazing tyty
Intentionally no, would create too many overlaps with plugins. We are open to changing it though if you can make a valid point why it should be exposed
That works, iirc thereâs also the ability to set the result data but I might be mistaken
hey five whats so major abt polymer
I don't see it, so I modified the data that way
no permission
player is opped tho
or does that not mean anything
oh right it doesnt
opped is a backend only thing
Well, velocity doesn't know if the player is op'd
does velocity have a permissions per user thing like bungee did
no
use a perm plugin like LuckPerms
use a permission plugin
gotchu thanks
how do you add a softdepend?
i believe its a tag inside your plugin.yml file
softdepend:
- <PLUGIN>
- <PLUGIN2>
velocity doesn't use plugin.yml
but regardless, here https://velocitypowered.com/wiki/developers/dependencies/
could've sworn this was paper dev đ
Is there a way to ignore a ProxyPingEvent event to hide a server existing without having to use a firewall to accomplish something like this?
anyone have any idea why velocity is freaking out about this?: [23:29:15 ERROR]: Couldn't pass ProxyInitializeEvent to partyandfriends java.lang.LinkageError: loader constraint violation: loader com.velocitypowered.proxy.plugin.PluginClassLoader @5136207f wants to load class redis.clients.jedis.JedisPool. A different class with the same name was previously loaded by com.velocitypowered.proxy.plugin.PluginClassLoader @11a00961. (redis.clients.jedis.JedisPool is in unnamed module of loader com.velocitypowered.proxy.plugin.PluginClassLoader @11a00961, parent loader 'app')
working on something and I just keep getting stone walled by this
you likely have two plugins competing against each other, in that both package jedis but aren't relocating it
how do I get around that?
by relocating it
Yeah how do I do that
depends on what build system you're using
Maven
maven shade/gradle shadow both support relocating classes, suggest seeing their docs/looking at examples
Ok
Hello, so basically im moving to Velocity soon but not used to its API, could anyone of u help me w smth simple ig
im just tryna make a /hub plugin
but dk how to connect player to a certain server
Player#createConnectionRequest
yep
You can close the connection with netty if incomming if beats the limit,but is better an Firewall
if(source instanceof Player player){
player#createConnectionRequest
}

epic thnx
Would I have to set something else up outside of the ProxyPingEvent event handler or is there a way to do it directly though the event handler?
How using maven do you relocate a class
With maven shade plugin
Is there a way to add a new RegisteredServer? I'm trying to add a server on the fly instead of on startup.
ProxyServer#registerServer
I can't seem to find a configuration api in the docs, is there any?
sponge-configurate has its own api docs
how do I register an incoming plugin channel (on paper server) so that the player's client does not know that there is such a plugin channel and cannot send messages over it?
this plugin channel should only exist between the proxy and the server
you check if the message came from a player and if it does ignore it
How can I register plugin message?
I need to send something from paper to velocity
message above you
How can you get a list of all registered servers?
could this get pinned?
Does not work for me so idk
did you register the channel?
on both servers
i donât think you can listen to bungeecord:main
You're not bungeecord ^
If not that explains it
I saw this
That is why I used it
completely different
they're sending bungee plugin channel messages to the proxy to use the built in channel
Oh ok
Thanks
Gotta say paper documentation and naming convention is much better than Velocity
With paper using javadoc was always enough
Still does not work
I do not really know what I am doing wrong
Main class
import com.google.inject.Inject;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
import org.slf4j.Logger;
@Plugin(
id = "runcommandonvelocity",
name = "RunCommandOnVelocity",
version = "@version@",
description = "Send messages from nodes to the proxy",
authors = {"VelocityContributor"}
)
public class RunCommandOnVelocity {
private Logger logger;
private ProxyServer proxy;
@Inject
public RunCommandOnVelocity(Logger logger, ProxyServer proxy) {
this.logger = logger;
this.proxy = proxy;
}
// The messaging channel you're going to use as namespaced:key
private final ChannelIdentifier customChannel =
MinecraftChannelIdentifier.from("skinsetter:runcommand");
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
// Register the custom messaging channel
proxy.getChannelRegistrar().register(customChannel);
// Register an event handler to catch messages for it
proxy.getEventManager().register(this, new MessageListener(customChannel, proxy, logger));
}
}```
MessageListener
message.txt by @alpine glacier: https://paste.gg/c827f142701d4414879f8a350deece7d
did you register the outgoing?
start logging stuff
What can I log more
Yeah but I know that it gets called so what should I log
how do you know it gets sent
You know it gets sent how?
CB has some filtering logic in there which determines what gets out
I mean i know it reaches the point where it should run
CB will silently drop messages
need to make sure that the players connection is in the correct phase to send messages, i.e they're in the world, and that velocity actually send the register thing
How do you recommend me to verify those things
Not too sure
Only reason I became familiar with the filtering logic was through the debugger and stepping into that stuff
I guess I just make a socket than
If it just randomly drops my data
Why the fuck this is not print something when they drop it
did sendPluginMessage have a return value?
no
None of those got trown
I give up for today I guess
I know that luck perms work fine so it has to be something with my message
fucking finally
Changing the name many times worked
[13:59:29 ERROR]: Couldn't pass PluginMessageEvent to runcommandonvelocity
java.lang.IllegalStateException: java.io.EOFException
at com.google.common.io.ByteStreams$ByteArrayDataInputStream.readUTF(ByteStreams.java:454) ~[velocity.jar:3.1.2-SNAPSHOT (git-45cfbdc7-bunknown)]
at xyz.crittterz.runcommandonvelocity.MessageListener.onPluginMessageEvent(MessageListener.java:55) ~[?:?]
at xyz.crittterz.runcommandonvelocity.Lmbda$562.execute(Unknown Source) ~[?:?]
at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:47) ~[velocity.jar:3.1.2-SNAPSHOT (git-45cfbdc7-bunknown)]
at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) ~[velocity.jar:3.1.2-SNAPSHOT (git-45cfbdc7-bunknown)]
at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) ~[velocity.jar:3.1.2-SNAPSHOT (git-45cfbdc7-bunknown)]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:203) ~[?:?]
at java.io.DataInputStream.readUTF(DataInputStream.java:614) ~[?:?]
at java.io.DataInputStream.readUTF(DataInputStream.java:570) ~[?:?]
at com.google.common.io.ByteStreams$ByteArrayDataInputStream.readUTF(ByteStreams.java:452) ~[velocity.jar:3.1.2-SNAPSHOT (git-45cfbdc7-bunknown)]
... 8 more
Now I get this
That is good
Cause it means it works đ
Fuck yeah I did it
Last question does Velocity have something like dispatchCommand()?
^^
explain?
Well overall getRegistrat is weird and commandApi
I like Bukkit's/papers naming conventions more
bukkit api old, velocity new and better
velocities naming can seem weird in some areas, runAsync just feels obtuse and forced
But, at the same point, bukkit is a sloppy design from years ago which favoured "ease of use" over sane design, stuff like dispatchCommand shoulda been on the CommandMap, but, bukkit refused to expose the CommandMap, thus it went into Server instead, etc
at the same point, getRegisteredServers follow general design sementics of ensuring that methods accuratly describe what they do in as little words as possible, Registered is maybe excess because, ofc, they've gotta be registered for them to be stored in the proxy, but, er, yea
I am not saying they are not better in code sense
I just think some names do not make a lot of sense
Here I am, the guy who decided to name the expiry date variable getter for the new public key api getExpiryTemporal
Itâs programmatically a perfect description but itâs a bit hard to understand if youâre new to Java

and we shall forever judge you for it
The problem is I am not new to Java only to velocity
I usually name based on what the thing does instead which name it has in the class
invalid data, apparently
what did you do?
try with a vanilla client, and if you're not doing dev stuff, #velocity-help
Well, we don't support protocol hacks
hey when i kick someone from the server on the backend, can i make it so it kicks them entirely from the proxy?
because i try to specify a kick message but it shows the unable to connect you to... msg
Hey, for some reason my Plugin causes a com.velocitypowered.api.plugin.InvalidPluginException: Did not find a valid velocity-plugin.json. when starting, even tho the Jar contains a velocity-plugin.json which looks fine to me. (I use the Minecraft Dev Plugin for Intellij)
{"id":"velocitybackend","name":"VelocityBackend","version":"1.0-SNAPSHOT","authors":["TeamHelios"],"dependencies":[],"main":"dev.teamhelios.velocitybackend.VelocityBackend"}```
okay it appears something gets messed up when its being build by TeamCity, I am just running gradle build. Is there something else I have to change?
the jar created by my intellij is about 4 kb, but the teamcity build is about 3 kb (its just barebones Plugin, so there shouldn't be much)
but the Jar structure is the same
is the annotation processor specified?
is there a way to make our NA and AU proxy member count show the member count of both proxies
yes
save the player count somewhere in say redis
get the count, proxy ping event
set it
channel messaging i can see then perhaps
oh but abt this, do i have to write a legacy string or can i write a component?
looking at velocity source i can serialize it to gson maybe
i lied
it did not let me
Maybe save as MiniMessage?
Can velocity be configured in an entirely dynamic way?
I don't know what socket addy my servers will be at until after it starts up
@Subscribe(order = PostOrder.EARLY)
fun onPlayerJoin(event: LoginEvent) {
event.player.createConnectionRequest(hub).connect().whenComplete { result, error ->
error?.printStackTrace()
println(result?.status)
}
}
haven't tested much yet but simply doing this with invalid hosts in config doesn't work.
You can register servers dynamically, etc, yes
Yeah IK that much, I just cannot remember how to insert myself in before it tries to connect to something that doesn't exist
registerServer method on ProxyServer?
fun allocate(fleet: String): RegisteredServer? {
val api = DynamicKubernetesApi(
"allocation.agones.dev", "v1",
"gameserverallocations", client
)
val allocation = DynamicKubernetesObject().apply {
apiVersion = "allocation.agones.dev/v1"
kind = "GameServerAllocation"
raw.add("spec", JsonObject().apply {
add("required", JsonObject().apply {
add("matchLabels", JsonObject().apply {
addProperty("agones.dev/fleet", fleet)
})
})
})
}
val response = api.create("default", allocation, CreateOptions())
val status = response.`object`.raw.getAsJsonObject("status")
if (status["state"].asString != "Allocated") return null
val name = status["gameServerName"].asString
val host = status["address"].asString
val port = status.getAsJsonArray("ports").get(0).asJsonObject["port"].asInt
println("Allocated: $host:$port")
val info = ServerInfo(name, InetSocketAddress(host, port))
return server.createRawRegisteredServer(info)
}
but then what? I effectively want to be in charge of deciding where players go as they join
use the ChooseInitialServerEvent to decide what server they will connect to
Ahah TYVM
possibly.. i should've tried that i will when home
Invalid ID for plugin net.linebeck.vbasic.internal.Main. IDs must start alphabetically, have alphanumeric characters, and can contain dashes or underscores.
I assume it means this:
@Plugin(
id = "vBasic",
name = "vBasic",
version = "1.0",
authors = {"Linebeck"}
)
Does this not contain the following described?
Id can't contain uppercase characters
that message should probably get changed a little
How big of a performance impact would be blocking move packets from the proxy?
A bit confused. I am using Simple Commands and I was just looking at the documentation for them and I think I followed it correctly however my command doesn't even show up when typing it. Just making a simple /rules command.
Proxy Initialization: https://paste.md-5.net/zoxasonuqe.cs
BaseCommand: https://paste.md-5.net/ekoyovasam.java
RulesCommand: https://paste.md-5.net/dodevudaki.java
do you have perms for it?
yes
on the proxy?
Aye
Proxy using Luckperms
the perms are just vbasic.use & vbasic.admin which I have both.
When you say verbos do you mean typing out the root plugin in the command?
luckperms verbose
What's odd is that luckperms sees vbasic.use when I go to the web portal for it.
yeah try making them lowercase in your code
When I run the command auto tab complete sees it. It just says "Unknown Command"
because you donât have the right perms, make the permissions lowercase in your code
if you donât have perms for it, it forwards it to the backend server
Hello, I am trying to make a selector server and that when they click on a server I send it to that server. But the problem is that I don't know how to send the player there (I already put the API in maven and etc..)
someone can help me?
click on a server as in a menu?
is the plugin youâre trying to make bukkit or velocity?
then you need to use plugin messaging
thanks?
https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/#connect
Velocity supports this 1:1 as bungeecord does
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Does velocity have a built in YAML api or do I need to get my own?
configurate
Hi - I want to send someone to a different server from a velocity plugin (not spigot) on login. I already have the âRegisteredServerâ and the login event, I just need to know how to send the player himself. I saw something about a messaging channel above, do I have to use that as well or is there just a method in the Velocity API?
I think you have the wrong idea, you could just use the ChooseInitialServer event to set the starting server for the player
Oh, thatâs a thing?
I didnât know, iâll look into it. Thanks!
I probably need something similar for something else though
ask away while I am still online

Well basically this but on a command
on a command?
Yeah, when a command gets executed
commands are only usable post-login to a server for the player
A velocity command
I know, i mean they are already on the server and they execute a command
oh
well then you can make the proxy connect the player to another server by https://jd.velocitypowered.com/3.0.0/com/velocitypowered/api/proxy/Player.html#createConnectionRequest(com.velocitypowered.api.proxy.server.RegisteredServer)
Ahh, I was trying to search for things like âsendâ or âtransferâ on the docs
yea its a bit less straight forward over bungee I admit
And if i wanted to use a spigot command sometime, iâd have to use the messaging channel, correct?
Like this
you want to spoof a command input?
What do you mean by that exactly?
From where do you want to run a spigot command that should do what?
If itâs a command registered in spigot then yes. You should use the bungee plugin channel for that
Alrighty, tysm. Youre the best 
What I see most often is people using npcs that trigger a plugin message to connect the player elsewhere
If thatâs similar to what youâre trying to do then there shouldnât be any issues
Yea i need something like that as well
Npc gets clicked > player runs command automatically > player gets sent to different server
Sounds about right
Awesome
Just know that you canât force a player to run a velocity command from the spigot server
I should have the inital connect already done, that was easy enough
Cause those donât exist on the spigot server
Yeah thatâs why I was saying from the spigot server later
With the plugin channel
Yea we get lots of people that try to macro their npcs to run /server name and since itâs a command on velocity they donât understand why it doesnât work

Canât blame them though, doesnât make a whole lot of sense.
We originally thought about allowing it with modern forwarding but opted against it because brigadier and the horrible legacy command system present on spigot clashed too hard
Iâm currently just basically cooked after working on velocity updates for a positive 8h nonstop
Jeez
https://GitHub.com/Xernium/Velocity is my fork where I work on that stuff. Am not happy at all with the state of things currently

Uff, I wish you the best of luck
Can i send messages from a paper server to velocity?
So i can transfer player from server to server
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Just the bungeecord one? Thought it was not in velocity
Are channel names diffrent?
And is custom data suported?
the bungeecord channel is implemented by velocity
yes, you can set up your own channels and send data over them as long as thereâs a player connection
Can someone tell me if it is possible to make a plugin which sets tablist prefixes? (Because i didnÂŽt find something like Scoreboard teams or setPlayerListName)
iirc Velocity does not have support for tablist and scoreboard yet
Hello, I keep having this issue sometimes when I join the server, is it something on my end? I have no idea why this happens and sometimes doesn't
https://pastebin.com/raw/Gf0kqC35
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
It's failing to resolve a domain, check you network/DNS
or, wait, no, didn't fail to resolve, the connection just timed out, brain fart
so, either network issues, or, DNS đ
How do you get a player for a PluginMessageEvent
either the source or the destination can be casted to something which represents the player
see the JDs
I send a message via paper and give a player with it but how do i get it? ```java
player.sendPluginMessage(plugin, "PARKOUR", out.toByteArray());
[19:21:21 ERROR]: Couldn't pass ProxyInitializeEvent to proxy
java.lang.IllegalArgumentException: identifier is unknown
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:142) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.util.VelocityChannelRegistrar.register(VelocityChannelRegistrar.java:40) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at nl.timnl.dtw.proxy.Proxy.registerChannel(Proxy.java:64) ~[?:?]
at nl.timnl.dtw.proxy.Proxy.registerChannels(Proxy.java:60) ~[?:?]
at nl.timnl.dtw.proxy.Proxy.onProxyInitialization(Proxy.java:48) ~[?:?]
at nl.timnl.dtw.proxy.Lmbda$5.execute(Unknown Source) ~[?:?]
at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:47) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]``` i get this error
private void registerChannel(IChannelIdentifier channelIdentifier) {
proxyServer.getChannelRegistrar().register((ChannelIdentifier) channelIdentifier);
channels.put(channelIdentifier.getId(), channelIdentifier);
}``` called on init.
```java
public interface IChannelIdentifier extends ChannelIdentifier {
void onMessageRecive(PluginMessageEvent event);
}``` The interface.
```java
public class ParkourChannel implements IChannelIdentifier {
private final ProxyServer proxyServer;
private final TeamLoader teamLoader;
public ParkourChannel(Proxy proxy) {
this.proxyServer = proxy.getProxyServer();
this.teamLoader = proxy.getTeamLoader();
}
@Override
public String getId() {
return "PARKOUR";
}
@Override
public void onMessageRecive(PluginMessageEvent event) {
DataInputStream dataInputStream = new DataInputStream(new ByteArrayInputStream(event.getData()));
if (event.getSource() instanceof Player) {
Player player = (Player) event.getSource();
try {
String command = dataInputStream.readUTF();
switch (command) {
case ("SEND"):
sendCommand(player);
break;
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
private void sendCommand(Player player) {
RegisteredServer parkour;
Team team;
if (proxyServer.getServer("parkour").isPresent()) {
parkour = proxyServer.getServer("parkour").get();
try {
team = teamLoader.getTeam(player.getUniqueId());
if (team == null) {
return;
}
Player teamCaptain = team.getTeamCaptain();
Player teamMember = team.getTeamMember();
teamCaptain.sendMessage(Component.text("test"));
teamCaptain.createConnectionRequest(parkour);
teamMember.createConnectionRequest(parkour);
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
}
}
```the class
Nope doesnt fix it
proxyServer.getChannelRegistrar().register(channelIdentifier);
a instance of the class is give in channelIdentifier.
To create your channel identifier you use MinecraftChannelIdentifier.from(ânamespaced:keyâ); ideally
Ah i did now i get this error: [20:06:45 ERROR]: Couldn't pass ProxyInitializeEvent to proxy java.lang.IllegalArgumentException: com.velocitypowered.proxy.VelocityServer does not have a container. at com.velocitypowered.api.plugin.PluginManager.lambda$ensurePluginContainer$0(PluginManager.java:69) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)] at java.util.Optional.orElseThrow(Optional.java:403) ~[?:?] at com.velocitypowered.api.plugin.PluginManager.ensurePluginContainer(PluginManager.java:69) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)] at com.velocitypowered.proxy.event.VelocityEventManager.register(VelocityEventManager.java:343) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)] at nl.timnl.dtw.proxy.Proxy.registerChannel(Proxy.java:68) ~[?:?] at nl.timnl.dtw.proxy.Proxy.registerChannels(Proxy.java:61) ~[?:?] at nl.timnl.dtw.proxy.Proxy.onProxyInitialization(Proxy.java:49) ~[?:?] at nl.timnl.dtw.proxy.Lmbda$5.execute(Unknown Source) ~[?:?] at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:47) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)] at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)] at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:833) [?:?]
You did something wrong in your main class?
Iâm guessing you called the event manager with an argument thatâs not a plugin main class object
Yes and fixed it. Now i get something about hikaricp which i use but it gives this error:
[20:10:21 ERROR]: Couldn't pass ProxyInitializeEvent to proxy
java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariConfig
at nl.timnl.dtw.proxy.storage.database.ConnectionManager.startConnection(ConnectionManager.java:28) ~[?:?]
at nl.timnl.dtw.proxy.storage.database.ConnectionManager.<init>(ConnectionManager.java:19) ~[?:?]
at nl.timnl.dtw.proxy.Proxy.onProxyInitialization(Proxy.java:52) ~[?:?]
at nl.timnl.dtw.proxy.Lmbda$5.execute(Unknown Source) ~[?:?]
at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:47) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassNotFoundException: com.zaxxer.hikari.HikariConfig
at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass0(PluginClassLoader.java:85) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass(PluginClassLoader.java:62) ~[proxy.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
... 10 more```
We donât provide those. Youâll have to shade and relocate that library
Ah thats the problem
https://gist.github.com/Xernium/95c9262c5f70b8791557861bbc09be1b just for future reference as example for plugin messaging if you still end up having problems
I highly recommend you check it out; still needs to be made part of the official documentation
And how to send via papermc?
With the namespace
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("SEND");
player.sendPluginMessage(plugin, "dtw:parkour", out.toByteArray());``` this does not work
The same way but with namespace:key here instead of just PARKOUR
Whatâs your version
this
Or you mean server version?
1.18.2
Did you register the outgoing channel?
Ah that was it
declaration: package: org.bukkit.plugin.messaging, interface: Messenger
I did but with the wrong identifier
Is it wrong to send it via a player?
Still doesnt work
Im gonna use redis
Nevermind i forgot to register the command đ€Š
is possible to check if a command has argument using CommandExecuteEvent?
The event only provides the raw command input and shouldn't be used for parsing
But a dirty solution is to check if that string contains a white space ' ' character
[21:48:58 INFO]: [server connection] Jakubixoo -> arenaBW has connected
[21:48:58 INFO]: [server connection] Jakubixoo -> LobbyBW has disconnected
[21:49:00 ERROR]: Couldn't pass PlayerChatEvent to velocitycore-rafi
java.lang.IllegalArgumentException: plugin is not registered
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:142) ~[velocity.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.scheduler.VelocityScheduler.buildTask(VelocityScheduler.java:70) ~[velocity.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at pl.rafi67000.velocitycore.listener.ChatListener.onChat(ChatListener.java:48) ~[?:?]
at pl.rafi67000.velocitycore.listener.Lmbda$70.execute(Unknown Source) ~[?:?]
at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:47) ~[velocity.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) ~[velocity.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) ~[velocity.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
what's wrong? can someone help
VelocityCore.server.getScheduler()
.buildTask(VelocityCore.server, () -> spammed.remove(player))
.delay(3L, TimeUnit.SECONDS)
.schedule();
my code
you need to pass your plugin instance not proxy server instance
your own plugin instance or another plugin?
own
the object thats generated from the class that has the @Plugin annotation is your plugin instance
you can use the proxyServer to get your plugin container
but I dont see why you would want to do that
^^
.
just pass your plugin instance down to where you run that?
I dont understand your issue
the static call to VelocityCore.server is a big no-no in a fluid environment
but alas I would link you to the apidocs to get your plugin instance
but I cant because one of the other staff broke the velocity apidocs for the time being
sorry
404
package index
and I have question can I reduce "cannot connect to server" console log?
with a custom log filter yes
because I have many players and my console is one big error if any server is off
Optional<PluginContainer> optionalContainer = proxyServer#getPluginManager#getPlugin(String id);
if (optionalContainer.isPresent()){
PluginContainer container = optionalContainer.get();
Optional<Object> optionalInstance = container.getInstance();
if (optionalInstance.isPresent()) {
Object plugin = optionalInstance.get();
}
}
declaration: package: com.velocitypowered.api.plugin, interface: PluginManager
thanks
youâre much better of just having a
public static VelocityCore instance;
public VelocityCore(âŠ) {
instance = this;
}
that said I still dont really approve of that
ok so what I can do with this?
[21:48:58 INFO]: [server connection] Jakubixoo -> arenaBW has connected
[21:48:58 INFO]: [server connection] Jakubixoo -> LobbyBW has disconnected
[21:49:00 ERROR]: Couldn't pass PlayerChatEvent to velocitycore-rafi
java.lang.IllegalArgumentException: plugin is not registered
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:142) ~[velocity.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.scheduler.VelocityScheduler.buildTask(VelocityScheduler.java:70) ~[velocity.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at pl.rafi67000.velocitycore.listener.ChatListener.onChat(ChatListener.java:48) ~[?:?]
at pl.rafi67000.velocitycore.listener.Lmbda$70.execute(Unknown Source) ~[?:?]
at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:47) ~[velocity.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) ~[velocity.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) ~[velocity.jar:3.1.2-SNAPSHOT (git-aa38d3e5-b137)]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
you dont approve of that so what I can do with this
How are you getting the plugin reference there?
this just screams to me like you dont have a correct plugin main class
(cos, like, idk what you're doing, but, you're clearly grabbing something it's not happy with)
does your main class have the @Plugin annotation
yes
and if yes does your buildsystem respect and run the velocity annotation processor
also
now I am confused
that's my chat class and I wanna remove player from spammed arraylist
but this sheduler don't work
what is that permission node...
ALSO the way youâre registering the listener is wrong
TextColor.color(NamedTextColor.RED) đ€
whole bottom section could be replaced with a Caffeine cache, but what I don't get here is that unless a player has that specific permission, they just won't be able to talk at all
sorry i was wrong, but yea, replace server with your plugin instance
you could just
public class ChatListener {
private final VelocityCore instance;
public ChatListener(VelocityCore instance) {
this.instance = instance;
}
âŠ
}
and do .registerListener(this, new ChatListener(this)) to register it
and then pass instance instead of proxy
it says the error pretty clearly
bungeeguard not working on Velocity. Talk to the developer of BungeeGuard for this.
BungeeGuard is not a velocity plugin
in fact, velocity has native bungeeguard support, you just need to enable it in the config for velocity
then you need the plugin on the backend server
Ok, but I need to active the bungee in every server or only in the velocity?
you need bungeeguard on all the servers
Yes, I know but for work in the velocity.
how can i get the list of arguments in a command as a String[] from a CommandContext<CommandSource>?
Thereâs no such thing as CommandContext on velocity- A simple command will have the arguments in the invocation however
Any idea?
Well, you can't just "block" said packets without causing a desync, unless the server is going to be forcing them back periodically
so, just blocking packets, practically nothing, depending on how you do it
if you wanna make the client actually try and stay where they are vs just blocking them, much more involved
I only want to prevent the client from moving, I do not care whether the backend server teleports them.
It will just check whether the player is in some collection, and if yes, block the move
I mean, if you block the packet, the client will still move
how does cancelling the move event work then, does the server send a packet to move the client back then?
You also desync the player entirely with that. You canât just swallow the move packets and the server will expect answers from the client if anything were to collide with the player hitbox
So no, not impossible, however very impractical and hard
cancelling the move event teleports you back
Let's say i'm trying to port my server to two different locations, US and EU
What is the ping relation between both, having only 1 proxy in US
To reach the most low ping do I need an EU proxy within the US proxy too?
Or its not needed and what really matters is in what server the player is, I'm just wondering
trafic always goes through the proxy they are connected to
^
That includes everysingle packet the player sends?
I'm very new to java and I'm getting the following error.
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ServerManager: Compilation failure
Invalid ID for plugin io.minematic.servermanager.ServerManager. IDs must start alphabetically, have alphanumeric characters, and can contain dashes or underscores.
I obviously understand what this means but I have no idea what its referring too. Can I not have . in my package? I'm really confused.
Any help is appreciated
package is irrelevant
it's the name, basically
needs to be lowercase alphanumerical
Where should I change that?
your plugin annotation
How would I go about putting a library in my plugin? I want to have REST API support for something I'm working on
I've tried adding this to my pom.xml
<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-java</artifactId>
<version>4.0.0-RC2</version>
</dependency>
java.lang.NoClassDefFoundError: kong/unirest/Unirest
at io.minematic.servermanager.ServerManager.onProxyInitialization(ServerManager.java:40) ~[?:?]
at io.minematic.servermanager.Lmbda$1.execute(Unknown Source) ~[?:?]
at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:47) ~[velocity.jar:3.1.2-SNAPSHOT (git-3ae93875-b139)]
at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) ~[velocity.jar:3.1.2-SNAPSHOT (git-3ae93875-b139)]
at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) ~[velocity.jar:3.1.2-SNAPSHOT (git-3ae93875-b139)]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassNotFoundException: kong.unirest.Unirest
at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass0(PluginClassLoader.java:85) ~[velocity.jar:3.1.2-SNAPSHOT (git-3ae93875-b139)]
at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass(PluginClassLoader.java:62) ~[velocity.jar:3.1.2-SNAPSHOT (git-3ae93875-b139)]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
... 8 more
you'd need to shade the library into your own plugin using maven shade
I'm sorry but can you explain that, I'm not super familiar with all the terms
Not really, am half dead
https://maven.apache.org/plugins/maven-shade-plugin/
Mar 25, 2022 ... Apache Maven Shade Plugin ... This plugin provides the capability to package the artifact in an uber-jar, including its dependencies and to shade ...
i'll look it up then
thanks
I don't know if you will see this, but ty a lot electroniccat, I got my things working
Oh, I see, so I would also need to port the player back. However, wouldn't that also mean that I would need to track the player's position?
yes
currently it's not possible to disable the message logging from console commands feedback (VelocityConsole$sendMessage) in the logs. Do you mind a PR to add a config option to disable that?
can you not just fake a sender or something?
I don't really see a reason to disable command feedback in general as it just creates its own set of fun issues
I don't want to disable it completly, I just don't want to log it to the log file. Output to System.out should be still there.
okay, I added a command without user feedback for that. dump Multicraft without any config options for that...
You can configure log4j to do precisely this
Hi! I'm following the docs on docs.velocitypowered.com but have gotten a bit stuck
...
import com.velocitypowered.api.command.Command;
...
public class CommandTest implements Command {
@Override
public void execute(@NonNull CommandSource source, @NonNull String[] args) {
return;
}
}
but I am getting error Method does not override method from its superclass.
am I supposed to use this? looking at the jdoc I see InvocableCommand, RawCommand and SimpleCommand
any ideas?
I'm really confused here. The master branch on github has an actual Command class but on dev/3.0.0 that's...
thank you. I've found another velocitypowered.com/wiki and that seems to be more updated
I still can't quite figure out how to register the command though
nvm i think i got it
afaik Tebex (formetly Buycraft) only has a plugin for Bungeecord. No idea whether that's compatible. In any case, this is development support (at least I think so) so maybe you should ask on #velocity-help
https://github.com/tebexio/BuycraftX they have one for Velocity
(this one isn't compatible with velocity 3.0.0 ^)
Hi! I'm using net kyori adventure text. Any idea how to make click event suggest command?
like
Component.text("test")
.color(NamedTextColor.YELLOW)
.clickEvent(Component.suggest("/something like this"));
any way to send raw JSON message? I've no idea how this lib works
you can compile from his branch
How can I replace a hex color code in a string to a valid color? I don't want to use 'Component.text().color(hexCode)', because my messages can contain multiple colors.
you can append multiple components
var text = text()
.append(text("hi", RED))
.append(text(" not red", someHexColor)
.build()
for example
But thats very uncomfortable. I would prefer it to have a converter so that I can use "#hexThis is #hexa message"
In Spigot it is possible like this but not in Velocity because there is no ChatColor. đ€
There are adventure text component serializers that allow to use that (awful) format and then convert/to adventure components
declaration: package: net.kyori.adventure.text.serializer.legacy, interface: LegacyComponentSerializer, interface: Builder
Why should this be an awful format? If I would know a reason to be forced to write multiple lines for one simple message I would agree with you, but I don't understand the advantages of the Adventure Component API.
Itâs a problematic format because chat is formatted as json internally and the token format doesnât clearly label where itâs supposed to be used
You end up using redundant reset characters and endings
And itâs also a nightmare to parse or use
I highly recommend you check out MiniMessage if all youâre worried about is it using up a lot of space
Ah okay thank you. I will check MiniMessages out right now.
nay
ill try NAME
one's a string and the other is a component, whatever you need really
so the Identity class has cross platform pointers right?
there are pointers all over the place
that sounds painful
but most of them are in the identity class yes
is there a list?
haha yeah it is a bit :') no list afaik
ill make a note, would be a good point of improvement for the docs for sure
no velocity doesn't have any of it's own
thanks a bunch
different topic
if i call thenAccept(Consumer) on a future returned by CommandManager#executeAsync(), the consumer will be executed on the same thread that the command was executed on, right?
and unfortunately VelocityConsole doesn't seem to have either of the name pointers
Logger.getLogger().info(source.pointers().getOrDefault(Identity.NAME, source.toString()));
Logger.getLogger().info(source.pointers().get(Identity.DISPLAY_NAME).map(CrossplatForms.PLAIN_SERIALIZER::serialize).orElse(source.toString()));
[11:41:04 INFO] [crossplatforms]: com.velocitypowered.proxy.console.VelocityConsole@68484c09
[11:41:04 INFO] [crossplatforms]: com.velocitypowered.proxy.console.VelocityConsole@68484c09
Yo @wary tiger can I get your opinion on https://GitHub.com/Xernium/Velocity
The new identified key will be available in the prelogin event event from the inbound connection
You could totally use it as a ban cache
what means..?
Since clients can now authenticate with key instead of client signature you can use the key to identify the client before the login verification happens
Quite convenient for preventing repeated authentication requests by banned users
Hey i just bot attacked a velocity proxy and it worked great.
The cpu usage was relatively low and the ram usage too unlike bungeecord.
All the existing connections were still alive and the ping was also normal.
I noticed a strange thing that after the bot attack ended even though the existing clients were still connected new clients would be stuck on the connecting to server screen.
Funny enough i faced the same issue while stress testing my custom cloud management server which also uses latest Netty.
It also behaved in a similar way where existing connections would stay alive but new connections would throw an out of thread error, but velocity didnot throw any kind of thread error yet it fails to create new connections. Is there a fix and what is problem that causes this?
Also after a restart it works normally
I just assume the netty responder tracker got stuck
Usually happens when the system handle limit is reached for inet
Those connections must be untracked by velocity or else they would definitely throw something
Also
If the server was still able to ping this wasnât the issue
Is there a ServicesManager alternative for velocity? I want to use LuckPerms API after it has loaded and simply adding it as dependency doesn't seem to do the trick. ideas?
Wdym by doesnât do the trick? Did you declare the dependency in your @Plugin annotation?
yes
@Dependency(id = "luckperms")
LP plugin has loaded but I get
LuckPermsProvider$NotLoadedException: The LuckPerms API isn't loaded yet!
on bukkit they suggest
RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
if (provider != null) {
LuckPerms api = provider.getProvider();
}
Where are you calling the LP api from?
class that implements SimpleCommand
And youâre registering that in which event?
Or is it only called post proxy init complete?
i'm using @Inject and commandManager.register()
And the command object is created during or after the proxy initialize event?
You can only @Inject something that requires the plugin to be initialized fully after that event is done
not sure, I'm pretty new to this.
My plugin is basically
main
public class MyPlugin {
...
@Inject
public MyPlugin(ProxyServer ...) {
...
CommandManager commandManager = server.getCommandManager();
CommandMeta meta = commandManager.metaBuilder("command")
.build();
commandManager.register(meta, new TestCommand(this.server));
}
}
and TestCommand
public final class TestCommand implements SimpleCommand {
...
LuckPerms luckPerms = LuckPermsProvider.get();
@Override
public void execute(final Invocation invocation) {
...
}
First of all
@Dependency(id = "luckperms", optional = false)
Since you absolutely need it
Secondly thatâs what I was referring to.
Donât register it in the constructor of your main class
Add a method
@\Subscribe
public void onProxyInitialize(ProxyInitializeEvent e) {
//Register command here
}
okay thanks, i'll try that
Apologies to the person I pinged just now
Formatting on mobile is nearly impossible
awesome, this works perfectly. thanks for the help
is there any way my paper plugin can send a message to the proxy?
yes you can use plugin messaging
Thanks. From what i've read the Bungee messaging channel should work with velocity so im gonna try that out
for anything custom like plugin-plugin use your own channel
example impl on velocity: https://gist.github.com/Xernium/95c9262c5f70b8791557861bbc09be1b
thank you
This sounds amazing. How would I obtain this key in the prelogin event? InboundConnection doesn't have any new methods, including in your fork
I will need to read up on this identifier key, but so long as it cannot be shared by different users, it is entirely fair game for caching purposes
I meant LoginInbound
The key has an expiry date so you can only expect it to be presented till that time has come
Iâll compose a full write-up later
LoginInboundConnection is https://github.com/Xernium/Velocity/blob/future/1.19/api/src/main/java/com/velocitypowered/api/proxy/crypto/KeyIdentifiable.java
This is still very much indev
is there an event when player disconnects from a server (but not the proxy)? I'm trying to find one in the jd rn but no success so far
like the opposite of ServerConnectedEvent
https://jd.papermc.io/velocity/3.0.0/com/velocitypowered/api/event/player/KickedFromServerEvent.html
declaration: package: com.velocitypowered.api.event.player, class: KickedFromServerEvent
Still works like a charm
If you want the event when the player switches server instead youâll have to listen to ServerConnectedEvent
yeah I ended up using that, thanks
Tomorrow I will be done with 1.18.2 compatibility
Til then, I will verify 5 additional mods compatibility with my mod
If thatâs a modification to velocity that changes how the event flow works then we canât consider it for the official velocity repo
Not really, I have separated it in a good way đ
I'm trying to make it as modular as possible
But I had no trouble mergin with latest
Something else
Thereâs a plugin out there I donât remember the name of it
But it allows you to use forced hosts to use modern forge
You record the handshake and give the plugin a sample file
The plugin then replays the handshake for a certain forced host
That's actually clever
Yea, I'm gonna give it a try
Btw here is my fork https://github.com/adde0109/Velocity
very very prototype stage, but it works to some degree
Does there happen to be any Velocity forks which have Team and Scoreboard APIs for Tablists?
sample def file iirc? https://paste.gg/p/anonymous/32664b0628ca4536a40b5a97f45b41a3
nope i forgot to mention it didnt ping after the attack
Nudge
Hello, is there a way to override the virtual host used by the player when connecting this player to a sub-server? Reflection on final fields doesn't work anymore since jdk 12 apparently...
that, or change anything about the player really.. (username, UUID)
Since 1.19 is going to add the need for another pre-login event Iâm willing to open up the possibility of influencing the hostname
As for the UUID- as long as forwarding is set up correctly you can set that in the GameProfileRequest event
The username however can never be changed because the client will refuse to accept that
Nudge
is it possible to convert a string with colour codes like "&ctest" into a text component with the proper formatting?
with the legacy serializer, yes
how so? I saw in the docs that net.kyori.adventure was used so I'm using this right but I can't figure any way to have non-hardcoded messages
so i was wondering if there's a utility or something to convert configurable strings to components
purposefully joined the vanilla server with Via first
(as a worst case scenario)
@magic forum see https://github.com/Xernium/TicketClip and https://github.com/Xernium/MagicMirror
Turns out the idiot that made this proof-of-concept back in the day was me.
Well here it is for the world to see
How do you do the server switch?
The recorded messages have both sides of the answers
So if the server requests it gives the appropriate answers
See this as an example exchange file
But how does the client know what mods are installed on the new server
?
The new server meaning the server you switch to
it can't
Yea because you canât reset it the client is fooled into thinking itâs always connected to an appropriate server
Well this is what I was told NOT to do by the forge devs because it can lead to unpredictable behaviour
Well, yea
That was true before 1.13 too
There is a reason why what ive is doing there is stupid
Five*
Just, outside of forcefully reconnecting to the client, hackery is all ther eis
1.12.2 forge and older also doesnât support what we are doing
What I posted is a proof of concept, nothing more. It can be used and will probably work fine in a lot of cases but I donât expect it to
The funny thing is; Years ago, I made that same thing you did but with bungeecord.
I remember that. We had a heated conversation about it
Just about twenty or so
Again this wasnât meant as a solution but more as a proof of concept
How do you handle mods' own argument type command packets?
Yea I cheated; I added my own ontop and copied the existing into a new slice at the bottom
Youâd need to use a crossstitch type encapsulation method to do it right
Yeah, I'm currently trying to port it to forge
Shouldnât be terribly difficult since you can use the same mixins
Well more or less
Yes, but the problem I'm having is that neither fabric or forge1.16 use mojmap
Thatâs only an option if you know you wonât create overlap
You can make both use mojmap
Fabric side: yes i have already. Forge side: its sticks with mcp.
Btw I'm also trying to learn mixins since this is the first time I have looked at a mixin ever
Ping me if you need help
https://github.com/Xernium/MagicMirror/blob/main/build.gradle
You can use official mappings in 1.16 if Iâm not mistaken like here
@fossil sundial You know what @Redirect(method = "writeNode", at = @At(value = "INVOKE", target = "Lnet/minecraft/command/argument/ArgumentTypes;toPacket(Lnet/minecraft/network/PacketByteBuf;Lcom/mojang/brigadier/arguments/ArgumentType;)V")) means?
That's a mixin
it's replacing a certain method call, probably before packet serialization
Yes
whats "Lnet/minecraft/command/argument/ArgumentTypes;toPacket(Lnet/minecraft/network/PacketByteBuf;Lcom/mojang/brigadier/arguments/ArgumentType;)V"?
the method that's being called
Thatâs the call itâs referencing
Youâll have to find the brigadier argument type class
There itâs the method that accepts a friendly/packetbytebuf and an argument type
so it's path:method(argument;argument)returnType?
L<class>;methodname(âŠ)returntype
As for how this works
V for void
Z for BooleanâŠ.
And Lpackage/classname; is for classes
yeah, I read somthing about that, just wasnt sure
Just direct path names in Java
I still can't find the "toPacket" method
I think it's called something different in my forgedev environment
Yea itâs probably named differently
Just look for a method that accepts a friendly or packetbytebuf and an argument type
inside ArgumentTypes class?
Yes
If you need to find the class search for âminecraft:uuidâ
That string should only be found in that class
I found the class, but the method is still nowhere to be seen
o shit
I think i found it
gonna have chat with the bot about that name
lol
also, five, like, was there a way to use mojmap with fabric that you knew of? or was that just forge? 
mappings loom.officialMojangMappings()
Ohhhh, ;3
It was fabric ages before forge I may add
Something in your build file is messed up

Your mixin is declared and mixin processing is enabled?
yes, I followed a guide https://github.com/SpongePowered/Mixin/wiki/Mixins-on-Minecraft-Forge
But I don't use refmap
The original project for fabric doesnt use it
I also got this error first
I highly recommend you use my build file here as template
The guide is one thing
But a working setup as reference is usually more helpful
Yes
@fossil sundial When I try to run it I get: forgeserver\mods\modid-1.0.jar constructed 0 mods: [], but had 1 mods specified: [examplemod]
Dafuq
You have your mods toml? https://github.com/Xernium/MagicMirror/blob/main/src/main/resources/META-INF/mods.toml
yes, I think It's because I don't specify the refmap in the mixin config
ok, setting the refmap didnt change anything
Yea somewhere your mod def is empty
Itâs compiling but itâs not referencing right
You do have your @modid annotation ?
annotation? In what file?
O shit
I don't have a main class
Should I just create an empty one?
Ok, now it runs
HOLY SHIT IT WORKS
@fossil sundial Thank you so much for your help!
No problem; you havenât published any modifications to your velocity fork yet so I canât gauge how likely we are to actually incorporate it
In any case, please donât get your hopes up too high
Also as side note; 1.19 and my exams have priority before I can seriously deal with this again
Yeah, I understand. My plan is to have this fork co-exist with velocity for a while
I haven't planned for any PR
Iâd even be happy to support a mod that hacks this into forge rather than making the proxy deal with it
Just
It canât be like that lightfall or whatever it was called mod for forge
That approach was just bad
Was that client side modifications too?
Yes
ah ok
But crossstitch is a mod you may also need on both sides so-
Realistically you canât get away without modifications either way
Yes, but I'm aiming at ONLY modifications at Server side (server + proxy). I don't want players getting into this hassle, server admins can have an understanding alteast why this matters.
From the players perspective, it just works
How are you going to do that
My stupid POC also works like that
In a way at least
It's not impossible to solve the server switching reset problem
Yea we arrived at that conclusion
...Without client modification
And itâs also not possible to join a vanilla server and a forge server without risking breaking something
Yeah, so server switching with forge shouldn't be required but be possible if people really want to try.
In my opinion the server switching mechanism should be a separate plugin only relying on velocity API
The switching mechanism for forge?
You know as well as I do that thatâs not possible thanks to the history of the notchian protocol
Ok, lets jump straight into it: You type /vanilla. You get a prompt that says:"[Forge Switcher] Ready to connect to vanilla server please disconnect here". You get kicked. Then you rejoin and the server has now switched your forced host to the vanilla server. TADA!
XD
It is POSSIBLE but not beautiful
But that would still require you to know how the forge server responds to the next login plugin messages before you connect to it
Which is how you arrive back at the stupid poc I did
Something else rq:
You man back to modded from vanilla?
Hereâs what a large network I helped out has done:
They have proxy plugins that mimic the communication of mods that arenât present on the backend server if youâre on a vanilla server and a custom login implementation that interactively mimics being a forge server for the client
Thatâs probably the best solution
You give a special plugin your mod list or the server pings the backend to get it
Then the proxy will interactively cater to that
But why not just use my fork that already works with forced hosts and just change the forced host everytime you want to switch?
Ah, you mean when it checks for compatibility with the destination server?
Also forced hosts are a suggestion, plugins may still decide differently on the choose initial server event
Yea
Yeah, that will need a mechanism 5 times bigger than my modifications to velocity
That's why it's better to have a separate plugin do that. Saving and mimicing
Itâs not entirely out of scope
But I refuse to bend over backwards just to make forge happy. Weâve reached the consensus with fabric that theyâre willing to implement a soft reset packet to skip login plugin during LOGIN and mimic them during play
But that ainât gonna happen on forge
Again when I have time Iâll try to break the deadlock here
If you know of a way
See #velocity-github
The issue was bumped again
Yes, that's the best approach.
Btw have you seen my modifications? here they are in diff mode https://github.com/adde0109/Velocity/commit/4558de82a946fb319d7adee96681ebbecfa81a5b
The handshake hostname token isnât required
You can skip it
You know
I have a very very very stupid idea
One that you could help with
What if
OOooOOooO
We make a mod for forge server only
That mod returns the mod list + registries in the server ping packet if the server is pinged
You could then make a velocity plugin that pings the server you could use
Use that data to handshake the client
And then set that server as destination
Hmm, I like it, well, If we are gonna make modifications we might as well make em work together

Crossstitch can be a part of that forge mod
Yeah, one complete velocity forge support packet mod
Yea but
What I suggested requires zero modifications to velocity
And only a serverside mod
Only if the right apis on velocity exists
Client > Velocity
Plugin > Pings forge server
registries and forge info > Plugin
Plugin > Client
Client > Plugin (store response)
Plugin > Velocity set the pinged server in the ChooseInitialServerEvent
Plugin > forge Server (stored response)
Yeah, but the problem is that the api doesn't allow you to send packages when they need to be sent
To the client
Yea and? As long as youâre communicating it is suppressed
Otherwise the replay wouldnât be working
