Various "ban player/ip" methods don't support Components as reasons #10535
Machine-Maker
started this conversation in
Ideas
Replies: 1 comment
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem?
Component support for ban reasons.
Currently you can use legacy formatting in ban reasons, both by adding a ban via the BanList API or on the various
banPlayer
methods Paper adds on the OfflinePlayer API.Legacy formatting isn't sufficient to cover all usecases of ban reasons, both in the initial kick message displayed to the user from
banPlayer
or the message with the reason that is showed when a player tries to log in, because while hover/click events don't do anything, translatable components are support there, both client-side and server-side translations which cannot be represented as legacy textDescribe the solution you'd like.
My initial thought is to add an additional field for ban entries to store a JSON reason as that is lossless when serializing from a component. Then if it exists when read, that would be used over the normal string reason. For API compatibility, simply returning the legacy serialized version of the component as the string reason should suffice.
Describe alternatives you've considered.
A lesser solution to the lack of components for the banPlayer methods is to just add ones with Component paramters for the kick message since that does in fact support Components.
Other
I would've just implemented this myself, but wasn't sure on the whole "adding a property to each ban entry for profiles and ips" thing. It'd just be named something like
Paper.banReason
so it won't conflict with anything mojang might add in the future.Beta Was this translation helpful? Give feedback.
All reactions