#adventure
1 messages · Page 2 of 1
Adds CompoundBinaryTag#containsKey(Key) and #contains(Key, Type) utility methods.
Pretty straightforward, only potential point of concern is that #contains currently uses the same numeric-types-match logic, (I.e. checking an int for being a long type would return true) - probably fine because that's how the other methods behave? but if not it can be changed into exact type matching.
Adds CompoundBinaryTag#createBuilder, which creates a builder from the compound tag's current contents.
This is useful if you're editing a couple of values at once, like compound.createBuilder().putInt("num", 6).putString("name", "Timothy").remove("old_value").build().
Might have merge conflicts with #1264, but I'll fix up whichever one is merged last.
Exposes BinaryTagType#binaryTagType(byte id), to get a tag type by it's byte id.
This is needed if you're writing any sort of custom serialization, as currently you can get the id to serialize, but there's no way to de-serialize.
I also changed BinaryTagType.List TYPES to a BinaryTagType[] - technically hard-coding the size is not great, but seeing as:
- There haven't been any new types in over 8 years.
- It's a very easy change to make if any ever get added.
- It'll error on startup when calling
registerwith any potential new tag type.
it should be fine imo; still, lmk if you want me to revert it to the old list iteration & compare id approach.
Also, maybe it should return null instead of throwing? I just followed what the method already did, but maybe it would be better to change that, idk.
Just for reference for those of you following this PR:
- The PR itself appears to be functional, you are more than welcome to manually include it in your code/plugin/project if you need to.
- We have some issues at the moment relating to the recent publishing changes that are currently blocking this PR from being merged that will be worked on when we have time.
We appreciate your patience :muscle:
01:21:36 WARN: at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
01:21:36 WARN: at java.base/java.lang.reflect.Method.invoke(Method.java:580)
01:21:36 WARN: at MailMe.jar//net.mailme.libs.mf.base.CommandHandler.executeCommand(CommandHandler.java:217)
01:21:36 WARN: at MailMe.jar//net.mailme.libs.mf.base.CommandHandler.execute(CommandHandler.java:167)
01:21:36 WARN: at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83)
01:21:36 WARN: at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73)
01:21:36 WARN: at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30)
01:21:36 WARN: at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13)
01:21:36 WARN: at n...
01:21:36 WARN: at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
01:21:36 WARN: at java.base/java.lang.reflect.Method.invoke(Method.java:580)
01:21:36 WARN: at MailMe.jar//net.mailme.libs.mf.base.CommandHandler.executeCommand(CommandHandler.java:217)
01:21:36 WARN: at MailMe.jar//net.mailme.libs.mf.base.CommandHandler.execute(CommandHandler.java:167)
01:21:36 WARN: at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83)
01:21:36 WARN: at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73)
01:21:36 WARN: at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30)
01:21:36 WARN: at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13)
01:21:36 WARN: at n...
Just for reference for those of you following this PR:
The PR itself appears to be functional, you are more than welcome to manually include it in your code/plugin/project if you need to.
We have some issues at the moment relating to the recent publishing changes that are currently blocking this PR from being merged that will be worked on when we have time.
We appreciate your patience :muscle:
Thank you for the update, it is appreciated.
Just for reference for those of you following this PR:
- The PR itself appears to be functional, you are more than welcome to manually include it in your code/plugin/project if you need to.
- We have some issues at the moment relating to the recent publishing changes that are currently blocking this PR from being merged that will be worked on when we have time.
We appreciate your patience 💪
Thank you! My users will be very happy to see this has been finished
e.g. {test:0b} would error before this change. The second change is just cosmetic
Uh apparently, and theirs handles a case of what actually isn't accepted without quotes, 0x 🐥
Books not opening anymore on 1.21.7.
Tested on:
Paper 1.21.7-32-main@e792779 (2025-07-16T20:10:15Z) for Minecraft 1.21.7
compileOnly("net.kyori:adventure-api:4.24.0-SNAPSHOT")
compileOnly("net.kyori:adventure-text-minimessage:4.24.0-SNAPSHOT")
compileOnly("net.kyori:adventure-text-serializer-gson:4.24.0-SNAPSHOT")
compileOnly("net.kyori:adventure-text-serializer-gson-legacy-impl:4.24.0-SNAPSHOT")
compileOnly("net.kyori:adventure-platform-bukkit:4.4.1-SNAPSHOT")
This code does nothing on 1.21.7.
bukkitAudiences.player(event.getPlayer()).openBook(Book.builder()
.author(Component.text("Kyori", NamedTextColor.AQUA))
.addPage(Component.text("is amazing", NamedTextColor.DARK_GRAY))
.title(Component.text("Adventure", NamedTextColor.LIGHT_PURPLE))
.build());
[KyoriPowered/adventure-webui] branch deleted: renovate/adventure
[KyoriPowered/adventure-webui] branch deleted: renovate/ktor-monorepo
[KyoriPowered/adventure-webui] branch deleted: renovate/org.jetbrains.kotlinx-kotlinx-serialization-json-1.x
aea761b chore: remove now unused docker swarm deployment - MiniDigger
bb6505d feat: labels and tags for auto updating - MiniDigger
ff435bd fix: replace new lines with commas? - MiniDigger
b3ec84b Temporarily use indra snapshot - jpenilla
85b6de2 Remove old sonatype host specification - jpenilla
I feel this is a report to paper where the method is implemented but i remember using in a PR with not issues, just the title ignored because that interface not show that
86bad73 fix(build): Temporarily use indra snapshot to fix... - jpenilla
[KyoriPowered/adventure-platform] branch deleted: renovate/gradle-and-github-actions
[KyoriPowered/adventure-platform] branch deleted: renovate/major-gradle-and-github-actions
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/me.lucko-fabric-permissions-api-0.x
feb62bc Update compatible version metadata - jpenilla
ccaa043 Update neoforge tester metadata - jpenilla
Hi!
When I use net.kyori:adventure-platform-bungeecord:4.4.0 to show a bossbar, client just doesn't render it or crashes after a while. Here is an example of code causing this:
val audiences = BungeeAudiences.create(plugin)
for (i in 1..10) {
// just an example, i make a delay between tries in a real code
audiences.create(plugin).player(player).showBossBar(
net.kyori.adventure.bossbar.BossBar.bossBar(
Component.text("test $i"),
1f,
net.kyori.adventure.bossbar.BossBar.Color.RED,
net.kyori.adventure.bossbar.BossBar.Overlay.NOTCHED_12,
)
)
}
Usually I am able to see "test 1" (first bossbar), then I get kicked.
I tried it on a Fabulously Optimized 1.21.8 client and a 1.21.5 + ViaFabricPlus client. Both crashed with the same error.
[!] That's not a client problem since I was able to correctly display bossbars using the "BossBar" packet from BungeeCord API.
Here is an error:
---- Minecraft Ne```...
2209ed3 Setup release publishing actions - jpenilla
[KyoriPowered/adventure-platform-mod] New tag created: v6.5.0
This version of adventure-platform-mod adds support for Minecraft 1.21.6 through 1.21.8, distributing Adventure 4.23.0 for the Fabric and NeoForge platforms. Minecraft versions older than 1.21.6 are not supported by this release.
What's Changed
✨ Features
- Minecraft 1.21.6 by @jpenilla in https://github.com/KyoriPowered/adventure-platform-mod/pull/206
Full Changelog: https://github.com/KyoriPowered/adventure-platform-mod/compare/v6.4.0...v6.5.0
[KyoriPowered/adventure-platform-mod] New tag created: v6.5.1
[KyoriPowered/adventure-platform-mod] tag deleted: v6.5.1
800385b Add back fabric api version to catalog for product... - jpenilla
[KyoriPowered/adventure-platform-mod] New tag created: v6.5.1
This version of adventure-platform-mod is a hotfix to address metadata not passing Maven Central validation.
Full Changelog: https://github.com/KyoriPowered/adventure-platform-mod/compare/v6.5.0...v6.5.1
Feature
Add a tag that will format text with SmallCaps style.
Reason
Many servers use the SmallCaps characters for their messages, scoreboards etc.
<img width="652" height="257" alt="Image" src="https://github.com/user-attachments/assets/78cafdf7-0c0e-45c1-989d-b41cb6136bff" />
TinyTextGenerator
Here's the generator that people usually use:
https://lingojam.com/TinyTextGenerator
So now the question is:
Is it possible to add it into kyori adventure? It would be an awesome feature.
This was relatively easy to implement as ModDevGradle already supports interface injection, though with a slightly different format to Fabric's.
I also had to add an ItemHoverEventSource interface since custom classes with generic arguments (and on top of that an inner class as generic argument) don't work properly yet (see neoforged/JavaSourceTransformer#53).
Because of that, the mixin and fabric.mod.json were changed to that interface, as well.
This change should be able to be backported to older versions as well, let me know if you want me to open a PR for 1.21.1 as well (I want to use adventure on that version, actually)
I'm happy with either solution as long as the problem gets fixed.
I'd add a comment here like from my PR // There should be more after '0b'/'0x', else it would be a regular byte tag or string
I have complained on the discord before about how creating titles is unnecessarily verbose and multiple people agreed with me. This is my idea to make it a little simpler. I think just specifying the duration in ticks is quite natural. Pretty much all APIs including Minecraft's own commands do it that way, so it shouldn't be confusing to anyone.
Another idea I had was adding a showTitle method that doesn't require a Title object and just takes the params directly but I'm not sure if that goes against adventure's design philosophy or not. I'm of course still open to any other ideas to improve title creation!
pr opening background: <img width="597" height="400" alt="image" src="https://github.com/user-attachments/assets/9a051e68-2683-4f33-bd65-98df53a2a7bf" />
If the TranslationStore was mutated after it was added as a source in the GlobalTranslator it can no longer be removed.
Code To Replicate:
final GlobalTranslator globalTranslator = GlobalTranslator.translator();
final Key key = Key.key("plugin", "whatever");
final MiniMessageTranslationStore translationStore = MiniMessageTranslationStore.create(key);
translationStore.defaultLocale(Locale.ENGLISH);
globalTranslator.addSource(translationStore);
// Mutating translation store
mmts.register("hello.message", Locale.ENGLISH, "Hello!");
globalTranslator.removeSource(translationStore); // returns false
Using net.kyori:adventure-text-minimessage:4.23.0 bundled in Paper API (1.21.8-R0.1-SNAPSHOT).
That would be awesome.
Also there is a neater variation of the letter F than the one provided by the generator:
| Char | Unicode Codepoint |
|---|---|
| ꜰ | U+A730 |
| ғ | U+0493 |
| <details> | |
| <summary>In-game screenshot</summary> | |
| <img width="1075" height="560" alt="Image" src="https://github.com/user-attachments/assets/c1e46564-03d8-432c-8934-c6cc88525c13" /> | |
| </details> |
Closes #1271
Still some stuff to do if this is wanted, but I had the code lying around for this in another project and figured I'd open up a PR just so there's something to work off of.
I'm not entirely sure how to get the assertSerializedEquals working, and also not sure if my character mapping is the best default.
cheers :-)
how does the narrator read small caps? I am having accessibility concerns
yeah accessibility is definitely something to think about here. the narrator seems to just ignore small caps.
the ideal solution would probably be for servers to add a font that looks the same as small caps, but that doesn't seem to be a very popular choice.
intellij is saying thats java 9 api
Minecraft vanilla stores hex color codes as upper cased #29A6FE however the TextColor::asHexString returns it as lowercase #29a6fe. Paper uses it in their color codec, which causes desync issues: https://github.com/PaperMC/Paper/issues/12902
Mutating a AbstractTranslationStore (e.g., registering a translation) causes its hash code to change. This results in the remove method searching for the wrong hash when trying to remove it.
This pr changes AbstractTranslationStore#hashCode to only use the translators name, as that is immutable.
Fixes #1273
Thanks for the PR! This is good for now, but I'm going to make a note to swap this to HexFormat in Adventure 5.0.
[KyoriPowered/adventure] branch deleted: docs/wikivg
00ebf2e chore: Deprecate non-named UTF8ResourceBundleContr... - kezz
Closing this as I can't edit PRs made from an org, will merge manually.
@kezz whoops, sorry for not fixing the test sooner! I was out for lunch and after I fixed the test I've noticed that you have already fixed it yourself
Gonna merge this manually too, thanks!
cab63a2 chore(ci): Replace old Sonatype OSS with my repo f... - zml2008
[KyoriPowered/adventure-platform] branch deleted: renovate/error-prone-monorepo
[KyoriPowered/adventure-platform] branch deleted: renovate/junit-framework-monorepo
[KyoriPowered/adventure-platform] New tag created: v4.4.1
This is a patch release that adds initial support for 1.21.6/1.21.7.
What's Changed
- Bukkit - Update MinecraftComponentSerializer for 1.21.6/7 by @bloodmc in https://github.com/KyoriPowered/adventure-platform/pull/212
New Contributors
- @bloodmc made their first contribution in https://github.com/KyoriPowered/adventure-platform/pull/212
Full Changelog: https://github.com/KyoriPowered/adventure-platform/compare/v4.4.0...v4.4.1
0f77aa9 chore(ci): set things up to publish releases via G... - zml2008
9f0df6b fix(build): reconfigure for new Central publishing - zml2008
e2131d5 chore(deps): Update plugin org.gradle.toolchains.f... - renovate[bot]
266ce8f chore(deps): Update dependency org.junit:junit-bom... - renovate[bot]
4e41273 chore(deps): Update dependency com.google.errorpro... - renovate[bot]
e5d959d Merge pull request #1259 from KyoriPowered/renovat... - zml2008
6ff14bb Merge pull request #1261 from KyoriPowered/renovat... - zml2008
e1e5a66 Merge pull request #1262 from KyoriPowered/renovat... - zml2008...
[KyoriPowered/adventure] branch deleted: renovate/junit-framework-monorepo
[KyoriPowered/adventure] branch deleted: renovate/error-prone-monorepo
[KyoriPowered/adventure] branch deleted: renovate/checkstyle
[KyoriPowered/adventure] New tag created: v4.24.0
What's Changed
✨ Features
- feature(api): Add a method to close an open dialog by @kezz in https://github.com/KyoriPowered/adventure/pull/1246
- Implement #canTranslate in GlobalTranslatorImpl and call #canTranslate of its sources by @ivi-kiwi in https://github.com/KyoriPowered/adventure/pull/1252
- Add a less verbose way of creating titles by @LaserSlime in https://github.com/KyoriPowered/adventure/pull/1272
- feature(api): Property default override SPI and flattener nesting limit property by @kezz in https://github.com/KyoriPowered/adventure/pull/1250
- Uppercase hex colors created by asHexColor to avoid item desyncs in Minecraft by @MrPowerGamerBR in https://github.com/KyoriPowered/adventure/pull/1277
🐛 Fixes
- Add
equalstoVirtualComponentby @Seggan in https://github.com/KyoriPowered/adventure/pull/1247 - fix: component flattener not popping styles in correct order by @diogotcorreia in https://github.com/KyoriPowered/adventure/pull/1255
- fix(api): fix remov...
[KyoriPowered/adventure-docs] branch deleted: renovate/major-gradle-and-github-actions
[KyoriPowered/adventure-webui] branch deleted: renovate/gradle-and-github-actions
[KyoriPowered/adventure-webui] branch deleted: renovate/major-gradle-and-github-actions
since this is modifying characters instead of changing their style I think this is less of a fit for adventure and accessibility is also a concern
b3b472b release: prepare for further development on 6.5.2 - jpenilla
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/adventure
[KyoriPowered/adventure] New branch created: fix/properties-spi
2872aea fix(api): Provide the property directly in the pro... - kezz
483db84 Setup javadoc publishing automation - jpenilla
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/patch-release-dependency-changes
[KyoriPowered/adventure-platform-mod] New tag created: v6.6.0
This version of adventure-platform-mod updates the distributed version of Adventure to 4.24.0.
Full Changelog: https://github.com/KyoriPowered/adventure-platform-mod/compare/v6.5.1...v6.6.0
44dbd34 release: prepare for further development on 6.6.1 - jpenilla
The legacy component serializer currently extracts some invalid urls from an input string, leading to a client disconnect due to the validation performed in net.minecraft.Util.parseAndValidateUntrustedUri(String) (specifically calling new URI() on the input).
An example input where this is happening is: Discord: <https://example.com/>, as this results in an open url action with the url https://example.com/> which is invalid.
To circument this I've made the url regex more strict on the path part (only allowing chars as specified in rfc 3986 section 3.3), and added a validity check by calling new URI() before adding the click event. I'm not sure if the second check is actually required, however, I feel it is better to be safer here than accidentially disconnecting clients by extracting invalid urls.
Please let me know if additional test cases are required, I only added a few to validate the behaviour, maybe a few more would be better.
since this is modifying characters instead of changing text style I think this is less of a fit for adventure
I'm inclined to agree, the more I think about it the more this feels like the perfect use case for a font with a resource pack.
I'm gonna close this PR. Happy for others to pick up where I left off if thats what people want, but just my thoughts :-)
Just came across this issue and thought I'd comment as a reminder in case someone forgot to close it, since #1241 was merged.
thanks for the effort tho!
sorry for not catching the accessibility concern on the original issue before you spend time on this
the narrator doesn't read these unicode characters, so this is a huge accessibility issue which we dont really want to promote further.
if you want stuff to look different, you should use a custom font in a resource pack (something with minimessage already supports and the narrator can handle just fine)
I'm encountering an error when sending an action bar via the Adventure Platform in my plugin:
I'm using the latest Paper 1.21.8, Adventure 4.24.0, and Adventure Platform 4.4.1. Downgrading Adventure Platform to 4.4.0 resolved the issue.
00:14:11 ERROR]: Error sending packet clientbound/minecraft:set_action_bar_text
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:set_action_bar_text'
at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:62) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:13) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:27) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:12) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:1```...
[KyoriPowered/adventure] branch deleted: renovate/major-gradle-and-github-actions
I'm experiencing the same issue, and although downgrading to 4.4.0 fixes the error, no actionbar messages are being sent
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:set_action_bar_text'
at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:62) ~[paper-1.21.7.jar:1.21.7-17-b4466ec]
at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:13) ~[paper-1.21.7.jar:1.21.7-17-b4466ec]
at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:27) ~[paper-1.21.7.jar:1.21.7-17-b4466ec]
at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:12) ~[paper-1.21.7.jar:1.21.7-17-b4466ec]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.118.Final.jar:4.1.118.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(...
Proposal:
This issue proposes the addition of a transform method to the Component interface. This method would allow for functional, chained transformations of components, mirroring a pattern seen in the Java standard library with String#transform.
Motivation
The primary goal is to provide a more idiomatic and functional way to handle component transformations. By introducing a transform method, developers can write cleaner and more concise code, especially when working with modern Java features like the Stream API.
Proposed API
public interface Component {
// ... existing methods
<R> R transform(Function<? super Component, ? extends R> transformer);
}
This method would apply the provided transformer function to the component and return the result. Since Component instances are immutable, this operation would be side-effect-free.
Advantages
- Functional Programming Approach:
transformwould enable a more functional style of programming. This...
Adding the method directly to the Component interface could lead to confusion. A better approach might be to define a generic Transformable interface and have Component extend it. This would help prevent misunderstandings and keep the API design cleaner.
I'm going to go ahead and close this issue. It looks like it's been written entirely with AI and doesn't seem to have a basic understanding of how the library works. If you wish to reopen the issue with actual real world examples of use cases please go ahead.
I'm sorry my last issue wasn't clear enough. You were right that I didn't give a good example. I'm not a native English speaker, so I used AI to help me write it, but the idea was mine. I should have explained it better.
I have a new example from my own library, Doburoku. It shows exactly why I think transform would be useful.
Right now, to transform a Component into a Consumer<Audience>, I have to write it like this:
.add(new TypeToken<Consumer<Audience>>() { }, component -> audience -> audience.sendMessage(component))
This works, but it's a bit complicated to read. With a transform method, it could be written like this:
.add(new TypeToken<Consumer<Audience>>() { }, component -> component.transform(it -> audience -> audience.sendMessage(it)))
I think this second one is much more intuitive and easier for a developer to understand. It just feels more natural and is in line with String#transform.
Do you think we could talk about this again? I really believe this would...
Hmm... On second thought, maybe this isn't a great idea. The use case is pretty niche.
You can leave the issue closed. Thanks for listening!
I have the same problem with 1.21.1 (ClickEvent.Action.RUN_COMMAND), please fix it!
See [Discord](#adventure-help message) discussion.
Makes ComponentBuilder and Style.Builder implement StyleGetter, allowing access to set values before building.
The style builder hols the actual implementation, and the component builder simply redirects StyleGetter methods to its style builder.
For the JD, I used {@inheritDoc} with a changed @since tag to 4.25.0 - this does mean that the JD sometimes refers to itself as e.g. stylable instead of component, but imo I don't think that's a big deal compared to how much cleaner the JD is (also see Discord discussion).
I put all of the getters right above their setters as that seemed to be the convention, but let me know if you'd prefer having them all in one place for less adventure 5.0 merge conflicts.
<img width="1519" height="264" alt="image" src="https://github.com/user-attachments/assets/784b4df9-7a80-4862-9cae-5fbfa60ef375" />
https://github.com/IdreesInc/Monocraft
replace the current font to Monocraft to allow more languages support when using the preview
I don't think a monospaced font would work for a preview, as Minecraft's font itself isn't monospaced. Would defeat the purpose of an accurate preview
Our existing font isn't 100% accurate to the game, but Monocraft doesn't even try to be, it's just a monospaced blocky font.
Describe the bug
When using Arclight 1.21.1 (https://github.com/IzzelAliz/Arclight), if a mod uses the Adventure Text API (common), it causes all chat output from plugins that also use Adventure (like HuskHomes) to not display anything in the chat, even though the plugin functions correctly in the background.
However, when I remove the mods that use the Adventure Text API, the plugin messages reappear in the chat as expected.
To Reproduce
Steps to reproduce the issue:
Run an Arclight 1.21.1 server.
Install a plugin that uses adventure-platform-bukkit (e.g., HuskHomes 4.4.0).
Install a mod that also uses the Adventure Text API.
Execute any plugin command (e.g., /home from HuskHomes).
Observe that no message is displayed in chat, even though the command works.
Expected behavior
Plugin messages using the Adventure API should be visible in chat, regardless of whether a mod using Adventure is present.
Video demonstration
https://drive.google.com/file/d/1xCCvoMjwlsV1USTTPh9MyRNtp_dfO_...
Outdated Adventure, outdated adventure-platform and a Bukkit+Mods server environment means that something is bound to break. Unfortunately nothing to do with us, you'll have to raise it with Arclight.
The minimessage string below does not properly deserialize the show_item hover. Infact it does not do it at all.
<click:suggest_command:'/msg Preva1l'><hover:show_text:'<white>this is a hover... <red>hello!'><bold><green>LIME TART</green></bold> Preva1l <dark_gray>» </dark_gray><italic><white><hover:show_item:grass_block:61:custom_name:"'{\"extra\":[{\"bold\":false,\"color\":\"yellow\",\"italic\":false,\"obfuscated\":false,\"strikethrough\":false,\"text\":\"item\",\"underlined\":false}],\"text\":\"\"}'"><!italic><!underlined><!strikethrough><!bold><!obfuscated><yellow>item
As to why, I couldn't tell you.
I'm experiencing the same issue, and although downgrading to 4.4.0 fixes the error, no actionbar messages are being sent
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:set_action_bar_text' at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:62) ~[paper-1.21.7.jar:1.21.7-17-b4466ec] at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:13) ~[paper-1.21.7.jar:1.21.7-17-b4466ec] at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:27) ~[paper-1.21.7.jar:1.21.7-17-b4466ec] at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:12) ~[paper-1.21.7.jar:1.21.7-17-b4466ec] at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.118.Final.jar:4.1.118.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[netty-transport-4.```...
Currently adventure does not declare a module-info and relies on the Automatic-Module-Name, this is bad for people wanting to add adventure as a transitive dependency in their modules as javac will warn about this behavior and provides other problems. As without module info's you are required to requires every path used, instead of its known as a transitive dependency as an API through the base adventure package.
Currently required:
module example {
requires net.kyori.adventure;
requires net.kyori.adventure.nbt;
requires net.kyori.adventure.key;
requires net.kyori.examination.api;
requires net.kyori.adventure.text.logger.slf4j;
requires net.kyori.adventure.text.serializer.legacy;
requires net.kyori.adventure.text.serializer.gson;
requires net.kyori.adventure.text.serializer.plain;
requires net.kyori.adventure.text.serializer.json;
requires net.kyori.adventure.text.serializer.ansi;
}
Expected:
module example {
requires net.kyori.adven```...
Your expected is incorrect, serializers are not transitive deps of adventure-api.
Your right, I've gone ahead and removed them.
boolean contains(final @NotNull String key);
Prefer CompoundBinaryTag.builder(existingTag)
Component#compact optimizes the styles of a component tree by assuming this component is the root of the tree. This is fine in most situation, but sometimes, we know the context where the component will be used, and thus the styles could be optimized even further. By providing the initial parentStyle to the ComponentCompaction.compact method, it allows us to provide the additional context required to benefit more from this optimization.
The main use-case is for components that will be used in item lore, were we know the parent style is Style.style(NamedTextColor.DARK_PURPLE, TextDecoration.ITALIC).
An alternative way to do this without this method would be to do:
Component compacted = Component.empty().style(parentStyle).append(component).compact();
// But I just feel like this is way cleaner:
Component compacted = component.compact(parentStyle);
They would both lead to same result thanks to the optimization of compaction when the parent is just empty with only one ch...
[KyoriPowered/adventure-webui] branch deleted: renovate/gradle-and-github-actions
[KyoriPowered/adventure-webui] branch deleted: renovate/patch-release-dependency-changes
Related PaperMC/Velocity#1630; [discord discussion](#adventure-contrib message)
Since 1.21.5 URIs without a http:// or https:// in a open_url click event are no longer silently ignored but fail parsing and disconnect. Developers still seem to expect these to be valid, because paper mitigates this in their codec.
This pr adds a JSONOption to be able to match papers behavior during (de)-serialization. Also documents this change on ClickEvent#openUrl(String) to inform developers that they should be sending valid URIs.
Tested with:
final GsonComponentSerializer serializer = GsonComponentSerializer.builder()
.editOptions(options -> options.value(JSONOptions.EMIT_CLICK_URL_HTTPS, true))
.build();
System.out.println(serializer.serialize(Component.text()
.content("click me")
.clickEvent(ClickEvent.openUrl("kyori.net"))
.build()
));
System.out.println(serializer.deserialize(
"{\"click_event\":{\"action\":\"open_url\",\"url\":\"kyori.net\"},\"text\":\"click me\"}"
));
output:
json...
[KyoriPowered/adventure] New branch created: unstable/4
60556b7 Setup unstable publishing to PaperMC snapshots rep... - jpenilla
ff3b13f Refactor ObjectComponent to have a Contents - jpenilla
Published to the Paper repo under a special GAV for platform devs to test.
This should be checking a prefix of http(s):// and should also be extracted into a constant.
final @Subst("empty") String firstArg = args.popOr("An atlas id and or a sprite id is required to produce a sprite object component").value();
When rebasing switch this to check == SpriteContents.DEFAULT_ATLAS
Adds serialization support for the new ObjectComponent in:
- api - ComponentFlattener
- serializer-configurate4
- text-serializer-gson
[KyoriPowered/adventure-platform-mod] New branch created: dev/1.21.9
825e3e1 fix :fabric:runTestmodClient - jpenilla
lgtm other than these 3 nits
still missing the license header here
public static @NotNull TagResolver sprite() {
this should probably match the other tag method names
I think this can be cleaned up into something like
return emit -> {
emit.tag(SPRITE);
if (atlas != default) {
emit.argument(atlas)
}
emit.argument(sprite)
}
[KyoriPowered/adventure] New branch created: player-head-contents-exp-1
511f853 Add PlayerHeadContents - jpenilla
cfccd17 dont clear props on properties(map) - jpenilla
this is an idea of what the API could look like with the player head contents flattened (no new profile type added)
614ad73 allow using SkinSource with builder - jpenilla
fd8a901 Add more property helpers & a test - jpenilla
43231d3 Assert PlayerHeadObjectContents is non-empty - jpenilla
380fe42 Rename objectContents field back to contents - jpenilla
1ebf401 Allow empty steve contents - jpenilla
Prefer
CompoundBinaryTag.builder(existingTag)
Switched to that style, with a new CompoundBinaryTag#asMap method (returns an unmodifiable view of the tag's contents as a map) for a cleaner implementation without casting to the impl type or other approaches - that method is nice to have either way imo, for more convenient usage with any general map utility methods.
42188eb De-emphasize hat param, default to true - jpenilla
511f853 Add PlayerHeadContents - jpenilla
cfccd17 dont clear props on properties(map) - jpenilla
614ad73 allow using SkinSource with builder - jpenilla
fd8a901 Add more property helpers & a test - jpenilla
1c8aabe Add import layout to editorconfig - jpenilla
55924a6 Move ObjectComponent inner classes to top level - jpenilla
e8f91a5 clear existing profile when setting from skin sour... - jpenilla
a9ee9a2 make it build (add javadocs and etc.) - jpenilla
43231d3 Assert PlayerHeadObjectContents is non-empty - jpenilla...
[KyoriPowered/adventure] branch deleted: player-head-contents-exp-1
Updated for 25w35a.
I'll keep this as draft for now, probably until there's a pre release or release candidate even. I don't think it makes much sense to review it before that when mojang could be introducing changes again with the next snapshot
If anyone wants to leave feedback anyway, feel free!
This PR adds backward-compatible support for retrieving legacy player's locale.
fun, the tag is called InsertionTag but insert indeed is right, thanks!
https://github.com/KyoriPowered/adventure/blob/main/4/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/standard/InsertionTag.java#L42
It would be nice to be able to optionally use a more powerful argument processor that accepted arguments in the form <tag_name arg_name='arg value' boolean_presence_arg>.
[KyoriPowered/adventure] New branch created: fix/check-preparsed-name
c0201ac chore: Check TagResolver#has in more places - kezz
Additions
TranslatableComponent$Builder#addArgument- adds a single translation argument, as opposed to the current methods which only allow setting the entire list.TranslatableComponentImpl#asArgument- converts a singleComponentLikeinto aTranslationArgument, with an optionalintindex for extra error info (ignored when-1, from e.g. the newaddArgument^).
Changes
TranslatableComponentImpl$BuilderImpl.args- now defaults to null, with:TranslatableComponentImpl$BuilderImpl#args- acting as a getter that defaults it to a newArrayListif unset and returns its value (similarly to other builders around the API).TranslatableComponentImpl$BuilderImpl#arguments- now initializesargsto a newArrayListof the correct size and adds each argument manually using the newTranslatableComponentImpl#asArgument, so that the list is mutable (unlike the one returned byasArguments) .TranslatableComponentImpl$BuilderImpl#build- now defaultsargstoCollections.em...
To be exact, like this:
return emitter -> {
emitter.tag(SPRITE);
if (atlas != ObjectComponent.SpriteContents.DEFAULT_ATLAS) {
emitter.argument(atlas.asString());
}
emitter.argument(key.asString());
};
I'm unsure as to why this was done, but can be seen here:
https://github.com/KyoriPowered/adventure/blob/main/4/api/src/main/java/net/kyori/adventure/text/renderer/TranslatableComponentRenderer.java#L202
if (arg.value() instanceof Component && !(arg.value() instanceof VirtualComponent)) {
The second part of that if, means that virtual components get completely ignored when rendering translatable, making them unusable other than for their fallback.
I'll these are some examples of what you'd expect code to result to:
Works and has correct behavior:
// Renders as "Hello Username" just fine
virtual(Player.class, p -> text("Hello " + p.getName()));
Does not work, has incorrect behavior:
// Assume some.key=Greeting: {}
// Renders as "Greeting: " (no fallback defined), should be "Greeting: Hello Username"
translatable(some.key, virtual(Player.class, p -> text("Hello " + p.getName())));
// Renders as "Greeting: fallback" (a fallback is defined), should be "Greeting: Hello Username"
v```...
The if is there because there is currently no logic for rendering virtual components. Attempting to render the virtual component there would collapse it to an empty component.
Rendering a virtual component runs it thru the renderer, if is responsability of the plugin to define a renderer that can handle them. It is inconsistent that just because you wrap it in a translatable it no longer has any way of functioning
The virtual components I mentioned for MiniMessage translators are not provided by plugins. They are how you specify named arguments, tag resolvers and a target when using MiniMessage translations:
Named arguments - https://github.com/KyoriPowered/adventure/blob/main/4/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/translation/Argument.java#L146-L167
Tag resolvers - https://github.com/KyoriPowered/adventure/blob/main/4/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/translation/Argument.java#L180-L190
Target - https://github.com/KyoriPowered/adventure/blob/main/4/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/translation/Argument.java#L192-L201
Collapsing them to the fallback string would break their functionality.
Everything i'm talking about here is independent of minimessage; it seems like the API was made to fit one use-case (minimesage) in detriment of anyone else being able to use virtual components for anything useful
Currently, if you use the <lang> and <lang_or> tags with a custom MiniMessageTranslator with a TagResolver that obtains information from the parsing context, you cannot access the target initially provided when parsing the <lang> tag. This pull request provides support for this.
In addition, a test has been added that provides an example of a real use case for this feature.
Tested with Paper 1.21.7. There is an issue with click, lang, hover, etc. not working in plugins that use adventure-platform.
Yes, it's true, I've been having the same problem for weeks.
https://github.com/PaperMC/Velocity/issues/1633#issuecomment-3288045450
This doesn't seem like an issue in adventure, but rather with whatever is sending null as a component
[18:55:57 WARN]: at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
[18:55:57 WARN]: at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[18:55:57 WARN]: at MailMe.jar//net.mailme.libs.mf.base.CommandHandler.executeCommand(CommandHandler.java:217)
[18:55:57 WARN]: at MailMe.jar//net.mailme.libs.mf.base.CommandHandler.execute(CommandHandler.java:167)
[18:55:57 WARN]: at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83)
[18:55:57 WARN]: at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73)
[18:55:57 WARN]: at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30)
[18:55:57 WARN]: at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13)
[18:55:57 WARN]: at n```...
[18:55:57 WARN]: at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
[18:55:57 WARN]: at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[18:55:57 WARN]: at MailMe.jar//net.mailme.libs.mf.base.CommandHandler.executeCommand(CommandHandler.java:217)
[18:55:57 WARN]: at MailMe.jar//net.mailme.libs.mf.base.CommandHandler.execute(CommandHandler.java:167)
[18:55:57 WARN]: at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83)
[18:55:57 WARN]: at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73)
[18:55:57 WARN]: at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30)
[18:55:57 WARN]: at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13)
[18:55:57 WARN]: at n```...
[00:10:59 WARN]: at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
[00:10:59 WARN]: at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[00:10:59 WARN]: at MailMe.jar//net.mailme.libs.mf.base.CommandHandler.executeCommand(CommandHandler.java:217)
[00:10:59 WARN]: at MailMe.jar//net.mailme.libs.mf.base.CommandHandler.execute(CommandHandler.java:167)
[00:10:59 WARN]: at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83)
[00:10:59 WARN]: at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73)
[00:10:59 WARN]: at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30)
[00:10:59 WARN]: at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13)
[00:10:59 WARN]: at n```...
Please stop opening the same issue multiple times. I've already transferred your issue to the adventure-platform repo.
Please stop opening the same issue multiple times. I've already transferred your issue to the adventure-platform repo.
link please?
ViaFacet currently targets ViaVersion 4.3.0, which is outdated.
Currently running the plugin on a server with ViaVersion 5.4.2 gives this debug log:
Skipped facet: net.kyori.adventure.platform.viaversion.ViaFacet$Chat@3d158e1
Modern clients receive downsampled colors instead of modern ones.
By supporting ViaVersion 5 colored messages should reappear correctly.
4b0b339 Clean texture when setting from a SkinSource - jpenilla
Closes KyoriPowered/adventure#4478
Adds support to ViaVersion 5, specifically targeting the lastest release (5.4.2).
Tested with ViaVersion 5.4.2 on a paper 1.8.8 server, modern colors are now properly shown to modern clients.
<img width="393" height="84" alt="image" src="https://github.com/user-attachments/assets/efbd21a4-1d1c-4a86-a9cb-e98c22f52fcc" />
Seems like there is also another PR updating VV usage, https://github.com/KyoriPowered/adventure-platform/pull/170
Yep, if kennytv wants to merge my changes on their PR that's fine by me 👍
That PR is based on an older version and I guess was a work in progress since it searches for some classes (like ClientboundPackets1_10) that do not exist in ViaVersion 5.x
Can you consider adding value + signature pair support for heads?
Can you consider adding value + signature pair support for heads?
I did consider it, but I decided against it for now considering the logic for that would genuinely turn unmaintainable. I am probably going to be splitting this PR into two, one for the sprite tag, one for the head tag, and I might wait for named arguments before I implement the head tag (as named arguments would make the logic much cleaner).
closes #1296.
[!NOTE]
This PR is a draft PR. Until it gets undrafted, all changes should be treated as temporary/not-final. I am opening this PR only as a reference on my current progress.
This PR was split off from #1292 because I think it makes more sense to wait with the implementation of the head tag until named arguments are implemented due to the complexity of this tag.
This PR depends on #1292 (and also includes its changes, so don't wonder about the diff size).
I've split the head tag away now. The "full" PR can be found under #1305. This should be mergable standalone.
4b1827f feat(minimessage): add sprite tag - Strokkur424
6c3b642 feat(minimessage): add atlas argument to sprite ta... - Strokkur424
4fe2652 chore: apply suggestions - Strokkur424
c00715d chore: spotless apply - Strokkur424
8dfb187 chore: fix rebase compile time errors - Strokkur424
6db5673 fix: gradlew build compile time errors - Strokkur424
ae092f4 Merge pull request #1292 from Strokkur424/feat/spr... - jpenilla...
There was an issue which I believe was present
There was an issue which I believe was present before the update.
Chat components were serialized using the "latest" serializer available in Adventure, this however caused components to have incorrect fields since they would go through the ViaVersion pipeline from Minecraft 1.16 (which of course would then rewrite the components as if they were from that version, even though the serializer wrote them as if they were in latest).
Now components should work correctly in every version, I personally tested:
- Paper 1.8.8 server, ViaVersion 5.4.2 with 1.8.9 client (colors are downsampled, hovers and clicks work)
- Paper 1.8.8 server, ViaVersion 5.4.2 with 1.21.8 client (modern colors, hovers and clicks work whereas they didn't before the fix in the commit)
depends on #1304.
This is a practical use case of the named arguments.
The <style> tag allows users to declare multiple styles with the same tag. Supported are the text decorations, text color, and shadow color styles.
Example use:
<style color=#f00 b i u>Fancy</style>
This string resolves to a bold, italic, underlined, and red Fancy.
This fixes issues where plugins that relocate gson didn't work anymore because the previous changes in 7b025cdb were not taking into account that some plugins might relocate gson.
On https://github.com/KyoriPowered/adventure/pull/1253 the Adventure/5.0.0 use Java 21.
So, when building, the workflows use Java 17 currently so this PR aims to fix that so you can see the real errors to fix to have a functionnal build.
And when everything will be fixed, the CI will be able to work correctly.
I did tests on my GitHub before sending this PR, I just send unnecessary commits so I re-created this fork when everything was good for me.
Thanks for the PR but I'm going to close this as Adventure 5.x is still WIP at this point - it doesn't compile anyway at this time.
I've rebased the PR to the unstable/4 branch so that I can do some work for the upcoming head tag with the changes introduced here already.
should be annotated with non-extendible?
reminder to revert these changes
can ignore actions not running and merge without checks, builds fine locally
why the new defensive copy here?
Would this change not break existing calls with translatables by inserting the "fake" target argument at the start?
You mean the manual ArrayList? Because it needed to be a mutable list for the builder, so it couldn't use the existing asArguments (and I didn't want to change that method around because it's used in other places)
Needs to have a default null impl otherwise this is a breaking change
just so it's more in keeping with other areas of the code (e.g. ClickCallback.DEFAULT_LIFETIME)
boolean DEFAULT_HAT = true;
haven't reviewed the configurate changes but json and flattener changes lgtm!
Marked as draft because the named arguments branch has diverged with the unstable/4 branch and instead points to main/4. This PR requires the changes from both unstable/4 and from named arguments. Once unstable/4 is properly merged into main, this PR will be rebased and marked as mergable again.
Would this change not break existing calls with translatables by inserting the "fake" target argument at the start?
I don't see how it could affect anything. This pull request only modifies the <lang> and <lang_or> tags, where the only arguments it can receive are text. This pull request only inserts a target argument if it is present, and inserts it at the end of the arguments, so it should not change the order or behavior of any previously inserted arguments
* This method creates a special resolver which listens to tags with named arguments instead of sequenced ones.
there looks to be a couple other spots with the same issue
Hopefully, this branch will be merged by the end of the year :D
4598503 Init ObjectComponent - jpenilla
ae3d6ef Fix atlas nullability - jpenilla
50b1ae9 override examinableProperties - jpenilla
e687b38 Add tests - jpenilla
a64c854 Refactor ObjectComponent to have a Contents - jpenilla
b2117f1 make SpriteContents#atlas non-null - jpenilla
42539c1 jd fix - jpenilla
8aef6e5 Add net.kyori capabilities when group is something... - jpenilla
c687a2e Add PlayerHeadContents - jpenilla
f596ce7 dont clear props on properties(map) - jpenilla...
[KyoriPowered/adventure] branch deleted: unstable/4
Rebased to main/4 after the unstable/4 merge
closes #1101.
[!Caution]
This PR is not at all feature-complete. As long as this warning stays up, everything is still subject to change. I simply opened this PR as a reference for myself and others on the progress of the PR.
This isn't really a MiniMessage issue but an issue with LegacyComponentSerializer.
If you try to run this test it fails because the serializer "skips" empty strings:
@Test
void testToLegacyJustColor() {
final TextComponent c0 = Component.text("", TextColor.color(0xffefd5));
assertEquals("§#ffefd5", LegacyComponentSerializer.builder().hexColors().build().serialize(c0));
}
This causes issues with Component(s) used as a prefix (which I know is not the ideal case, but it could be supported by fixing this).
Fixes KyoriPowered/adventure#1085 (Not 100% sure the issue is related, I can open a separate one if needed ^^)
LegacyComponentSerializer does not serialize colors added to components with an empty text, which causes issues when using components as prefixes.
While this is not really an intended use case, it's unintuitive, causing for example the second of these tests to fail:
@Test
void testJustColor() { // Passes (Existing test case)
assertEquals(Component.text("", TextColor.color(0xabcdef)), LegacyComponentSerializer.legacyAmpersand().deserialize("&#abcdef"));
}
@Test
void testJustColorInverse() { // Fails (Basically the inverse of the first test, does not currently exist)
assertEquals("&#abcdef", LegacyComponentSerializer.legacyAmpersand().serialize(Component.text("", TextColor.color(0xabcdef))));
// Actual result: "" (an empty string)
}
The change in the PR does not change any other behaviour.
I added a specific test (testToLegacy...
I understand that this particular use case may not be a goal, but the legacy serializer is really the only one that has this behavior.
I think this really is a bug when you consider that what the legacy serializer is doing is not "preventing" using it to represent prefixes, because you can absolutely do that as long as there is something after the color, but simply refusing to serialize color codes followed by an empty string (which is okay-ish when those colors would not change anything, like for "&a&eSomething" being changed to "&eSomething" -- even though this is also kind of unexpected and something that I would personally not see a serializer doing, this should probably be a job for a compacter/optimizer).
See the following tests:
Minimessage Serializer - Both tests pass
@Test
void testColorNonEmpty() {
final String expected = "<green>Test";
final Component component = text("Test").color(NamedTextColor.GREEN);
this.assertSerializedEquals(expe```...
After some discussion in the #adventure-help channel in the PaperMC Discord server about serializing MiniMessage strings to HTML for easy rendering in web based software, we came to the conclusion, that an HTML serializer for Adventure in general could be a great addition to the API.
This would allow web applications to render previews of MiniMessage messages, or even Components in general, without relying on wrapping the webui or implementing a custom serializer, that would need to be kept up to date with the Adventure api.
A few use cases could be:
- A localization software with a preview of how the messages would look like in game
- A live chat or colored log on a server website or admin interface, that forwards all server messages
If you provide an argument like \"foo\", it will throw a syntax exception causing the tag to not be parsed.
Example of this would be
<hover:show_text:\'test\'>Hello!
Problem seems to be in TokenParser#tokenize
Okay so this happens because TokenParser#parseString doesn't escape anything in TAG state, therefore it enters STRING state where you are able to escape the same quotation symbol used to start it, resulting in the parse consuming the rest of the input (at least until reaching the same quote smybol) in STRING state.
[KyoriPowered/adventure] branch deleted: fix/properties-spi
ec627a1 Fix defaultValue nullability - tal5
913225d fix invalid url extraction in legacy component ser... - derklaro
be30b8c checkstyle, improve regex readability, support per... - derklaro
c0201ac chore: Check TagResolver#has in more places - kezz
f33182b Merge pull request #1263 from tal5/fix/default_valu_... - kezz
577e740 Merge pull request #1280 from derklaro/legacy-comp... - kezz
6eb526f Merge pull request #1297 from KyoriPowered/fix/che... - kezz...
[KyoriPowered/adventure] branch deleted: fix/check-preparsed-name
[KyoriPowered/adventure] branch deleted: renovate/patch-release-dependency-changes
[KyoriPowered/adventure] branch deleted: renovate/com.diffplug.gradle-goomph-4.x
[KyoriPowered/adventure] branch deleted: renovate/error-prone-monorepo
[KyoriPowered/adventure] branch deleted: renovate/junit-framework-monorepo
This PR separates out the simplified/sequential form of the head tag from #1305.
So it seems I found the underlying issue:
Since the first quote is not escaped an is treated just as a string start it looks forward if it's ever closed. Which according to String#indexOf it is, BUT it does not check if that particular char is also escaped. The code that does this in question:
I personally can not think of a solution to this right now due to edge cases like "test\\" and "test\".
Closes #1315
This PR addresses the TokenParser#parseString's problem when faced with an input like <hover:show_text:"Foo\">Bar. The parsed result would be literal text as the parser never returns to NORMAL first pass due to it being mislead by the escaped quote.
While this solution is not the prettiest and adds more complexity it doesn't touch escape logic. Alternatively (which I think would be better) is to drop escape logic in first pass for strings entirely, because IIRC it doesn't really do much.
This change adds the method ClickEvent#clickEvent(Action, Payload) which allows creation of new ClickEvent objects from arbitrary Actions and Payloads. This is useful for custom string -> Component parsers like Minimessage or Minedown which in the past used the now deprecated ClickEvent#clickEvent(Action, String) method to easily create new click events from user-supplied action strings.
What use case do you have for this that isn't solved by switching on the action?
Switching on the action means that you have to implement each action type individually causing (imo unnecessary) duplicate code and additionally the need to manually add new action types, while having the dynamic "constructor" exposed would allow "switching" on the payload types so remove a lot of codeto get the now deprecated functionality working again.
Where would the duplicate code be? You can chain switch statements. Also I'm not sure how encouraging error prone code is better than a simple switch.
Switching would require code like this which is imo. not clean design and also fails to automatically support newly added actions with existing payload types:
public static ClickEvent clickEvent(ClickEvent.Action action, ClickEvent.Payload payload) {
return switch (action) {
case CUSTOM -> ClickEvent.custom(((ClickEvent.Payload.Custom) payload).key(), ((ClickEvent.Payload.Custom) payload).nbt());
case OPEN_URL -> ClickEvent.openUrl(((ClickEvent.Payload.Text) payload).value());
case OPEN_FILE -> ClickEvent.openFile(((ClickEvent.Payload.Text) payload).value());
case RUN_COMMAND -> ClickEvent.runCommand(((ClickEvent.Payload.Text) payload).value());
case SUGGEST_COMMAND -> ClickEvent.suggestCommand(((ClickEvent.Payload.Text) payload).value());
case COPY_TO_CLIPBOARD -> ClickEvent.copyToClipboard(((ClickEvent.Payload.Text) payload).value());
case CHANGE_PAGE -> ClickEvent.changePag```...
I guess one way to improve this approach could be to use generics similarly to how the HoverEvent does it which could provide at least some additional compile time validation.
I don't think I particularly like this solution. Imagine you have a very long MiniMessage string with a lot of escaped and not escaped quotes. From what I see here, this would result in a lot of double-iterating, which is very bad for time complexity.
For the problem which you've shown here <hover:show_text:"Foo\">Bar, I believe a better solution would be to just continue parsing to the end, and if it ends up in string state never being closed, it should throw a parsing exception, seeing as whoever wrote that String probably forgot a " at the end, which we should make them aware of.
What your original issue was trying to show with <tag:\"foo\"> is that the first string is not escaped, which is the bigger issue here. I think you should modify your solution so that it properly escapes the first ", as that should fix it just fine.
For the problem which you've shown here hover:show_text:"Foo\"Bar, I believe a better solution would be to just continue parsing to the end, and if it ends up in string state never being closed, it should throw a parsing exception, seeing as whoever wrote that String probably forgot a " at the end, which we should make them aware of.
I don't believe this is a good solution as <hover:show_text:"Foo>Bar is a valid mm string (since it never enters string state).
Yeah I see what you mean and actually looking through even the adventure codebase there's actually a fair few places this pattern would repeat. You're right that generics would be best, but unfortunately we're stuck with an enum for now. :sweat_smile:
Thanks for the PR! Just made a few minor style adjustments, but all good to go.
Thanks for the PR! Just a few more minor style changes but otherwise LGTM.
Can you explain the use-case for this? I'm not sure if it makes sense as a method given whether a character is allowed depends on where in the key it is used.
292bd59 Add CompoundBinaryTag contains methods - tal5
187a1a2 Bump @since - tal5
605e133 containsKey -> contains - tal5
64dc85b feat: add sequential (simple) head tag - Strokkur424
b160f8e fix javadoc tag - kezz
9efa169 jd style changes and check for non-null entries - kezz
9aa2b5d Merge pull request #1320 from Strokkur424/feat/seq... - kezz
c72c42b Merge pull request #1265 from tal5/feature/compoun... - kezz...
2ce85c7 chore: Add a note about the archival of this repos... - kezz
Closing as no longer required
Closing in favor of platform-specific docs
Closing as none of these are particularly good ideas
Closing as really obscure
Closing as this is fixed in the migration
Closing as these docs are now archived!
Closing as these docs are now archived!
[KyoriPowered/adventure] New tag created: v4.25.0
What's Changed
✨ Features
- Update for 1.21.9 by @jpenilla in https://github.com/KyoriPowered/adventure/pull/1291
- Add option to prepend https to click event urls by @Emilxyz in https://github.com/KyoriPowered/adventure/pull/1290
- Allow passing parentStyle to Component#compact by @indyteo in https://github.com/KyoriPowered/adventure/pull/1288
- Allow creation of a ClickEvent from an Action and Payload by @Phoenix616 in https://github.com/KyoriPowered/adventure/pull/1322
- Add
CompoundBinaryTagcontains methods by @tal5 in https://github.com/KyoriPowered/adventure/pull/1265 - Add sequential (simple) head tag by @Strokkur424 in https://github.com/KyoriPowered/adventure/pull/1320
- Allow creating builders with an initial capacity by @tal5 in https://github.com/KyoriPowered/adventure/pull/1264
- ObjectComponent serialization by @Emilxyz in https://github.com/KyoriPowered/adventure/pull/1293
🐛 Fixes
- Provide the property directly in the properties DefaultOveridePro...
01410a4 docs: Update documentation, discord and snapshot l... - kezz
[KyoriPowered/adventure] New branch created: docs/misc-updates
[KyoriPowered/adventure] New comment on issue: #1313 ClickEvent.custom crashes MiniMessage.serialize
Custom click events are not yet supported in MiniMessage.
[KyoriPowered/adventure] branch deleted: docs/misc-updates
3a7c1e6 update for 1.21.9 release - jpenilla
bedbfb7 1.21.9 dev - jpenilla
825e3e1 fix :fabric:runTestmodClient - jpenilla
19a1497 1.21.9-pre1 - jpenilla
f93b4b9 Update adventure - jpenilla
88b048a update for 1.21.9 release - jpenilla
17647e3 missed one - jpenilla
3e13228 Update mod metadata - jpenilla
d406c64 Merge pull request #216 from KyoriPowered/dev/1.21... - jpenilla...
[KyoriPowered/adventure-platform-mod] branch deleted: dev/1.21.9
[KyoriPowered/adventure-platform-mod] New branch created: mc/1.21.8
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/me.lucko-fabric-permissions-api-0.x
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/neoforge
[KyoriPowered/adventure-platform-mod] New tag created: v6.7.0
This version of adventure-platform-mod adds support for Minecraft 1.21.9, distributing Adventure 4.25.0 for the Fabric and NeoForge platforms. Minecraft versions older than 1.21.9 are not supported by this release.
Full Changelog: https://github.com/KyoriPowered/adventure-platform-mod/compare/v6.6.0...v6.7.0
[KyoriPowered/adventure] New comment on issue: #1313 ClickEvent.custom crashes MiniMessage.serialize
@kezz
Thanks for the clarification.
My use case is/was in a StringReader for a custom argument type, but I guess you are right, maybe parsing the key would be smarter
<img width="1022" height="959" alt="image" src="https://github.com/user-attachments/assets/1186110e-2b6e-4535-8e5d-6b74fd325d63" />
Modernized and removed deprecated stuff from the following modules:
- configurate-4
- nbt
- minimessage
- ansi
- serializer-gson
- serializer-gson-legacy-impl (completely removed)
- serializer-json(-legacy)
- serializer-legacy
- serializer-plain
(( directly related to #1253 ))
[KyoriPowered/adventure] New comment on issue: #1313 ClickEvent.custom crashes MiniMessage.serialize
@kezz so it's not planned at all or not planned yet?
[KyoriPowered/adventure] New comment on issue: #1313 ClickEvent.custom crashes MiniMessage.serialize
It's incredibly low priority considering the fact that MiniMessage is primarily supposed to be a format for easily writing chat components. I doubt there are many people who sit down and think "I need to have NBT payload in my click events". (It does have a use case, yes, but for most simple stuff, people would just make their own little wrapper tag resolver and only ever deserialize from MiniMessage).
I don't think anybody here is directly opposed to having SNBT payload custom click events in the click tag, but somebody would just have to come around to doing it. Feel free to open up a PR, but I almost feel like this is best done after named arguments are merged so that the syntax doesn't get all confused.
(( directly related to #1253 ))
This PR adds a module-info.java file to each module and replaces all nullability annotations with jspecify's annotations.
Depends on #1324
Supersedes #984
Going to go ahead and close this as completed as this is a pretty stale issue and I haven't seen further complaints in a while. There's still issues to improve the docs themselves, which are likely a better place for further documentation.
<img width="550" height="199" alt="Image" src="https://github.com/user-attachments/assets/31813985-b5f5-4863-aa2f-1f9ffe5a6289" />
Why is this requireNonNull?
Cherry picking this manually.
d316898 chore(api): Further refactor (including text packa... - kezz
c5cf917 chore(nbt): modernize and remove deprecated method... - Strokkur424
06c9aab chore(configurate-4): cleanup code - Strokkur424
77945eb chore(minimessage): modernize some code - Strokkur424
6db88bb chore(ansi): replace one switch expression - Strokkur424
1180f89 chore(serializer-gson): modernize gson serializer... - Strokkur424
94f0baa chore(serializer-json): cleanup and modernize json... - Strokkur424
c6a1760 chore(serializer-legacy): cleanup and modernize co... - Strokkur424
595494c chore(serializer-plain): remove deprecated classes - Strokkur424...
75e444a chore(key): Remove examination and fix module expo... - kezz
15fa91d chore(nbt): Remove examination, fix module exports... - kezz
20fc806 chore(api): Remove examination, fix module exports... - kezz
92ed914 chore(api): Fix checkstyle, build and further misc... - kezz
2b13d04 chore(nbt): Fix checkstyle, build and further misc... - kezz
b9be3f3 chore(misc): Continue work on checkstyle, build, a... - kezz
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/major-junit-framework-monorepo
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/gradle.plugin.org.jetbrains.gradle.plugin.idea-ext-gradle-idea-ext-1.x
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/junit-framework-monorepo
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/patch-release-dependency-changes
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/major-checkstyle
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/major-gradle-and-github-actions
[KyoriPowered/adventure-platform-mod] branch deleted: renovate/checkstyle
while I dont have time to look at this in detail rn, its a ton of code, we should have unit tests for it to verify that it works as expected.
this looks like great work tho!
Needed before next release
PAPERMC_MODRINTH_TOKEN
So a thought on this, why are we creating two different colours of MM tags? I feel like the design would be cleaner if we only had one type of tag, which accepted both named and sequential arguments, same as say with a CLI. For consistency's sake I think it's fair to require all the named args to be at the beginning or end of the tag, but either way there's a bunch of api noise and opportunity for breakages here due to adding named args in as a separate parallel concept.
I'm seeing something like:
<gradient phase=0.4 speed=2 red:green:blue>hi strokkur</gradient>
or:
<gradient:red:green:blue phase=0.4 speed=2>hi strokkur</gradient>
What do you think? Users would just pop named args from the ArgumentQueue same as other items
I think it was pretty intentional that we didn't expose raw type id's -- those are considered an implementation detail, sorry.
This is pretty hard to review when you've smashing in commits from another PR, please base it off one of the mainline branches (main/4 or main/5) instead.
Feels like there's quite a bit of duplication of parser logic in here as well, try to avoid that.
Is there a way to distinguish between "format" suggestions (so hints, that shouldn't be added to the cmdline literally such as "#RRGGBB") and value suggestions (such as, <c:r suggesting red), where you might want to actually tab-complete those into the command line.
Can confirm this fixes the issue for me of Adventure platform bukkit no longer sending messages. I would suggest keeping in a fallback / original code for people that do not shade in gson themselves though, to avoid a string copy.
Thanks for making fix, I can at least use this patch as-is.
Hey thanks for the response. yeah its probably not worth spending much time looking at this then. I will wait for main/5 to start successfully building and base it off that.
On the differentiation between hints and concrete suggestions: there is not. While bashing this together I mainly had Brigadier commands on my mind and I don't think those have any dynamic way of showing 'format' suggestions. I will add this (and the tests!) to the todo list for when I get to rebase this PR.
[KyoriPowered/adventure-platform-mod] New branch created: feat/modrinth-readme
5e4aa19 Add Modrinth backlink to README - jpenilla
It's not unlikely that people will end up here searching for i,.e. adventure-platform-fabric after getting an error from their mod loader.
hm, wonder if MR has badges we can add to the badge row above as well?
I don't see anything official and shields.io only has ones that show stats https://shields.io/search/?q=modrinth
What about the title badge here?
https://github.com/PyPylia/Modrinth-Badges/blob/main/README.md
Any major reason this isnt moved to the canonical constructor of KeyImpl? Seems like its a common pattern here and could be over sight, ex. KeyedValueImpl can actually accept null keys.
The only reason I could think of is providing a trusted namespace/value object.
the serializer has always supported relocated gson until the 1.21.6 commit broke it again.
I don't wanna do a large refactor. Just fix the old behaviour being broken.
4536524 fix(api): Remove incorrect BossBar$Listener annota... - kezz
37a42fc chore(api): Update since + nbt return type for toB... - kezz
c87ac1f fix(key): Move null/format checks into canonical c... - kezz
103f493 feature(api): Use sealed subclass system for click... - kezz
ae3ad2a docs(api): Add notes about sealed interfaces that... - kezz
[KyoriPowered/adventure] New comment on issue: #1313 ClickEvent.custom crashes MiniMessage.serialize
I understand that; we use minimessage to serialize components into a readable format which we can save and read from a file and let plugin users customize it easier than having to deal with native JSON. If this could get implemented it would be awesome, if not I guess the only way to do this is via JSON.
[KyoriPowered/adventure] New comment on issue: #1313 ClickEvent.custom crashes MiniMessage.serialize
And thanks for the clarification btw!
[KyoriPowered/adventure] branch deleted: indra-4
[KyoriPowered/adventure] branch deleted: renovate/gradle-and-github-actions
Velocity seems to be waiting for adventure to implement the interface
https://github.com/PaperMC/Velocity/issues/1644
We've been waiting for Mojang to stabilize things, we can probably go back to looking at it once 5.0.0 has been released if Mojang goes a bit longer without making changes.
[KyoriPowered/adventure] New branch created: chore/5/configurate
794f67a chore(serializer-configurate4): Resolve compile er... - zml2008
There is still more work needed to fully handle some changes to click and hover events
[KyoriPowered/adventure] New comment on issue: #1313 ClickEvent.custom crashes MiniMessage.serialize
@kezz so it's not planned at all or not planned yet?
It will be added in Adventure 5.0.
long term it's fine I guess but currently it points to the oldest build due to the order I uploaded them in
Also the snapshot badge seems to use the wrong endpoint
[KyoriPowered/adventure-webui] New branch created: chore/ci-changes
3f3d9ad chore(ci): Move to new shared workflow location - zml2008
[KyoriPowered/adventure-webui] branch deleted: chore/ci-changes
[KyoriPowered/adventure-webui] branch deleted: renovate/gradle-and-github-actions
5247a8b chore(build): Update container coordinates for org... - zml2008
9a629e0 chore(ci): Update references to shared workflows - zml2008
b7abe74 chore(ci): Update JD publishing for relocatability - zml2008
3a5133c chore(ci): Update references to new shared workflo... - zml2008
e56e1e9 chore(build): Update references for PaperMC - zml2008
639f87b chore: update references for org move - zml2008
[PaperMC/adventure-platform] branch deleted: renovate/gradle-and-github-actions
[PaperMC/adventure-platform] branch deleted: renovate/major-gradle-and-github-actions
[PaperMC/adventure-webui] branch deleted: renovate/patch-release-dependency-changes
Done in d3168986e44f2b8db061f897eaeed2c499bd367a.
Done in manual merge of #1325.
Addressed in d3168986e44f2b8db061f897eaeed2c499bd367a.
Addressed in 5.0 update.
5919781 chore(key): Fix remaining build warnings and move... - kezz
I've recently noticed that gradients with more than 2 colors appear incorrectly when their phase is below 0.
I don't think this is an intended feature, since the gradients do appear correctly when their phase is -0.0, but don't when their phase is -0.1.
How to reproduce
Compare the deserialization results of these inputs:
<gradient:#FF0000:#00FF00:#4444FF:-0.0>Hello, World! Lorem Ipsum</gradient> and
<gradient:#FF0000:#00FF00:#4444FF:-0.1>Hello, World! Lorem Ipsum</gradient>
My results both on paper-1.21.4-232 and on webui.advntr.dev:
The GSON Serializer uses the deprecated ClickEvent.custom(Key Key, String data) method and causes a IllegalStateException (Expected STRING but was BEGIN_OBJECT at path $.click_event.payload) when trying to parse a ClickEvent with a custom callback that uses NBT for the payload.
Example Code
try (InputStream stream = Main.class.getResourceAsStream("/example.json")) {
BufferedReader streamReader = new BufferedReader(new InputStreamReader(stream));
JsonElement jsonElement = new JsonParser().parse(streamReader);
GsonComponentSerializer serializer = GsonComponentSerializer.builder()
.legacyHoverEventSerializer(NBTLegacyHoverEventSerializer.get())
.build();
Component component = serializer.deserializeFromTree(jsonElement);
}
{
"extra": [
{
"click_event": {
"id": "paper:click_callback",
"payload": {
"id": [
1034630811,
-1696642542,
-1523289780,
-15894539```...
It seems that the main/5 branch already has fixed this issue https://github.com/PaperMC/adventure/commit/1180f89a345653f6ad3a819c3ca0a7ed8e4565c9
Is it feasible to backport a fix to main/4?
I tried implementing it in the StyleSerializer, but haven't found an easy way to get an BinaryTagHolder from the JsonReader
Hi!
That would be nice if we have support for waypoints for locatorbar.
Based on a waypoint packet, the following methods can be used:
//Track new waypoint
Audience.track(String id, Waypoint waypoint);
Audience.track(UUID uuid, Waypoint waypoint);
//Remove tracked waypoint
Audience.untrack(UUID uuid);
Audience.untrack(String id);
//Update tracked waypoint
Audience.update(UUID uuid, Waypoint waypoint);
Audience.update(String id, Waypoint waypoint);
and the waypoint class:
Waypoint.empty(); //Empty waypoint
Waypoint.vector(TextColor color, int x, int y, int z); //Vector based waypoint with default style (minecraft:default)
Waypoint.vector(TextColor color, Key style, int x, int y, int z); //Vector based waypoint with style
Waypoint.chunk(TextColor color, int x, int z); //Chunk based waypoint with default style (minecraft:default)
Waypoint.chunk(TextColor color, Key style, int x, int z); //Chunk based waypoint with style
Waypoint.azimuth(TextColor color, float angle); //A```...
This should allow subtypes of ProfileProperty, which is commonly used by the implementing platform, to return a different type that may contain more information.
This should not be an ABI break.
772795b fix: replace all module-level NullMarked with pack... - Strokkur424
e4f2a3d Merge branch 'main/5' into chore/fix-nullability - Strokkur424
a981263 chore: annotated net.kyori.test package as NullMar... - Strokkur424
c9f1dd6 fix(api): start fixing api tests - Strokkur424
c8d181f fix(api): score is no longer flattened, tests shou... - Strokkur424
46a28c5 fix: a bunch of compilation errors and failing tes... - Strokkur424
1707398 chore: bump gson version and fix checkstyle errors - Strokkur424
33ee818 chore: minor changes - Strokkur424
d17e0d2 fix: set interpret default to false - Strokkur424...
[PaperMC/adventure] New branch created: feature/synthetic
633ce4a feature(api): Proof-of-concept synthetic annotatio... - kezz
Alright, I've done everything I've wanted to do for this PR now. Arguments have been implemented, as per @zml2008's suggestion, in a combined way. They new syntax looks like this:
<tagname
someflag
somename='a quoted value with spaces'
anotherflag :queued arguments behind:here>Hey abby</tagname>
This means named arguments are simply placed between the tag name and the first colon.
As discussed in [discord](#adventure-contrib message), this is considered user error and works as intended
ceb5d3b chore: Migrate to Java 9+ immutable collection met... - kezz
eed34fe chore(deps): Update guava monorepo to v33.5.0-jre - renovate[bot]
8b41dd8 chore(deps): Update dependency org.junit:junit-bom... - renovate[bot]
cf2935c feature(api): Make custom payload NBT optional - kezz
e0d7175 feature(minimessage,serializer-gson): Correctly ha... - kezz
508e4de chore(deps): Update dependency com.puppycrawl.tool... - renovate[bot]
f4ea904 Merge pull request #1345 from PaperMC/feature/opti... - kezz
48473fd Merge pull request #1342 from PaperMC/renovate/maj... - kezz
15a3d6e Merge pull request #1341 from PaperMC/renovate/maj... - kezz
1fbe17e Merge pull request #1340 from PaperMC/renovate/gua... - kezz...
[PaperMC/adventure] branch deleted: feature/optional-nbt-payload
Looking further into this, I don't think there's a need to expose/use something for this as it's pretty simple.
Closing this as I'm going to get this into the 4.x series instead.
[PaperMC/adventure] branch deleted: feature/book-like
[PaperMC/adventure] New branch created: feature/book-like
d20cc0f feature(api): Make ChatType#key nullable, and remo... - kezz
3d2e5dd chore(api): Note the removal of keyed implementati... - kezz
Expected behavior
The "Head" tag working properly and discarding illegal format.
Observed/Actual behavior
The message results in a RuntimeException because of Player name contained disallowed characters: 'aerulion '
View Exception:
|| [14:00:50 ERROR]: Error sending packet clientbound/minecraft:system_chat io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:system_chat' at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:62) ~[paper-1.21.10.jar:1.21.10-91-9934c17] at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:13) ~[paper-1.21.10.jar:1.21.10-91-9934c17] at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:27) ~[paper-1.21.10.jar:1.21.10-91-9934c17] at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:12) ~[paper-1.21.10.jar:1.21.10-91-9934c17] at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.118.Final.jar:4...
I don't think we'll discard illegal characters beyond trimming the string, but we can make the error sooner and cleaner.
Note this also applies to manual creation of a head object component!
14eddd1 chore(api): Refactor Index from interface to class - kezz
8ee34f4 chore(api): Refactor NamedTextColor from interface... - kezz
f7db98f chore(api): Refactor HoverEvent (and subclasses) f... - kezz
e6c507c chore(api): Refactor ClickEvent and Action from in... - kezz
e9b561e chore(api): Add missing style buildable extends - kezz
e3b5f6a chore(api): Remove UTF8ResourceBundleControl - kezz
They don't have to be nullable, but the builder should default to the empty component and we should have a pages-only constructor.
c5263b1 feature(api): Add Component#toBuilder and deprecat... - kezz
75fac78 docs(api): Deprecate the "enumness" of ClickEvent.... - kezz
a2fc747 chore(nbt): Make all tag types (and compound tag g... - kezz
0321af2 chore(api): Mark missing non-extendable interfaces - kezz
55847dd chore(serializer-gson): Deprecate builder methods... - kezz
3d2e5dd chore(api): Note the removal of keyed implementati... - kezz
6621182 chore(api): Deprecate UTF8ResourceBundleControl fo... - kezz
7c35f54 Merge pull request #1329 from PaperMC/chore/pre-5-... - kezz...
[PaperMC/adventure] branch deleted: chore/pre-5-changes
[PaperMC/adventure] New tag created: v4.26.0
Adventure 4.26.0 is hopefully the final release before the full release of 5.0. This release solely contains final changes and deprecations in preparation of the 5.0.
For full information about the 5.0 update, check out the following links:
What's Changed
✨ Features
- Pre-5.0 update changes/deprecations by @kezz in https://github.com/PaperMC/adventure/pull/1329
📚 Documentation
- docs: Update documentation, discord and snapshot links by @kezz in https://github.com/PaperMC/adventure/pull/1323
Full Changelog: https://github.com/PaperMC/adventure/compare/v4.25.0...v4.26.0
Currently there is an interface called "BossBarViewer", and it has two uses:
- It is used in
net.kyori.adventure.bossbar.BossBar#viewerswhich returns anIterable<? extends BossBarViewer>. - It defines an
activeBossBarsfunction that returns anIterable<? extends BossBar>.
Given how this interface is not used in the BossBar#addViewer or BossBar#removeViewer, I think it'd be a good idea to either remove the BossBarViewer interface or spread out its use.
To remove the interface, the activeBossBars function could be moved to the Audience interface, which would not be out of line due to Audience already having the showBossBar and hideBossBar functions. Then, the BossBar#viewers function would simply return Iterable<? extends Audience>.
To expand it's use, I think it would be a good idea to move the Audience#showBossBar and Audience#hideBossBar functions to BossBarViewer. The BossBar#addViewer and BossBar#removeViewer functions would also be modified to take a BossBarViewer object as...
Made the api changes, available here:
More BossBarViewer
No BossBarViewer
If I should make a pull request, lemme know.
I'll try making the corresponding changes to the paper api, but I'm running into weird build errors with paper-server and will not be able to test the code.
There currently is no option to use the minecraft:dynamic/run_command click event type, only the standard minecraft:run_command with ClickEvent.runCommand(), this makes Minecraft command macros inaccessible. I would like to propose something like ClickEvent.dynamicRunCommand() for this.
[PaperMC/adventure-platform-mod] branch deleted: renovate/major-indra
[PaperMC/adventure-platform-mod] branch deleted: renovate/patch-release-dependency-changes
[PaperMC/adventure-platform-mod] New branch created: dev/1.21.11
fc87fbd Initial 1.21.11-pre2 update - jpenilla
[PaperMC/adventure-platform-mod] New branch created: mc/1.21.10
I have server with combined UUIDs like online players have online ones & offline ones have offline ones, but all online players have shown just Alex head.
Do you think this could be fixed, please?
[PaperMC/adventure-platform-mod] branch deleted: dev/1.21.11
[PaperMC/adventure-platform-mod] branch deleted: renovate/neoforge
7ed4891 Configure auto release publishing to Modrinth - jpenilla
64cd3ef Use correct Modrinth secret name - jpenilla
MiniMessage is just a component serializer; the upcoming named args might offer more control with this component, but, this is not our issue
I'm wondering if it possible to not rely on mojang's api for the <head> tag texture in the future. Because currently it limited to name, uuid and as i understand resource pack path. Thank you!
[PaperMC/adventure-platform-mod] New tag created: v6.8.0
This version of adventure-platform-mod adds support for Minecraft 1.21.11, distributing Adventure 4.25.0 for the Fabric and NeoForge platforms. Minecraft versions older than 1.21.11 are not supported by this release.
Full Changelog: https://github.com/PaperMC/adventure-platform-mod/compare/v6.7.0...v6.8.0
[PaperMC/adventure] Pull request review comment: #1258 chore(deps): Update gradle and github actions
uses: "KyoriPowered/ci-cookbook/.github/workflows/java-ci.yaml@61e680f2c16a2c61fbe537507e653dc73ce72425" # 2025.12.13.1
0bb951f bump ci-cookbook - zml2008
[PaperMC/adventure] branch deleted: renovate/gradle-and-github-actions
[PaperMC/adventure] branch deleted: renovate/error-prone-monorepo
[PaperMC/adventure] branch deleted: renovate/patch-release-dependency-changes
[PaperMC/adventure] branch deleted: renovate/checkstyle
92fe87a release: prepare for further development on 4.26.1 - zml2008
[PaperMC/adventure] branch deleted: debug-workflow
Adventure 4.26.0 is hopefully the final release before the full release of 5.0. This release solely contains final changes and deprecations in preparation of the 5.0.
For full information about the 5.0 update, check out the following links:
What's Changed
✨ Features
- Pre-5.0 update changes/deprecations by @kezz in https://github.com/PaperMC/adventure/pull/1329
📚 Documentation
- docs: Update documentation, discord and snapshot links by @kezz in https://github.com/PaperMC/adventure/pull/1323
Full Changelog: https://github.com/PaperMC/adventure/compare/v4.25.0...v4.26.0
[PaperMC/adventure] New tag created: v4.26.1
Adventure 4.26.1 is hopefully the final release before the full release of 5.0. This release solely contains final changes and deprecations in preparation of the 5.0.
For full information about the 5.0 update, check out the following links:
Note: 4.26.0 was released on GitHub but never deployed and should be considered non existant.
What's Changed
✨ Features
- Pre-5.0 update changes/deprecations by @kezz in https://github.com/PaperMC/adventure/pull/1329
📚 Documentation
- docs: Update documentation, discord and snapshot links by @kezz in https://github.com/PaperMC/adventure/pull/1323
Full Changelog: https://github.com/PaperMC/adventure/compare/v4.25.0...v4.26.1
Problem
When calling MiniMessage#serialize(String), all tags are escaped.
Example:
Component deserialized = Component.text("Hello, World", NamedTextColor.GREEN); String serialized = MiniMessage.miniMessage().serialize(deserialized); IO.println(serialized);prints:
\<green>Hello, World.
As you can probably see, the green color is escaped.
Then if you deserialize it again, it will be just plain text like <green>Hello, World
Why would you want that?
It especially doesn't make sense, because in the Component, it too, represents a seen color, not its literal name.
Why it's annoying
As everyone knows, you can't really edit a Component like a String, so you sometimes need to convert it to a String.
Then you have a cycle like this: serialize - edit - deserialize.
Then the problem is, that you have a plain String if the component before already had data
Easy solution
I think this should technically work.
Make this simple change in the net.kyori.adventure-text-...
I cannot reproduce this issue at all. Also, please don't use AI to write your issues.
No AI used, I can try to make reproduction of the "bug" as clear as possible.
Btw it isn't a bug, it's just implemented that way.
Simple test plugin:
public final class Main extends JavaPlugin implements Listener { @Override public void onEnable() { getServer().getPluginManager().registerEvents(this, this); } @EventHandler public void onChat(AsyncChatEvent event) { event.renderer((source, sourceDisplayName, message, viewer) -> // prefix Component.text("[", NamedTextColor.GRAY) .append(sourceDisplayName.color(NamedTextColor.WHITE)) .append(Component.text("] ", NamedTextColor.GRAY)) // Message here // Just sends the literal output of serialize/serializeOrNull (NotNull) .append(Component.text(MiniMessage.miniMessage().serializeOrNull(message))) // my personal solution //.append(MiniMessageCo```...
What you want there is plain text serialization.
MiniMessage serializes into a string, which on serialization creates the same components. And in your case it was a {"text": "<red>a"} so it will make a minimessage string that creates the same component
@masmc05
1. Plain Text Serialization strips colors and everything. If you don't believe me, try it for yourself with the
2. It just doesn't create the same component. I don't know why you think that
Input
{color:"red",text:"Hello, World"}
MiniMessage Serialization
{text:"\<red>Hello, World"}
Plain Text Serialization
{text:"Hello, World"}
As you can probably tell, none of these are the same.
Also @kezz this neither a bug nor not easily reproducable with the Simple Test plugin I already sent, it is a FEATURE REQUEST for you to add:
A method in the MiniMessage class, that serializes a component into a String, which can be deserialized into the same Component simply using MiniMessage#deserialize(String).
That would be handy because right now you would either have to modify the output --> result could vary if there's any change in the API, or access the internal MiniMessageSerializer --> unreadable code, possibly impossible, Change in java version could easily break it.
Btw, it...
Everyone assumes you used AI because of this:
<img width="622" height="374" alt="Image" src="https://github.com/user-attachments/assets/4f7ab55f-afb7-48e1-863d-a1840261625a" />
It looks like you asked AI to solve the problem and it came up with a technically correct solution that solves your specific problem by breaking how it works for everyone else.
Input
{color:"red",text:"Hello, World"}MiniMessage Serialization
{text:"<red>Hello, World"}
This is not correct. Our code does not output this when serialising a component and it is not due to the code you mentioned. This is not a feature request because MiniMessage does not act in the way you mention.
Just realized I gave a wrong example of this and started at a wrong point - sorry for that.
What I would want is a method which I can deserialize a Component into a String like this:
Component cmp = Component.text("Hello, <green>World", NamedTextColor.RED); String out = MiniMessage.miniMessage().deepSerialize(cmp); IO.println(out);Which outputs:
<red>Hello, <green>World, not<red>Hello, \<green>Worldas serialize does.
So a method that keeps Component formatting without escaping tags in the text unlike the PlainTextComponentSerializer.
This would be pretty useful for editing chat messages
Then as mentioned at the beginning, this is not a feature of MiniMessage as we are aiming for round trip serialising. It is also not a feature we are willing to add as it is poor design. Please feel free to hop into our Discord if you need more support.
[PaperMC/adventure-platform-mod] New branch created: jd-fix
[PaperMC/adventure] branch deleted: jd-fix
[PaperMC/adventure-platform-mod] branch deleted: jd-fix
This could be done by simply adding the line:
Map.entry("femboy", colors(0xD260A5, 0xE4AFCD, 0xFEFEFE, 0x57CEF8, 0xFEFEFE, 0xE4AFCD, 0xD260A5)),
to text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/standard/PrideTag.java
[PaperMC/adventure-webui] branch deleted: renovate/adventure
[PaperMC/adventure-webui] branch deleted: renovate/patch-release-dependency-changes
[PaperMC/adventure-webui] branch deleted: renovate/gradle-and-github-actions
This PR simply adds the femboy flag to the pride tag.
[PaperMC/adventure-platform-mod] branch deleted: renovate/gradle-and-github-actions
[PaperMC/adventure-platform-mod] branch deleted: renovate/checkstyle
[PaperMC/adventure-platform-mod] branch deleted: renovate/adventure
[PaperMC/adventure-platform-mod] branch deleted: renovate/me.lucko-fabric-permissions-api-0.x
[PaperMC/adventure-platform-mod] branch deleted: renovate/patch-release-dependency-changes
[PaperMC/adventure-platform-mod] branch deleted: renovate/major-gradle-and-github-actions
931d66c chore(deps): correct versioning for fabric-api-cat... - zml2008
[PaperMC/adventure-platform-mod] branch deleted: renovate/net.fabricmc.fabric-api-fabric-api-catalog-0.x
[PaperMC/adventure-platform-mod] branch deleted: renovate/neoforge
[PaperMC/adventure-platform-mod] branch deleted: renovate/major-checkstyle
why though, that's not even part of the LGBTQ2IA+ movement. It's only an aesthetic unrelated to pride. A femboy could be bi, trans, straight, gay, etc...
Hello, I had suggested the addition of a Conversation API back in 2021 (see #309). Now that PaperMC has deprecated—and intends to remove—the Bukkit Conversation API from Paper (which many plugins do, in fact, rely on), I was wondering if now might be a good time to reconsider? It seems that Kyori is now under the PaperMC organization, but I still feel as though an alternative API could find a home within the adventure project.
The closing note of #309 by zml2008 envisioned this functionality being picked up by the community. It's been over three years since then, but no alternative libraries have been popularized, to my knowledge. The best options I'm aware of are this one developed by @MrIvanPlays and this one worked on by @IllusionTheDev - neither of which has seen wide adoption as of writing.
Given the current circumstances, would the project reconsider adding a Conversation API to adventure?
Not an official project statement/decision.
I think the whole "type a message back to a plugin" concept is solved by the new dialog feature introduced in the game.