#velocity-dev

164 messages · Page 1 of 1 (latest)

silk nexus
#

Question about velocity - what's the transfer order when a player gets transferred via /server, or plugin messaging.

What events get fired in what order - on the proxy server, and server A & B (example names ofc).

Lets imagine the player is connected to server A, and wants to transfer to server B. Does the PlayerQuitEvent happen before, or after the player is connected to server B.

warped shard
#

well the pre connect event always fires before any connection is attempted and then first a connection is established with the new backend before disconnecting from the current backend, but I can't remember the specifics

silk nexus
#

Thank you tim

nova lily
#

With a velocity plugin what it can do?

quick sentinel
nova lily
quick sentinel
naive ibex
#

(would also love access to #velocity-contrib to discuss these things in the proper place)

bold wharf
#

the compression ratio check is in the else block

#

First day back from a short health break, I am still kinda mentally cooked; hope to be back in full swing next week

naive ibex
vast depot
#

what happens when you call RegisteredServer#sendPluginMessage while the connection isn't fully established to the server yet? like when the player is still in the configuration phase on the proxy

#

because I'm getting behaviour that looks like it is silently discarded :S

#

ok, well, not silently I guess, the method returns false in such a case

#

my abstraction hid that away :/

vast depot
#

well it works on Velocity now but even though Bungee has an inbuilt queue (which I assumed Velocity would also do) it's broken there, fml lol

sage otter
#

I don't get why compression between proxy and backends even exists

bold wharf
naive ibex
#

uhhhhhhhh yep ignore me. need more caffeine in my system i guess 🤡

crude gateBOT
crude gateBOT
vast depot
#

@sage otter trading CPU for network traffic ¯_(ツ)_/¯ makes sense in some kind of situation e.g. paying for the traffic

sage otter
#

most of the time, proxy and backends are in the same local network. in that case, it's wasted CPU time

upper heath
#

most of the time, but you can't account on every single network being like that, offering the option doesn't hurt anyone, but not offering it hurts the cases where it matters

#

it is a tradeoff after all

naive ibex
#

well, even locally, i've seen peeks of 1gbit in & out on velocity. if a network is split across multiple machines with just a 1gbit switch between them, not compressing packets would bottleneck quickly

#

& it seems odd to require a 10gbit link just for a couple hundred/low thousands of players

vast depot
#

chunk data isn't exactly small

upper heath
#

yeah you can also just set the compression threshold on the server higher than the one between proxy<->client if you really care about <=normal packets lol

bold wharf
#

Minecraft sorta expects the data to be compressed

#

In the past we'd recomemnd anybody routing stuff over a local network to disable compression on the backend, but that doesn't really work exactly because of stuff like the registry packets

naive ibex
#

Does the vanilla client ever send non-compressed packets?

upper heath
#

yes, the compression threshold is sent to the client as well for its own compression handler

bold wharf
#

most serverbound packets are going to be uncompressed, most clientbound packets I'd imagine too

upper heath
#

not if you set the threshold to 0 thinksmart

naive ibex
#

i wonder if an amplification DOS is theoretically possible with a malicious server

#

the server sending small packets to the client, which makes the client send large packets back, effectively dossing itself given a low enough upload bandwidth

#

(cries in DSL upload speed)

vernal compass
#

the client dies before that, pretty sure

naive ibex
#

the client should easily be able to handle sending a handful of megabit

#

my home internet has only 10mbit/s up

vernal compass
#

its surprisingly bad. mostly struggling with packets per second tho

bold wharf
#

The client doesn't really have anything large it could echo back or respond to

upper heath
#

stares at creative mode

bold wharf
#

I was thinking that, but most of that would be inventory related stuff and you'd likely have to find some pretty specific state for it to throw data back

naive ibex
#

i mean you can force the client to do a hell of a lot of things, you can open and close inventories, can you also open & close books, saving them?

#

that would probably make the client echo back a large packet

#

one that compresses well.. as i had noticed 😅

upper heath
#

a single packet tho?

#

doubtful

vernal compass
#

biggest data you can get outside of creative is probably the written book content. but that requires user input

bold wharf
#

Yea, not sure if the client would send anything if the server closed the book UI

naive ibex
#

the limit here is how fast the client will actually allow the book ui to be opened and closed

#
clientbound.register(
          LegacyTitlePacket.class,
          LegacyTitlePacket::new,
          map(0x45, MINECRAFT_1_8, true),
          map(0x45, MINECRAFT_1_9, true),
          map(0x47, MINECRAFT_1_12, true),
          map(0x48, MINECRAFT_1_12_1, true),
          map(0x4B, MINECRAFT_1_13, true),
          map(0x4F, MINECRAFT_1_14, true),
          map(0x50, MINECRAFT_1_15, true),
          map(0x4F, MINECRAFT_1_16, MINECRAFT_1_16_4, true));

why do we pass along a packet's constructor, LegacyTitlePacket::new here, if all map functions are encode only (the true)?

#

the packetSupplier is never stored/used if all mappings are encodeOnly:

if (!current.encodeOnly) {
  registry.packetIdToSupplier.put(current.id, packetSupplier);
}

wouldn't it make sense to make the constructor here @Nullable, throwing in register() if the supplier is null and one or more mappings are NOT encodeOnly?

#

this is regarding a PR i just made - https://github.com/PaperMC/Velocity/pull/1803/changes#r3291203814

see this comment. the only reason we need this constructor here is because StateRegistry requires a constructor, but this constructor will and should never be called.

ommitting the constructor here is the solution, but then StateRegistry gets mad. allowing the packetSupplier to be @Nullable will fix this; we just pass null and omit this constructor

bold wharf
#

Expressing that in code is a pain and a maintanance nightmare, just keeps it within the pattern

naive ibex
bold wharf
#

then make the constructor throw?

naive ibex
#

yeah im about to push that. but, it seems wrong

#

having a public no-param constructor that throws

#
clientbound.register(
          LegacyTitlePacket.class,
          () -> throw new IllegalStateException("..."),
          map(0x45, MINECRAFT_1_8, true),

this is another solution. but that clutters StateRegistry.

bold wharf
#

Well, the expectation is that nobody is using the empty constructors other than the caller, and so it shouldn't even matter what the default state of that stuff is

#

The only time that is used is when the read method is going to be called

naive ibex
#

instead of having the constructor supplier be @Nullable we could add registerEncodeOnly that throws if any of its supplied maps are not-encodeOnly

#

do you think that's better?

bold wharf
#

that action shouldn't be final

naive ibex
#

it should, the action will never get manipulated

bold wharf
#

It will be manipulated, in the read method

#

(if one existed)

naive ibex
#

yeah but that's the thing; it doesnt exist

#

all maps are encodeOnly

bold wharf
#

pretend it does for the sake of just keeping tha pattern design the same

naive ibex
#

well

#

the setAction() method was protected before this

#

keeps the setAction() methods and throws if it's anything but the expected value.

#

do you think this is better?

#

i just dont like having a non-final field that will and should never be changed. a TitleTextPacket's action should never not be SET_TITLE. it doesnt even need the field.

bold wharf
#

My understanding is that most of the time that a packet has a setter it's a design choice based on surrounding code and probably should just not exist on that

naive ibex
#

the setter was only ever used in the factory method in the same package (the setter was protected)

#

btw, we don't even need getAction(). i just kept it in for completeness, because the packets are only ever created off of an action, and the getter returns the same action that was given to the factory method.

#

as of the current state of the PR the getter has no usages

bold wharf
#

hmmmm, so, there is the factory method which really could just pass that in through the constructors, and then the constructors which really should just be using super o.O

naive ibex
#

yep

#

i found it to be a quite weird implementation

#

hence the PR 🙂

#

feel free to look at it tomorrow or at a later date - it does clean up the title packets quite well and functionally changes nothing

#

well, except for the bug that was never reachable, see the PR description

#
public LegacyTitlePacket() {
  // This method only exists to keep StateRegistry happy (all mappings are encode-only, the constructor isn't stored).
  throw new AssertionError("A bare LegacyTitlePacket should never be instantiated");
}

resolved-ish.

if this pattern exists for more encode-only packets, IMO its worth a future refactor

bold wharf
#

I mean, the general gist is that nothing should ever create an instance of a packet without calling the read method, or doing something funky around populating the packet

#

There wasn't really a hard standard on that stuff as packets aren't API and we expect stuff to work how it does

naive ibex
#

well, title packets are created a lot, through the API methods on Player

#

10 usages here, all from ConnectedPlayer (except one from ClientPlaySessionHandler sending a title clear packet)

bold wharf
#

API using it and it being API are two different things

naive ibex
#

oh yeah i get what you mean. though it's good to force these contracts on "ourselves" (the proxy implementation module)

bold wharf
#

I try to be nice and avoid changing internals on zero whim, but, anything inside of .proxy has 0 defined behavior outside of the API and calling it yourself is at your own risk

naive ibex
#

this exception is loud and clear, literally. the previous non-param constructor would keep action null, throwing a random NPE when its trying to be encoded

naive ibex
#

don't like that at all & ive had to deal with it a lot unfortunately

bold wharf
#

I mean, sure

#

You can also shoot yourself in the foot

#

I can't stop software poking inside of .proxy, and I try to avoid making huge changes blindly in there as sorta an ackowledgement that people do some funky stuff we don't support which makes that unavoidable, but there is no well defined contracts in there, stuff can change, stuff can have weird expectations over how it's used, epsecially for low level data stuff like packets

naive ibex
#

stuff like that is better suited as a fork imo

#

which i beleive LimboAPI was at one point

bold wharf
#

making the packets empty constructor throw is in a weird area of it just being wrong especially as the expectation is that that is only ever called when decode is called, ofc for stuff where we don't decode it, this packet just sorta smells; , but for packet, the fields should just be nullable and so that packet shouldn't ever really be able to exist in a bad state, outside of that weird design pattern flaw

#

I, brain, words, iq limit for today

#

How on earth is it almost 11pm, I need chicken

naive ibex
#

yeah so. LegacyTitlePacket()'s only usage is clientbound.register's parameter. this method finds all mappings are encodeOnly = true, which means

if (!current.encodeOnly) {
  registry.packetIdToSupplier.put(current.id, packetSupplier);
}

this NEVER gets called, and this is the only usage of packetSupplier in register().

this is why i think its good to refactor StateRegistry very slightly, either allow packetSupplier to be nullable and throw when it is while we have non-encodeOnly packets. or have a separate registerEncodeOnly which never consumes this constructor, as the constructor is never needed for encodeOnly packets.

still worth a visit at a later date.

bold wharf
#

I mean, if we did that I'd much prefer a seperate method that introducing nullability into the existing one

naive ibex
#

this would completely get rid of any constructor requirements for encodeOnly packets, eliminating what I had to do for LegacyTitlePacket (which is currently also a problem without the merge of my PR, as it leaves action as null)

bold wharf
#

But even there, the whole nature of the empty constructor being an illegal state is 100% expected

#

that case applies for quite literally every single packet, I don't entirely see the engineering justification for seperating specific ones out

naive ibex
#

i dont think thats the case

#

why would we need to store the constructor at all then?

#

its not like we are creating packet classes with Unsafe

bold wharf
#

No but the cost of the lambda is almost nothing

#

and I think that making constructors throw harms the, even if unsupported, wierd cases of people screwing with our packet impls, more than it benefits us from an engineering perspective

naive ibex
#

its just that the StateRegistry never needs to know about any constructor for encodeOnly packets. for packets that it also has to decode, it needs a reference to the (empty) constructor, to call decode() after it right away. for encodeOnly packets it never needs to know of any constructor

bold wharf
#

What I'm saying is that the cost of that reference is trivial so not really a huge factor, but the engineering of making all of the packets which sit in that case throw from the empty constructor feels meh

naive ibex
#

i dont want to throw on an empty constructor

#

i want to get rid of them

#

completely random packet that's encode only - PlayerChatCompletionPacket has a no-arg constructor and one with args.
the no-arg constructor is only referenced in StateRegistry.

with such a refactor, we can get rid of the no-arg constructor completely. this only leaves PlayerChatCompletionPacket(String[] completions, Action action) which is actually called

bold wharf
#

I guess, idk; it falls into a weird area of internal changes

naive ibex
#

currently we need no-arg constructors for encodeOnly packets just as a reference that we throw away immediately.

#

getting rid of needing a reference for encode only packets also gets rid of the need for no-arg constructors on these packets

bold wharf
#

Yea, but getting rid of the no-arg constructors does sorta beat those who want those constructors for weird stuff

naive ibex
#

imo it'd be a nice cleanup, a PR diff with lots of -'s, which i always like

naive ibex
#

but eh

#

using reflection or compiling against the impl module to instantiate packets with no-arg constructors

#

is that really something we should be concerned about supporting?

bold wharf
#

Yea, falls into the area of unsupported but a change I'd be weary of making without a version bump

naive ibex
#

plugins doing these kinds of things would already use plugins like packetevents ig

#

but i agree with a version bump on this one

bold wharf
#

Yes, I try to avoid aiding in pulling the trigger for them but I do need to make some considerations that exists before I break some core oddball plugin

naive ibex
#

(unfortunately, this is the #5 ranked velocity plugin on bstats with 1.5k servers)

bold wharf
#

I mean, their plugins fall into the border of instant warranty voiders for me

#

but I generally just have a level of adversion to making changes I know will immediatly set the people using such plugins after me, at least not without a version break where there is a fairly well defined target for that sorta thing

naive ibex
#

if it helps, with Velocity-CTD, we have been giving 0 thought about keeping the internals aligned-ish with upstream, and the only breaking plugin that people were complaining about is that one ^ so i think it may be fairly safe

#

we only have about 1-2% of the Velocity installbase but still, might be worth something

bold wharf
#

Well, yea, I just don't have the capacity to check that sorta thing to know what plugins I might or might not break when doing stuff, and so generally just prefer to try to avoid setting a hoard after myself

naive ibex
#

a consistent use of reflection in plugins may suggest the API is lacking on some fronts. making people mad by changing internals could surface these kinds of things, and they can be considered as an actual API feature in the future

#

but yeah im 1 hour ahead of you, and i already had my chicken 😂. im off for now, good night!

bold wharf
#

I mean, 99% of the time it's plugins used to faciliate offline mode servers

sage plank
#

For the [servers] section within the velocity.toml file, does Velocity have an API to communicate the server id to the backend server?

sour current
sage plank
#

Ah, but that'd rely on a player being online, right?

#

So I wouldn't be able to do it on plugin startup

#

I can work with that though, just waiting until the first player logs in. Tedious but not difficult for my use case

sour current
#

is this for a public plugin or for your own use

sage plank
#

Currently my own use, but may be turned public far down the line

sour current
#

well what i just do with my servers is pass the name to it using a system property

sage plank
#

Another option is defining the server id through a plugin config property, yeah I see what you mean

sour current
#

other plugins like luckperms also just have a config yeah

sage plank
#

That's probably going to be the route I take then

#

Thank you heart

sour current
#

you're welcome

cursive cradle
#

moving to adventure 5 breaks velocity, is that normal?

#

java.lang.NoSuchMethodError: 'net.kyori.adventure.text.Component net.kyori.adventure.text.TextComponent$Builder.build()'

for simple Component.text().append()

#

how will plugins move to adventure 5 if moving to it breaks and not moving to it will also break @-@ there is no transitional step possible is there

rose drum
#

That ABI break was fixed in adventure 5.1

cursive cradle
#

velocity is still on 4.26.1

rose drum
crude gateBOT
naive ibex
#

💯

odd wing
bold wharf
#

Because the builds are part of a stable release channel, we haven't really managed proper releases in a while but those would be tagged differently iirc

odd wing
#

How does velocity handle the command list? Since I assume the proxy doesn’t know about the backend command list how can it send a list with the backend and the proxy’s list

rose drum
#

Velocity injects the proxy commands into the command tree whenever the backend server sends it to a player

odd wing
#

Could you guide me to where in the codebase of paper and velocity it does that?

#

Is it through messaging channels?

bold wharf
#

in velocity it's the available commands packet

#

it just modifies the command tree to inject information about commands on the proxy

odd wing
#

Yeah but how tho, you say modified but how does it have the original list

bold wharf
#

it doesn't have the original list

#

it has the command tree that the server sends to the client

odd wing
#

Server being backend?

bold wharf
#

Yes

odd wing
#

Okay and how does it do that

bold wharf
odd wing
#

Intercept the packet?

bold wharf
#

Well, it's a proxy

odd wing
#

Yeah

odd wing
#

What about registering a new command on the proxy during runtime

#

Cause the backend won’t send a packet then right

bold wharf
#

Correct, the client just won't know about that command until you do something that triggers the backend to resend the command tree

odd wing
#

Ah crap

#

Alright

#

Thanks

bold wharf
#

mojang only supports resending the full tree, if you were doing plugin stuff you'd need a plugin on the backend that can take a plugin message or something to resend the tree

odd wing
#

Alright

#

So a possible fix by mojang would just be changing the packet to also allow additions/removals

#

Is there a reason paper doesn’t provide a patch for that

bold wharf
#

Because we can't modify the client

odd wing
#

Oh lmao mb I’m an idiot

odd wing
#

Like the transfer plugin channel thing

bold wharf
#

I mean, sure, but not really on the radar

odd wing
#

Could I open a pr for it?

#

I mean is it something the paper team would allow to be added

bold wharf
#

I mean, sure, but idk how much interest there would be for it

odd wing
#

Is it worth spending my time on or not?

bold wharf
#

No idea

#

Taaaaking over the world

vague stone
hearty beacon
#

hm, yes, channel

steady trellis
#

LET'S GOO

#

VELOCITY IS HERE

wind wing
#

Wooo

dawn sinew
#

I didn't get the memo to recommend velocity over waterfall. Who sent it. 😅

bold wharf
#

Merlin

crystal heath
#

Did you know we are putting cover letters on those memos now?

coarse topaz
#

Oh my

ashen pawn
#

yes

dull sorrel
coarse topaz
#

I like the move

shy epoch
half swallow
#

woah

#

this is a surprise

novel depot
#

Good things always come together paperPls
No surprise here LoveGive

young pilot
#

I am curious if that step brings more attention to velocity, away from bungeelol

copper cargo
#

Would be nice

worn sand
#

aslong as Spongeforge support for 1.12+ is still there, it's good

candid bronze
#

can't wait paper to announce they are adopting mojangaikar

agile ore
#

hardfork from mojang when™️

agile ore
#

hi

violet lion
#

👋

jade socket
#

i thought velocity was already part of paper

bold wharf
#

No, we've just been pretty tight since it existed

#

Much like we're generally good frens across the community

agile ore
#

paper x sponge when

split harbor
#

ye

agile ore
#

paper x sponge fanfic when

hushed fiber
#

da/dt-dev

agile ore
#

what

proud pine
#

delta acceleration / delta time-dev

analog dew
#

They're a jerk ||(for legal purposes this is a physics joke, not a personal attack)||

meager sluice
#

is there anything in velocity to communicate to servers without players or would i have to setup my own sockets?
And if so, any good libs for that? I used https://github.com/jhg023/SimpleNet before but ran into a critical bug there that really limited what i could use it for (https://github.com/jhg023/SimpleNet/issues/23)

GitHub

An easy-to-use, event-driven, asynchronous network application framework compiled with Java 11. - GitHub - jhg023/SimpleNet: An easy-to-use, event-driven, asynchronous network application framework...

fossil sundial
meager sluice
#

Thanks

#

could also use plain java sockets but effort

fossil sundial
#

If it’s for effort okhttp3 also has a simple solution for that

meager sluice
#

i basically want to pass warp information between servers

young pilot
#

Well then my suggestion is not the best, but I'll still recommend it: gRPC / REST (if you need them in some web context potentially)

#

could use MQTT for auto discovery and setup some grpc or something

#

But that's not useful for a simple public plugin I guess, that's rather overengineered

meager sluice
#

i'm all for overengineering

young pilot
#

replace MQTT with Message Broker actually, there are a few, yeah

#

but actually could maybe make a central "warp control node" that stores them and have all the game servers talk to it

meager sluice
#

yeah that was my idea, basically use the proxy as that node and have all servers communicate through that

#

tbh the java sockets dont look so bad either

young pilot
#

I guess the fastest is like a "sparkjava" rest server

#

Fastest as in rapid prototyping

#

plain sockets don't give you any persistency, encryption etc

meager sluice
#

im not planning on encrypting warps lol

young pilot
#

hmm true

#

but you still need the codec

meager sluice
#

the players will never get access to that info anyway

young pilot
#

like funny string splits

#

well they can if the backend servers are not firewalled properly

meager sluice
#

thats not my problem

young pilot
#

but that's not the encryption thing here anyway

#

and yeah, probably not important

#

but a gotcha

agile ore
#

can velocity be used for production servers?

coarse topaz
#

yes

agile ore
#

does it store last server location? like bungee locations.yaml

coarse topaz
#

Mineteria has been using it for production for quite some time now

agile ore
coarse topaz
#

Velocity does not do that natively

agile ore
#

i really wanna use velocity but its not giving me enough reasons

#

pros: is faster
cons:


Please make your messages shorter. We've set the limit at 2000 characters to be courteous to others.```
burnt dragon
#

dont use it then

coarse topaz
agile ore
#

but bungeecord randomly keeps telling me the login event took x ms to process

#

because of some bad plugin that idk what is

#

so if i use velocity i'll be forced to code it myself since velocity doesn't have versions of these plugins
therefore if i code it myself it won't be bad

coarse topaz
#

Well, that or request the plugin to have said issues fixed and be ported to velocity

agile ore
#

idk which plugin it is

coarse topaz
#

that'll be something you will have to diagnose

ashen pawn
agile ore
fossil sundial
agile ore
#

?

bronze yoke
wary tiger
#

I don't know where you conceived the idea that Velocity is harder to work with. On the contrary, it's much easier and better to work with than BungeeCord.

BungeeCord's API is poorly documented and badly architectured. It returns undocumented null values, fails to check invariants, and couples API and implementation. API objects provide very little guarantees about nullability.

#

BungeeCord uses singletons and global state, exposes an error-prone API for async events, and uses the bungeecord chat API.

Velocity's API is perfect for dependency injection and uses the Adventure API for chat messages and whatnot.

rich hawk
#

???

wary tiger
#

Such global state as used by BungeeCord is an abhorration of good code quality

agile ore
oblique haven
#

public class SomeVelocityPlugin {} is valid for example, and there's no superclass to bind with, so that "global state instance" doesn't make sense

#

it also forces a decent structure of things, and if you'd like, you can break everything and declare all the stuff static, but it's not a good idea generally

#

especially for things like making your environment testable

#

in bungeecord, to even setup a testable environment you need to mock the entire proxy server class

bold wharf
#

Bungee is basically what happens when you create an experimental project and don't do any code cleanups since its inception

oblique haven
#

yerp ^

agile ore
#

md5 using ugly ass formatting

wary tiger
wary tiger
#

for the purpose of running tests. If the tests shared global state, then they would interfere with each other

oblique haven
#

testing in java heavily consists of being able to create and stub data

#

global state really hurts that

bold wharf
#

I mean, that's pretty much testing in any sane environment

#

individual tests of which can be as long or complex as needed to test an individual case against an individual instance of the software

stray cedar
#

Interesting to hear about Waterfall being deprecated. Probably good news, though of course it's quite a tall order for devs and server owners as Velocity and Waterfall/BungeeCord are different platforms.
I do a bunch of cross-server stuff that uses Bungee plugin messages - I'd like to know if the BungeeCord plugin messaging channel is supported on Velocity proxies. I hear that BungeeQuack implements it which was merged into Velocity via https://github.com/VelocityPowered/Velocity/pull/255, though it's unclear if this means that existing plugins using the Bungee messaging channel currently will just work?

bold wharf
#

You don't need to do anything different there

stray cedar
#

So it'll just work?

bold wharf
#

velocity already handles those messages and does what it needs to do

#

Yea

stray cedar
#

Awesome.

fossil sundial
fossil sundial
#

Hasn’t changed since api v1.1

stray cedar
copper hound
coarse topaz
copper hound
#

o ok

#

sorry

severe atlas
#

feels like dumb questions, but what are the velocity equivalents for getProxy().getPlayers() and ProxyServer.getInstance().getServers()?

agile ore
#

if this is not a thing already can it be added

#

if you send a http request to velocity proxy it sends a message like "you need to use minecraft"

#

that would be cool I think

thick bramble
#

That is something you could do with a plugin

#

Or, a proper webserver

#

That seems like a super dumb feature to have integrated, and, as I am not a velocity developer I can only assume, but am 99.9% sure something like that will never be native

deft yoke
agile ore
deft yoke
#

how

#

for when people enter your mc server domain in their web browser?

haughty summit
#

It's completely valid to host MC and Website under the same domain, so I can imagine it causing issues.

warm gulch
#

you wouldn't host minecraft under port 80 or 443

haughty summit
#

Yes, but you'll never see that message unless you explicitly would go to example.com:25565, which you rarely will specify the ports, so I think it's safe to assume it'd have to listen on :80 (or even :443 if you want to get certs, but that unnecessarily complicates it further).

warm gulch
#

yeah so there's no point in this because that would only happen if you type out :25565 yourself

analog dew
#

You can just... host a web server yourself?

#

I can't see any reason for Velocity to take on that responsibility

#

There are plenty of well-established web servers out there if you want a website or just a simple landing page for your server

fossil sundial
# agile ore yes

The final reason why this is a hard no is stability and security. Velocity has a tightly regulated protocol to ensure the proxy exposes as little attackable surface as possible. Foreign protocols are not on the list for this.

plain ledge
#

What's wrong here?

fossil sundial
#

Since it’s Kotlin I assume the annotation processor isn’t working

plain ledge
#

What should I do?

bronze yoke
#

use kapt

plain ledge
#

Im using it as plugin and added this but still not working

fading grove
#

velocity part of paper !

#

❤️

#

what a great day!

faint geyser
#

is there an event that is fired when player connects to proxy?

faint geyser
#

how can i connect player to server using velocity api?

bronze yoke
#

Player#createConnectionRequest(RegisteredServer)

#

you must call connect, connectWithIndication or fireAndForget after that

#

so something along the lines of player.createConnectionRequest(server).connectWithIndication()

lethal fern
#

hi guys i have 3 servers, If a player writes a message from any of them, I want it to go to other servers, how can I do it?

lethal fern
#

i solved

#

but now there is another problem

#

i need to know when someone is on any server, how can i do that, nothing like PlayerDeathEvent

proud pine
#

get the list of proxiedplayers?

lethal fern
proud pine
#

dunno

fossil sundial
#

You can use the Bungee messaging channel (it’s only called that) to get a list of players on the proxy

#

It works the same on velocity

lethal fern
#

should i use bungeecord?

covert folio
#

No

lethal fern
#

i don't want to use it

lethal fern
covert folio
#

Just read what Five said

lethal fern
#

sir this is not exactly what i want

#

a player on the server must send a message to velocity

#

player death, message must go to other servers

fossil sundial
#

But beware, you can only use plugin messaging if you have a player connected to the server you want to send it to

#

Otherwise you’d have to use another way

#

See #velocity-help and scroll up a bit for solutions that don’t use plugin messaging

agile ore
#

where do i add the "dependency" here? before or after </project> (following wiki)

#

new to java coding

bold wharf
#

you add a dependencies section and then add the dependency in there

#

I'd heavily suggest reading the maven docs or looking at other projects for getting to grips with maven

agile ore
#

kk

agile ore
#

BUT

#

now, how do i add exception (basically

if in config.toml "ignored-server" for example its "authserver"

i want the cmd to NOT execute if the player is currentlly in that server
)

fossil sundial
#

Then make your plugin check for that?

agile ore
#

how*

fossil sundial
# agile ore how*

? Check that the events invoker isn’t on the server you don’t want this to execute from

agile ore
#

how do i check that 👀

fossil sundial
#

you check if the events invoker is instanceof Player, if yes cast it to player, then check if the player has a current server with isPresent and if yes get the server and get the info and then check the name?

#

I’m not going to give you a Java tutorial

#

All else you need can be found in the apidocs

agile ore
#

woah this is a diff docs

lethal fern
#

@fossil sundial

#

can i send message from server to velocity?

fossil sundial
#

No need to ping me
If you have at least one player that is connected to the server through the velocity then the answer is yes
Otherwise no, unless, again, you use another solution

lethal fern
#

thanks

#

how can i send message from server to velocity

fossil sundial
#

Same way you’d send a plugin message to bungeecord

lethal fern
#

Is there a resource on how to do this?

#

happens in doc

faint geyser
#

anyone has idea why this is not working?

#

other events work good

#

but that event isnt triggering

rich hawk
#

Are you registering the listener?

faint geyser
rich hawk
#

Then it’s probably because that event isn’t getting fired by whatever plug-in provides if

faint geyser
pearl nimbus
faint geyser
#

only that one event is not working for me

agile ore
#

hello

#

how to build this velocity plugin ? when i build with maven package, i always have a problem with every velocity import API, thanks

bold wharf
#

outdated jdk?

agile ore
#

i think no

faint geyser
fossil sundial
# faint geyser

Make sure you are requiring the plugin this is from in the @Plugin annotation and please verify that the velocity annotation processor works correctly
Also, this has to be the Velocity @Subscribe annotation and not another one

faint geyser
#

buy i have other problem

#

how can i decide to which server player should connect using plugin?

fossil sundial
#

Look at the ChooseInitialServerEvent

#

And the KickedFromServerEvent.RedirectPlayer

faint geyser
#

thanks

slow ocean
#

Hello, could anyone please tell me what event i have to use instead ( I updated from bungee to velocity )

fossil sundial
slow ocean
#

nah but what event do i need for it

#

to listen to motd

#

check server*

fossil sundial
#

what do you want to do?

#

Modify MOTD?

#

or ping servers?

ashen pawn
fallen yacht
#

Quick question, if I wanted to change the UUID of a Player when they first join the proxy, can I simply listen for the GameProfileRequestEvent, rebuild the GameProfile with the provided properties minus the UUID, and then GameProfileRequestEvent#setGameProfile?

#

I'm reading through the LoginSessionHandler and it seems to be the case, since it fires that event and uses the result to create ConnectedPlayer

#

Also, would there be any unintended side effects of doing that, only asking from Velocity's standpoint as I manage everything using the UUID afterwards

fossil sundial
fossil sundial
#

@ashen pawn I’m gonna force-rebase the 1.18 pr later today; but I think we are merge-ready?

twin ingot
#

Hello, how can i ||kurwa ||translate ||kurwa ||colors? Is there an alternative method for ChatColor.translateAlternateColorCodes in Velocity. PandaSpoonSad

fossil sundial
twin ingot
slate hamlet
#

5-in-1 Emojii

agile ore
#

anyone know how to fix this?

bold wharf
#

check the full build output, might need to run with one of the flags to produce more info or something

knotty mica
#

Is there a way to check if the person running the command is in console? I tried this but it doesn't seem to be working.

#

"Hello!" prints but nothing else.

#

okay nevermind i'm just bad at googling

fossil sundial
bold wharf
#

isInstance probs doesn't do what you think it does

#

I was kinda gonna suggest instanceof but, brain spinny

knotty mica
#

I'm coming from python lol
also, is there any way to get a player from their username? I'm trying to add a player argument for my command

#

is it possible with SimpleCommand or do I have to try Brigadier?

slate hamlet
knotty mica
#

ty!

fallen yacht
#

Hello, quick question! How can I get the server a player is connected to with Invocation?

rich hawk
#

Cast to player

fallen yacht
#

ah such a simple thing, thank you

fallen yacht
#

arm, perhaps I'm stupid but I followed the velocitypowered documentation for creating a plugin, and I'm getting the error: com.velocitypowered.api.plugin.InvalidPluginException: Did not find a valid velocity-plugin.json. Perhaps I've forgotten something?

rich hawk
#

Kotlin ?

#

You need to add the annotationprocessor

#

If using kotlin use kapt

fallen yacht
#

ah it is kotlin, yeah

#

ok I'm compiling with jvm 16 and kapt seems to have problems with that

#

is there a way I can like manually do it without using any annotation processor

#

all right I've checked the source & found that it's just a json object basically with the values of the annotation + the fqcn of the plugin class

carmine spruce
#

Velocity now with Paper will still continue to support version 1.7.X
Which would be better to use for 1.7.X - 1.17.X, Waterfall or Velocity?

rich hawk
#

Waterfall doesn’t support 1.7

#

So velocity

carmine spruce
#

Yes, I know but Travertine has a patch to support 1.7.X

vernal compass
#

Travertine is no longer maintained or supported

carmine spruce
#

Thanks I will use Velocity

#

Is there a getting started for Velocity?

vernal compass
carmine spruce
#

Thanks again

fallen yacht
#

Is there a way I can sign a new "signature" value for GameProfile.Property? I need to add a "textures" property to change the skin I believe, but don't really know where I'd get the signature part from

burnt dragon
fallen yacht
#

how is the signature generated, this is an automatic process and I can't exactly access the website every time

bold wharf
#

it's "generated" by signing the skin

fallen yacht
#

let me guess, a mojang key?

bold wharf
#

correct

fallen yacht
#

damn, all right thank you

#

is the signature ever used lmao

bold wharf
#

for player skins? yes

#

skulls don't care about the signature iirc

fallen yacht
#

all right, thank you

obtuse dragon
#

Hello! I tried making MOTD but i dont know how to make it. Can someone help me? (Im not very advanced java coder)

thick bramble
knotty mica
#

am i importing configurate correctly? HoconConfigurationLoader.builder().path(Path) seems to be erroring out

bronze yoke
#

what is ninja.leaping

thick bramble
#

configurate 3.x, 4.x moved to org.spongepowered

bronze yoke
#

oh mb

thick bramble
#

but yeah that looks fine I think

#

what error do you get?

still basalt
# fallen yacht let me guess, a mojang key?

basically (and as far as I know) the website owns a lot of accounts that were willingly donated so that they can sign the skins for you through setting them on those accounts

#

pretty interesting tbh

fallen yacht
#

oh that's actually pretty cool

fallen yacht
#

hey, sorry for asking this because its quite unrelated
can anyone help me understand/walk me through making a BrigadierCommand that has a root of /profiles, then various subcommands (identified by different literals) then each subcommand has different argument types

#

I've looked at the official Mojang/Brigadier README, which I believe is the only wiki? and I don't really understand it aha

copper hound
#

im not sure if this is a better paper question or velocity so ill just ask here. Is there a way to do something like paper does with

  velocity-support:
    enabled: true
    online-mode: true
    secret: "Key"``` in minestom cause that is what i plan on using
bold wharf
#

Well, not paper

#

and, that's probs more minestorm to see if there is a solution for that

#

afaik, they're 100% DIY it, so, if there i anything it'll be floating around or something

copper hound
#

that may be a better idea to ask in there thanks

fallen yacht
#

one second Ill get u the code

copper hound
fallen yacht
#

right here, before the MinecraftServer.start or whatever, do VelocityProxy.enable(/* your secret */)

copper hound
#

thanks ❤️

fallen yacht
bold wharf
#

nicely documentation

#

advice, generally? look at other plugins which do that or use a pretty command framework, basically

#

(I mean, that was a mock of nicely and the expectation of documentation)

fallen yacht
#

why, is that such an outrageous hope lmao?

sweet zodiac
#

mojang has examples for brigadier on github but it isn't much documented beyond that afaik

bold wharf
#

just, general expectation of expecting anything much from mojang to be documented

fallen yacht
#

all right, I'll see if I can find a velocity extension and then see how they do it

#

thank you :D

fossil sundial
# obtuse dragon i mean descripiton

There is no such thing as description on server pings. I’m guessing you’re referring to the player list, you can also set that on velocity with that event but be warned, none of that is supported

obtuse dragon
fossil sundial
#

Velocity supports ping-passthrough if that’s what you’re looking for

obtuse dragon
#

i mean

#

MOTD on ping list

fossil sundial
#

That’s not MOTD

#

That’s the server list

#

Also known as tablist

#

Velocity has api for that

#

If the api is not used it will pass through whatever from the server

fallen yacht
noble plover
#

that's the proper name for it on a network level :p

obtuse dragon
#

i dont know how to parse it

fossil sundial
#

Roadmap to Velocity 3.1.0 (the 1.18-ready stable release)

  • Merge 1.18 Support
  • Add API for the new clientSetting
    What’s not gonna make it in this update
  • Modern modded support (maybe for polymer if it breaks API too badly)
  • Scoreboard api (no I’ve not forgotten)
#

I also want to defer #591 https://github.com/PaperMC/Velocity/pull/591/

#

@pearl nimbus I see you converted #518 to a draft, whats still missing there?

pearl nimbus
fossil sundial
#

I lost track, what were those? sorry

pearl nimbus
#
  1. whether you want me to use the new (still in preview) gradle version catalog feature
#
  1. whether its ok that I havent used indra because I just keep having issues with signing plugin compatibility
#

the PR works in its current state, its just a question of whether you want me to do these last things

#

or whether that can be addressed later, and just get something merged quickly

fossil sundial
pearl nimbus
#

so, if you want java 17 support now, you can have it

#

because the PR works

fossil sundial
#

I am not against 1) but it seems like both Tux and Kash were keen on 2)

#

I am trying to manage what I have time for, I have two math exams coming up soon

pearl nimbus
#

i can have another look at indra, but it basically couldn't find my secring

#

(even though that isnt even configured by indra)

#

and then I went back to my old script, and the signing plugin started working again

fossil sundial
#

Hmmmmmmmmmmmm

#

Tell you what, there is most certainly gonna be a .1 and .2 to 1.18

#

By then Ill have an answer to both those

#

but now I just dont have time

pearl nimbus
#

yup, im in a similar situation

#

I have some time to look at indra again, but its starting to simply take too long

fossil sundial
#

I would like to fix the resourcepack-queue before 1.18 release but I dont have time to do the extensive testing I would need to do

#

sigh

pearl nimbus
#

if only open source development were better paid

fossil sundial
#

yea no otherwise this all looks fine

#

I dont need to be paid for this, its my hobby but I am also a student and failing my exams is not a thing I want

fossil sundial
next epoch
#

Hype

knotty mica
# thick bramble what error do you get?

It was some errors about things seemingly not where they're supposed to be, I'm working off the examples on the configurate wiki which seems to use 4.x and not 3.x, which is what caused the error. Thank you!

fossil sundial
#

Soon-ish on velocity coming to the paper api

sharp blade
#

thanks

rocky owl
#

Does the latest snapshot support 1.18-rc1?

fossil sundial
#

Technically yes but the protocol version is already readied for release so to use it with the rc you’d have to change that back

rocky owl
#

i see

obtuse dragon
#

Can someone help me with parsing coloured motd

#

i mean server list

#

with hex colours

burnt dragon
#

if you're looking for something that can be used in a config, or you want to easily use gradients - look into MiniMessage

#

otherwise, you can just construct components manually

copper hound
#
[03:37:12 ERROR]: Unable to load plugin plugins/VoidBungee-1.0-SNAPSHOT.jar
java.lang.NullPointerException: null
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:878) ~[velocity-3.0.1.jar:3.0.1]
        at com.velocitypowered.proxy.plugin.loader.java.JavaVelocityPluginDescriptionCandidate.<init>(JavaVelocityPluginDescriptionCandidate.java:38) ~[velocity-3.0.1.jar:3.0.1]
        at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.createCandidateDescription(JavaPluginLoader.java:178) ~[velocity-3.0.1.jar:3.0.1]
        at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.loadPluginDescription(JavaPluginLoader.java:72) ~[velocity-3.0.1.jar:3.0.1]
        at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:93) ~[velocity-3.0.1.jar:3.0.1]
        at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:325) ~[velocity-3.0.1.jar:3.0.1]
        at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:223) ~[velocity-3.0.1.jar:3.0.1]
        at com.velocitypowered.proxy.Velocity.main(Velocity.java:64) ~[velocity-3.0.1.jar:3.0.1]
``` has anyone came across this error and know why this occurs?
thick bramble
#

the main class is null

#

are you using the annotation processor?

copper hound
#
@Plugin(id = "voidbungees", name = "VoidBungee", version = "1.0")
public class VoidBungee {

    private final ProxyServer server;
    private final Logger logger;

    @Inject
    public VoidBungee(ProxyServer server, Logger logger) {
        this.server = server;
        this.logger = logger;
        logger.info("It is running!");

        CommandManager commandManager = server.getCommandManager();

        CommandMeta meta = commandManager.metaBuilder("createserver").aliases("create").build();

        commandManager.register(meta, new CreateServer());
    }
}
#

yeah the @Plugin right?

rich hawk
#

No

#

Well yes but no

#

Are you using gradle?

copper hound
rich hawk
#

Did you add the annotationprocessor?

copper hound
#

ahhh ok that makes more sense

hidden stone
#

Tbh, this annotation retention being runtime is bad. It's not used in runtime for real, yet someone actually might do it anyway. And then you can possibly get a diff between annotation and a .json description file.

fossil sundial
light oyster
#

Hello, I was wondering on how can I make a config.yml file for my plugin that's intended to work on velocity proxies. Any ideas on how to do so?

fossil sundial
light oyster
fossil sundial
#

Yes

#

If you have the velocity-api dependency set-up correctly you don’t need any extra dependencies to use this. If you do end up adding extra dependencies you’re doing it wrong

#

I’ll make a short writeup about this sometime after Christmas

light oyster
#

Appreciate it 😄

burnt dragon
#

is there a way to check if a command that's being sent in the PlayerAvailableCommandsEvent is a command that is from the server or from a velocity plugin?

#

so, is there a way to check like "is this command registered in velocity's command manager" if that makes sense

slate hamlet
#

there should be a hasCommand method in the command manager

rocky owl
#

Latest 3.1.0 snapshot, modified to support pre8 + paper pre8

fleet sailBOT
rocky owl
#

1.17.1 -> 1.17.1 seems to work on the same proxy

fossil sundial
#

How does that happen?

#

Er how do you trigger that

rocky owl
#

just by connecting, it doesnt work at all on 1.18-pre8

fossil sundial
#

And what does your downstream setup look like

#

I tested it work rc1 no issues

rocky owl
#

rc1? what server software?

fossil sundial
#

rc1 fabric

#

With a modified FabricProxy-lite

#

But that’s not required

rocky owl
#

my downstream is running Paper git-Paper-"601a43d" (MC: 1.18 Pre-release 8) using modern forwarding

#

with the exact same config as the Paper 1.17.1 one that works

fossil sundial
#

I assume this is a broken paper

#

Ima try that in a few

rocky owl
#

the patch seems to be there though

#

ill try running with the debug flag

fleet sailBOT
rocky owl
#

one extra byte thinKappa

fossil sundial
#

That’s horrifying

rocky owl
#
        playerconnection.send(new PacketPlayOutLogin(entityplayer.getId(), worlddata.isHardcore(), entityplayer.gameMode.getGameModeForPlayer(), entityplayer.gameMode.getPreviousGameModeForPlayer(), this.server.levelKeys(), this.registryHolder, worldserver1.dimensionType(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), this.getMaxPlayers(), worldserver1.spigotConfig.viewDistance, worldserver1.spigotConfig.simulationDistance, flag1, !flag, worldserver1.isDebug(), worldserver1.isFlat()));
#

I think I know the issue

#

the issue could be the way i inserted my protocol versions

#

yep that was the issue

#

since i inserted it here instead

fossil sundial
rocky owl
#

so if I inserted the version enum before the 1_18 one, it would not work

fossil sundial
#

I assumed it was like you showed it before

knotty mica
#

So I have this code here that's meant to take me between servers

        try {
            ConnectionRequestBuilder connector = (player).createConnectionRequest(this.server);
            connector.connect().thenAccept(result -> {
                if (!result.isSuccessful()) {
                    source.sendMessage(Component.text("Unable to connect:\n" + result.getReasonComponent()).color(NamedTextColor.RED));
                }
            });
        } catch (Exception exception) {
            this.logger.error("Error:", exception);
            source.sendMessage(Component.text("An internal error occurred:").color(NamedTextColor.RED));
        }``` and it works, but for some reason it doesn't catch errors where the server is down (connection refused), resulting in an exception being printed to the console and absolutely no response from the proxy. Is there a special way to catch exceptions or should I add a check to make sure the server is reachable before trying to join it?
bold wharf
#

I mean, boils down to where the exception is actually coming from

#

if connect does stuff with a figure, your try catch is irrelevant

#

so, you'd probs want the whenComplete thing which might pass down the exception?

knotty mica
#

I'll give that a try, thanks!

#

Works

spiral portal
#

or add a "catch" using .exceptionally() after the thenAccept

#

something like

connector.connect().thenAccept(result -> {
    // Result handling
}).exceptionally(throwable -> {
    // Handle throwable
    return null;
});
agile ore
#

How to make text bold, italic, etc. In velocity

rich hawk
#

!adventure

#

.adventure

copper hound
#
   player.createConnectionRequest(registeredServer);``` This is how you send someone to a server right?
woven sleet
#

how would you get a registered server

#

for player.createConnectionRequest(registeredServer).fireAndForget();

sour current
#

ProxyServer#getServer(name)

woven sleet
#

thanks

#

im kinda new to velocity api

fierce egret
#

Is it possible for proxy to proxy connections (sending a player to another Velocity proxy)?

bold wharf
#

no

woven sleet
#

is it possible to change a players location?

#

like xyz

bold wharf
#

proxy has 0 control over that

#

you'd need a plugin on the server, basically

knotty mica
#

is it possible to check if the player is already being sent to a server instead of having to handle an empty error whenever I call .connect() on a ConnectionRequest?

merry trellis
narrow pagoda
#

@merry trellis More modern^

merry trellis
#

Ahh, thank you!!

celest ferry
#

Do you know when velocity 3.1 will come out?

ashen pawn
#

It will come out alongside Minecraft 1.18. Be patient.

agile ore
#

is it possible for KickedFromServerEvent to work on only one proxy, for example, I only want KickedFromServerEvent to work in the lobby. and proxies like skywars, bedwars, are ignored from KickedFromServerEvent. is it possible? and how

slate hamlet
#

What?

bronze yoke
#

just check what server they were kicked from?

agile ore
#

I mean, just to trigger KickedFromServerEvent on one proxy only

analog dew
#

...no

#

That's the worst idea imaginable

agile ore
analog dew
#

Just check inside your listener for what server the player was on when they got kicked

agile ore
bronze yoke
#

that's what I said lol

light oyster
#

Hello, I'm trying to load a config file with the YamlConfigurationLoader using the sponge configurate api

public class Main{

    final YamlConfigurationLoader loader = YamlConfigurationLoader.builder()
            .path(Paths.get("config - velocity.yml"))
            .build();

    CommentedConfigurationNode root;

    public void setup() {
        try {
            root = loader.load();
        } catch (IOException e) {
            System.err.println("An error occurred while loading this configuration: " + e.getMessage());
            if (e.getCause() != null) {
                e.getCause().printStackTrace();
            }
        }
    }

    @Subscribe
    public void onPreInit(ProxyInitializeEvent e){
        setup();
    }
}

But I get this error

[17:13:02 ERROR]: Can't create module for plugin logger-velocity java.lang.SecurityException: Invalid signature file digest for Manifest main attributes at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:317) ~[?:?] at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:259) ~[?:?] at java.util.jar.JarVerifier.processEntry(JarVerifier.java:316) ~[?:?] at java.util.jar.JarVerifier.update(JarVerifier.java:230) ~[?:?] at java.util.jar.JarFile.initializeVerifier(JarFile.java:759) ~[?:?] at java.util.jar.JarFile.ensureInitialization(JarFile.java:1038) ~[?:?] at java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:69) ~[?:?] at jdk.internal.loader.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:870) ~[?:?] at java.net.URLClassLoader.defineClass(URLClassLoader.java:517) ~[?:?] at java.net.URLClassLoader$1.run(URLClassLoader.java:458) ~[?:?] at java.net.URLClassLoader$1.run(URLClassLoader.java:452) ~[?:?] at java.security.AccessController.doPrivileged(Native Method) ~[?:?] at java.net.URLClassLoader.findClass(URLClassLoader.java:451) ~[?:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:589) ~[?:?] at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass0(PluginClassLoader.java:66) ~[Velo.jar:3.0.1] at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass(PluginClassLoader.java:60) ~[Velo.jar:3.0.1] at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?] at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:88) ~[Velo.jar:3.0.1] at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:122) ~[Velo.jar:3.0.1] at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:325) ~[Velo.jar:3.0.1] at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:223) ~[Velo.jar:3.0.1] at com.velocitypowered.proxy.Velocity.main(Velocity.java:64) ~[Velo.jar:3.0.1]

bold wharf
#

if you've not solved it yet, 99% chance that you shared in some library which has a signature, you basically need to exclude those files, see the config for whatever tool you're using to shade/shadow stuff

light oyster
#

I have it fixed, it had something to do with the .json file 😅

light oyster
#

How can I register an event in another class and call it in the main? like Spigot getServer().getPluginManager().registerEvents()?

ashen pawn
analog dew
#

I think you may have missed the point of why I linked a specific page in the Java tutorials earlier

turbid thistle
#

i'm completely new to this and i'm trying to see what the possibilities are for creating a inventory menu server selector. But i'm getting stuck at the part of connecting the player to a different server. How would i do this? i've done some searching and found some examples for BungeeCord which opens a MessageChannel with the "BungeeCord" name where you can send commands to, how does this work in velocity?

rich hawk
#

Same thing

turbid thistle
bold wharf
#

no

#

velocity emulates the exact same channel that bungee does

turbid thistle
#

ok, and is that also the recommended way of doing this or is there a better way?

rich hawk
#

It is the way

turbid thistle
#

ok thanks

fossil sundial
#

Yea we didnt bother reinventing the wheel there

jaunty raptor
#

Hi, im trying teleporting player between my two fabric server, but i dont know how use the "packet format"
this is my code from my own fabric mod
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeByteArray("serverTWO".getBytes()); // This is the name of server TWO
passedData.writeByteArray("MTEA_MAP_TEST".getBytes()); // This is the map name
passedData.writeByteArray(serverPlayerEntity.getUuidAsString().getBytes());
ServerPlayNetworking.send(serverPlayerEntity, CHANNEL_NAME, passedData);

bold wharf
#

see the bungeecord wiki if using those messaging channels, no idea if there is a velocity alternative to that doc

#

but, generally, strings are length prefixed

#

map name is irrelevant

ancient cosmos
coarse topaz
#

yes

#

You can also unregister them on the fly too, they just won't be added to the config (iirc)

inland sigil
#

where do I download velocity with 1.18 support

thick bramble
agile ore
#

what happens to old biomes when updated to 1.18?

#

also they added paletted biome storage right?

fossil sundial
agile ore
#

i was wondering why paper dev was so dead lmao

slow ocean
#

Hello, how do I set a MOTD for the proxy server

thick bramble
#

you can set a custom response

slow ocean
#

thank you

slow ocean
#

How do i add a server in runtime?

#

In bungee u had to add them clear the config and put them again in there bec u couldnt just add

slow ocean
#

yeah thanks and how can I make this the default server the player instantly connects to?

bronze yoke
#

use PlayerChooseInitialServerEvent

#

and set the target to that server

slow ocean
#

Okay thanks a lot

bronze yoke
#

yw

pseudo valve
#

Hi

#

I have a problem with KickedFromServerEvent. If a player gets kicked from a server and I'm setting the result to redirect the player to another sever the player still gets kicked from the proxy but also redirected to that server

slow ocean
fossil sundial
slow ocean
#

okay thanks

pseudo valve
pseudo valve
# pseudo valve

you can see here that I'm being sent do Silent-1 after disconnected from the proxy

pseudo valve
#

on velocity 1 was fine

slate hamlet
#

I wrote some code which does the same thing a few days ago and it works perfectly PandaThink

worn sonnet
#

Hi, I'm currently modifying the velocity src for my server. I understand If I don't get any support while doing so, but I do have a question:

  • I need to use the scheduler in VelocityServer#getScheduler, however it requires a plugin argument to be passed. Because I am not working with a plugin, and I am working with the source. I tried passing null but there is a not null check.

How would I use scheduler in my situation?

bold wharf
#

So, just use a standalone scheduler service?

#

I mean, ideally what you do is make a plugin and contribute back API where it's needed

fossil sundial
vestal prawn
#

is there performance comparaison between bungeecord based proxy and Velocity ? And is it worth to migrate if we have only 2 plugins to migrate ?

trim otter
oblique haven
#

I’d recommend it over bungee or waterfall any day

#

There’s also a cleaner API to work with on the plugin end. (This is opinion based but still)

vestal prawn
#

okay then i will migrate, the documentation is way cleaner than bungee with the little that i saw

vestal prawn
oblique haven
vestal prawn
#

Okay thanks i'll try it

light oyster
#

Hello, how can I get the plugin's current version?

wary tiger
#

For your own plugin, use source replacements with your build system to create a version constant

slow ocean
#

Hello, why do I get this error: I have in player-info-forwarding-mode none before I had modern both responded the same error

bold wharf
#

You have bungeecord mode enabled in the server

#

Yet you're not using legacy data forwarding

slow ocean
#

thanks

slow ocean
#

Hello again, I'm trying to connect a player to another server, I tried it with ...createConnectionRequest(server).connect(); when I debug I'm getting the correct server the player should be sent to and the current status CONNECTION_IN_PROGRESS and nothing happens

#

the server I'm trying to connect to does not give a error. The target server doesnt even get the info that I'm trying to connect

granite jacinth
#

question, where did build #95 go?

half locust
#

Moved to paper's build server I guess

#

Downloads available from paper's download api

granite jacinth
#

I have 2 velocity servers running, one for LAN connections and one for external connections, and I realized they had different versions, when I went to update the older one, I got build 94, but I didn't think that was right, so I checked and the other one was running build 95...

#

oh duh, I went to old URL, thanks

#

time to delete that bookmark...

slow ocean
#

Hello, how do I connect a player to another server my attempt with createConnectionRequest(server).connect() didnt work. Any clues?

fossil sundial
slow ocean
#

CONNECTION_IN_PROGRESS

#

wait imma look

slow ocean
agile ore
bronze yoke
#

Is there an event that gets called when a connection to a server is abruptly closed? Like when the server is killed? I can't find anything on the javadocs & KickedFromServerEvent isn't called.

amber ridge
#
Invalid ID for plugin me.mleczu.dvybalancer.DVYBalancer. IDs must start alphabetically, have alphanumeric characters, and can contain dashes or underscores.```

Is it caused by ```
@Plugin(
        id = "DVYBalancer",
        name = "DVYBalancer",
        version = "1.0"
)```?
agile ore
#

Pretty sure the id has to be lowercase

amber ridge
#

Ya, thanks

silent flint
#

When tab user sorting?

bronze yoke
#

you'll be able to once there is a scoreboard api

amber ridge
#

How to send player to another server?

amber ridge
#

this link works, ty

worn sonnet
#

How can I perform a proxy command as a player?

bold wharf
#

You can't, not without a plugin on the proxy to send commands to

#

if you wanna do stuff like changing servers, velocity implements the bungee plugin channel

worn sonnet
#

Dam. Thanks

#

Just to clarify, I'm using the velocity API, not the paper/spigot API?

I might have misunderstood your response.

bold wharf
#

oh, i misunderstood, that one often comes from people tryna run commands on the proxy from the server

charred pulsar
#

Is there any available documentation for plugin message in velocity api?

bold wharf
#

would need to check the javadocs, should be a method somewhere to execute a command

#

yea, methods on the CommandManager

vestal prawn
#

From a bukkit plugin how to send players to another server ? Is it like bungeecord ?

knotty mica
#

if you wanna do stuff like changing servers, velocity implements the bungee plugin channel

fossil sundial
vestal prawn
#

We use the same as bungeecord ? There is no newer/better way ?

knotty mica
#

there might be but at the same time, there's no use reinventing the wheel

fossil sundial
#

We didn’t reinvent the wheel; yea; there might be a bit more mature api sometime in the future

jaunty raptor
#

How create a command, Docs are a little bit outdated
Command interface has nothing written inside

rich hawk
jaunty raptor
#

is normal that SimpleCommand interface hasnt any method it said:
SimpleCommand has three methods: one for when the command is executed, one to provide suggestions for tab completion ...

#

But i dont have execute, suggest, hasPermission

rich hawk
#

You implement SimpleCommand then you’ll have them

vestal prawn
#

🤦

jaunty raptor
#

my minecraft said "Unknown or imcomplete command, ..." when i add this line to my plugn

.then(argument("playerName", StringArgumentType.string())) ```
rich hawk
#

Where are you doing that

fossil sundial
jaunty raptor
#
    @Subscribe
    public void onProxyInitialization(ProxyInitializeEvent event) {
        var node = LiteralArgumentBuilder.<CommandSource>literal("switchPlayer")
                .then(argument("playerName", StringArgumentType.string()))
//                .then(argument("serverTarget", StringArgumentType.greedyString()))
//                .then(argument("posX", DoubleArgumentType.doubleArg()))
//                .then(argument("posY", DoubleArgumentType.doubleArg()))
//                .then(argument("posZ", DoubleArgumentType.doubleArg()))
//                .then(argument("yaw", DoubleArgumentType.doubleArg()))
//                .then(argument("pitch", DoubleArgumentType.doubleArg()))
                .executes(context -> {
                    System.out.println("COMMAND switchPlayer EXECUTED");
                    context.getArguments().forEach((s, commandSourceParsedArgument) -> {
                        System.out.println("arg: " + s);
                        System.out.println("value: " + commandSourceParsedArgument.toString());
                        System.out.println("value class: " + commandSourceParsedArgument.getClass().getName());
                    });
                    return 1;
                }).build();
        server.getCommandManager().register(new BrigadierCommand(node));
    }```
bronze yoke
#

you're not using the executes method on the argument but on the literal

craggy pecan
steady trellis
#

@ tux sadpepega rip velocity discord

#

quick question, what's the difference between the brigadier command system and the regular that everyone is used to

vivid patrol
#

How is it different?

half locust
#

you need to shade JDA

vivid patrol
#

Thank you.

vivid patrol
#

Is this the best way to send a message?
TextChannel channels = jda.getTextChannelById("channel ID");
Objects.requireNonNull(channels).sendMessage("test--").queue();

#

The error is this.

woven anvil
#

I want to disable certain forge and fabric mods when joining the server. I heard that there is a packet to let forge automatically disable certain mod ids. How can I send this packet?

autumn kernel
#

Forge sends the mods a client used in its handshake packet but afaik you can't disable them, only kick the player

woven anvil
#

Oh okay

fossil sundial
woven anvil
#

Ye I tried this event but it somehow never fired

fossil sundial
#

Did you enable announce forge in the velocity config?

woven anvil
#

I did

fossil sundial
#

And the mods you’re disabling are client-side only?

#

Most of those mods don’t even advertise themselves at all; so you cannot exactly detect them anyway

woven anvil
#

I want to disable minimap mods and mods like that

fossil sundial
#

Some advertise themselves and some don’t

#

Journeymap should advertise itself but that’s not a rule

woven anvil
#

So there is no way I can prevent that?

fossil sundial
#

If the client doesn’t tell the server what it’s running you’re not gonna know

#

That’s simply the truth

woven anvil
#

Hmm okay thank you

vivid patrol
#

I tried to copy the guildID and channelID in developer mode, but I get an error.

#

I changed it to "guildID L" because I didn't want it to show, and L is for long type.

bronze yoke
#

what??

#

that is not how that works

vivid patrol
#

How do I send a message to a discord channel?

rich hawk
#

FYI this is velocity-dev not jda-dev

soft slate
#

Any idea why my permissions arent working?

    @Subscribe
    public void checkPerms(PermissionsSetupEvent event) {

        if (!(event.getSubject() instanceof Player player))
            return;

        PermissionUser permissionUser = plugin.getPermissionUserManager().getPlayer(player.getUniqueId());

        if (permissionUser == null) {
            System.err.println("Failed to find Permission User for " + player.getUniqueId());
            return;
        }

        RankManager rankManager = plugin.getRankManager();
        event.setProvider(permissionSubject -> name -> PermissionListener.hasPermission(permissionUser, name, rankManager) ? Tristate.TRUE : Tristate.FALSE);

    }
barren wedge
bold wharf
#

The things loaded from the disk and saved back to it using the config library

pallid reef
#

Where/how can I read Velocity API documentation?

#

(the plugin API)

sour current
pallid reef
#

That's the basics, I need full API documentation

#

Tried ./gradlew javadoc but it's erroring out

sour current
pallid reef
#

YES thank you mcheart

slow ocean
knotty mica
#

What are you trying to do?

gritty valve
#

hi sorry for stupid question but how can I import com.velocitypowered.proxy.protocol * ?

craggy pecan
#

You will need to depend on the proxy JAR, not the API one. That's generally not needed as you will depend on implementation details that may change at any time, what's your use case?

gritty valve
#

API

#

understood thanks

vivid patrol
#

How do I put a message to all players on all servers?

craggy pecan
#

ProxyServer#sendMessage, the server is an Audience

soft slate
slate hamlet
#

I have a problem with KickedFromServerEvent - if a player tries to connect from a lobby server to another Server but gets kicked during the login, my plugin tries to set the fallback of the player to the only available Lobby server (that server is still marked as the server the player is connected to). This results in a wrong disconnect of the player, as the Lobby can accept the player connection... Is there a way around this?

vivid valve
#

At which part of the login stage does PermissionsSetupEvent get called?

slate hamlet
#

After ProfileRequest and before Login

vivid valve
#

Hmm, okay.

stray cedar
#

Is there an equivalent for Velocity of specifying libraries to download at runtime, like is the case with BungeeCord and Spigot?

libraries:
  - library.name

I'd like to not have to bundle SQL drivers in the jar.

coarse topaz
#

No, you’ll have to manage it on your own

stray cedar
#

sadge

#

does velocity bundle any MySQL/SQLite drivers at all?

fossil sundial
stray cedar
#

I suppose I could release a dependency plugin separately that is required for the velocity plugin, but it seems cumbersome

#

I’m distributing a premium resource, so externally uploading isn’t an option.

fossil sundial
#

You could minify your jar

#

That should at least save some space

stray cedar
#

Hmm, I can look into that, though the difference is about ~8MB, not sure it’ll work

oblique haven
#

Then hold a cache

#

Just a thought

fossil sundial
slate hamlet
#

So

#

You're trying to connect from Lobby-1 to Testing-1

#

You get kicked while connecting to Testing-1

#

The plugin now tries to connect you to Lobby-1 which results in a disconnect

vivid patrol
#

The channle of MessageReceivedEvent seems to be set to null and does not work. How can I change it so that it is set to a variable? (In other events such as onStop and PlayerChatEvent, the variable is set.)

fossil sundial
open nimbus
#

what is velocity

ashen pawn
vivid patrol
#

e.getPlayer().getCurrentServer().get().getServerInfo().getName()
to get the name of the server where the Playerchatevent player is located. Should I change something?
It's from minecraft playerchatevent with velocity

charred pulsar
#

is the tablist per server handled by velocity or it just forwarding tablist packets from the minecraft server?

fossil sundial
#

Events are fired async and it can happen that the player is kicked while the chat event is firing

vivid patrol
#

How do I use isPresent()?

bold wharf
#

it's a method on Optional which says that there is an element

vivid patrol
#

Which one am I supposed to do?

bold wharf
#

what?

vivid patrol
#

Is it like this?
if (e.getPlayer().getCurrentServer().isPrese like this?

bold wharf
#

it's a method which returns a boolean, if it returns true, you can safely call get, if not, you can't

#

store getcurrentServer in a local field

#

and then check isPresent, or use the orElse, etc

#

heavily suggest reading up on optionals if you're struggling with how to use them safely

vivid patrol
#

Oh, I see.

vivid patrol
#

How do I send a colored message?(How do I write textcompornent?)

fossil sundial
reef tiger
#

How can I get an offline player's username with their UUID? Is there any pre-made ways?

bold wharf
#

no, you'd need to store it, basically

reef tiger
#

uhum, Okay, Ty

fossil sundial
bold wharf
#

I misread, thought they meant like, v3

vivid patrol
#

I want to turn off the joinmessage of PostLoginEvent and the quietmessage of DisconnectEvent, what should I do?

fallen yacht
#

does anyone know the actual ratelimits of the mojang api, they like just dont tell you

agile ore
fallen yacht
#

it doesnt

#

the only mention of ratelimits is for the UUID to Skin API request, and it simply says "This has no ratelimit."

agile ore
#

You should note that all public APIs are rate limited so you are expected to cache the results. This is currently set at 600 requests per 10 minutes but this may change.

fossil sundial
#

Adding onto that it’s an increasing rate limiter

#

So the more requests you do the lower the ceiling gets

craggy pecan
#

Won't be disclosed for a while, make sure you upgrade

hollow smelt
#

The posted link only seems to show versions up to 3.1.0 for velocity, am I missing something? Thought the post said 3.1.1 had the fix?

fossil sundial
#

The other builds section has it; see the build number in #announcements

#

I’m very sorry for this mess

raw frost
#

It looks like a vulnerability in <censored>. Do we know what kind of security vulnerability we are looking at, whether Spigot 1.17.1 servers are also vulnerable and whether having an updated proxy protects servers after it or not?

pallid reef
#

Perhaps the build #97 should be pinned on the website download section?

raw frost
#

I've read it and I don't believe that these questions were answered.

narrow pagoda
#

Do we know what kind of security vulnerability we are looking at
(Redacted, just found out we were asked not to share this)
whether Spigot 1.17.1 servers are also vulnerable
Probably? I can check the dep tree but, assume yes anyway.
whether having an updated proxy protects servers after it or not
This depends on your setup, I say upgrade everything and don't take any chances

#

@raw frost

raw frost
#

Thanks

narrow pagoda
#

<@&748618676189528155> Someone delete this? Pins in #paper-help say not to make it super accessible 👍

boreal stone
#

thanks dejay<3

proper steeple
#

!kick 466962470733479966 Don't share links to exploits

sleek nacelle
#

Dejay!

edgy wolfBOT
#

:raised_hands: Kicked derklaro#1552 (Don't share links to exploits) [2 total infractions] -- NotMyFault#3732.

raw frost
#

I've removed some info from my message as well 🙂

hardy remnant
#

how severe is the exploit?

#

as in, do I need to put my server in maintenance mode until we have it ported to our custom fork?

half locust
#

yes.

bold wharf
#

mostly a DoS attack so it seems right now

vestal prawn
#

If we have velocity 3.1.1, does it protect every spigot servers behind the proxy ?

#

Or do we need the patch on every single spigot server

bold wharf
#

no, yes

vestal prawn
#

Mmmh

#

so i upgrade everything ?

fickle roost
#

Hey, i'm right now trying to remake the Velocity Port of gChat by Luck and md678685 for velocity version 3.0.1 and later but i get this error and i can't find a way to fix it 😦 Can someone help me? 🙂

raw frost
stray wind
raw frost
#

Yes indeed, oh, the Adventure library was actually a replacement for an old text library. I do recall that I had to update some imports. I'm not sure then, but that class doesn't seem to be in his runtime environment.

fickle roost
#

I tried to use this library, but it not helps, even if i tell maven the scope "runtime" 😦

raw frost
#

But I'm pretty sure that Velocity offers something that you can use for what you're trying to do with that library.

fickle roost
#

But like i said its not directly my code 🙂 Me just try to upgrade it to the new Velocity version because the old author seems not to do it anymore 😦

fickle roost
raw frost
fickle roost
#

Thank you, i gonna look over it

narrow pagoda
raw frost
#

The Velocity development download link at https://velocitypowered.com/downloads is down (error 1001, worker threw exception). Is there a new official place to download Velocity since the move to PaperMC?

burnt dragon
raw frost
#

Thanks

sonic egret
#

I'd like to announce that after 4 months of using velocity 1.9 in fear of updating to 3.x because of some plugins being incompatible, I finally did it for the exploit and literally everything fucking works fine why did I dread it to the point I didn't even try waaaaaaa

vivid patrol
#

How do I get rid of the joinmessage and leavemessage for inter-server moves?

frigid rivet
#

You'd need to do that on each backend server. Velocity doesn't control that.

vivid patrol
#

Okay.

hidden gale
#

Hey, can i add some velocity netty code to my bungee fork? If i need to give acces to someone, or smth like that.

fossil sundial