GeyserMC / MCProtocolLib

A library for communication with a Minecraft client/server.
MIT License
728 stars 202 forks source link

Render Component as HTML #850

Closed archibald1337 closed 3 months ago

archibald1337 commented 3 months ago

I can get server's description like this:

client.setFlag(MinecraftConstants.SERVER_INFO_HANDLER_KEY, (session, info) -> {
    log.info("Description: {}", info.getDescription());
});

but is it possible to render all the components from description as HTML, considering the text decorations and styles?

Camotoy commented 3 months ago

Are you trying to show it on the web specifically then?

archibald1337 commented 3 months ago

yes

Camotoy commented 3 months ago

This is probably outside the scope of our project and into the Adventure library.

There's bits and bobs here: https://github.com/KyoriPowered/adventure-webui/blob/main/src/jvmMain/kotlin/net/kyori/adventure/webui/jvm/minimessage/hook/StandardRenderHooks.kt

See https://docs.advntr.dev/index.html# for their docs and a link to their Discord for further help. Good luck!