{"id":19248049,"url":"https://github.com/dockyardmc/scroll","last_synced_at":"2025-04-21T11:33:57.776Z","repository":{"id":239649015,"uuid":"799666531","full_name":"DockyardMC/Scroll","owner":"DockyardMC","description":"Minecraft component library built for DockyardMC","archived":false,"fork":false,"pushed_at":"2025-03-30T01:11:54.000Z","size":179,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-30T02:22:37.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DockyardMC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-12T20:06:44.000Z","updated_at":"2025-03-30T01:11:57.000Z","dependencies_parsed_at":"2024-06-07T02:40:29.731Z","dependency_job_id":"cb40caf7-3669-4998-8902-86ba02d554a4","html_url":"https://github.com/DockyardMC/Scroll","commit_stats":null,"previous_names":["dockyardmc/scroll"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DockyardMC%2FScroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DockyardMC%2FScroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DockyardMC%2FScroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DockyardMC%2FScroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DockyardMC","download_url":"https://codeload.github.com/DockyardMC/Scroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250048108,"owners_count":21366176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T18:06:14.073Z","updated_at":"2025-04-21T11:33:57.766Z","avatar_url":"https://github.com/DockyardMC.png","language":"Kotlin","funding_links":["https://ko-fi.com/LukynkaCZE"],"categories":[],"sub_categories":[],"readme":"![Scroll Banner](https://github.com/user-attachments/assets/77ca5f70-0ad0-48a9-9542-4c0bdc976a16)\n\n---\n\n[![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fmvn.devos.one%2Freleases%2Fio%2Fgithub%2Fdockyardmc%2Fscroll%2Fmaven-metadata.xml\u0026style=for-the-badge\u0026logo=maven\u0026logoColor=%23FFFFFF\u0026label=Latest%20Version\u0026color=%23afff87)](https://mvn.devos.one/#/releases/io/github/dockyardmc/dockyard)\n[![Static Badge](https://img.shields.io/badge/Language-Kotlin-Kotlin?style=for-the-badge\u0026color=%23963cf4)](https://kotlinlang.org/)\n\n[![wakatime](https://wakatime.com/badge/github/DockyardMC/Scroll.svg?style=for-the-badge)](https://wakatime.com/badge/github/DockyardMC/Scroll)\n[![Discord](https://img.shields.io/discord/1242845647892123650?label=Discord%20Server\u0026color=%237289DA\u0026style=for-the-badge\u0026logo=discord\u0026logoColor=%23FFFFFF)](https://discord.gg/SA9nmfMkdc)\n[![Static Badge](https://img.shields.io/badge/Donate-Ko--Fi-pink?style=for-the-badge\u0026logo=ko-fi\u0026logoColor=%23FFFFFF\u0026color=%23ff70c8)](https://ko-fi.com/LukynkaCZE)\n\n\nA Minecraft Component library made for the [DockyardMC](https://github.com/DockyardMC/Dockyard) project. It includes easy to use and learn format to represent text components as strings, similiar to minimessage\n\n## Installation\n\n\u003cimg src=\"https://cdn.worldvectorlogo.com/logos/kotlin-2.svg\" width=\"16px\"\u003e\u003c/img\u003e\n**Kotlin DSL**\n```kotlin\nrepositories {\n    maven {\n        name = \"devOS\"\n        url = uri(\"https://mvn.devos.one/releases\")\n    }\n}\n\ndependencies {\n    implementation(\"io.github.dockyardmc:scroll:2.3\")\n}\n```\n\u003cimg src=\"https://github.com/LukynkaCZE/PrettyLog/assets/48604271/3293feca-7395-4100-8b61-257ba40dbe3c\" width=\"18px\"\u003e\u003c/img\u003e\n**Gradle Groovy**\n```groovy\nrepositories {\n  maven {\n    name \"devOS\"\n    url \"https://mvn.devos.one/releases\"\n  }\n}\n\ndependencies {\n  implementation 'io.github.dockyardmc:scroll:2.3'\n}\n```\n---\n\n## Usage\n\nYou can create a different type of components using the following syntax\n\n**_Normal Text Component_**\n```kotlin\nval textComponent = TextComponent(\n    text = \"woah red bold text\",\n    color = TextColor.RED,\n    bold = true\n    // ..other styling\n)\n```\n![obrazek](https://github.com/DockyardMC/Scroll/assets/48604271/563c8062-4766-4d9d-9181-7bf11d36a684)\n\n\n\n**_Keybind Component_** (Reads the current keybinds from client)\n```kotlin\nval keybindComponent = KeybindComponent(\n    keybind = \"key.jump\"\n    // ..other styling\n)\n```\n![obrazek](https://github.com/DockyardMC/Scroll/assets/48604271/1921623c-9357-4fc8-a042-ed3f3a2dfb14)\n\n**_Translatable Component_** (Reads the language file from client)\n```kotlin\nval translatableComponent = TranslatableComponent(\n    translate = \"advancements.husbandry.safely_harvest_honey.description\"\n    // ..other styling\n)\n```\n![obrazek](https://github.com/DockyardMC/Scroll/assets/48604271/3fd17122-6ecd-4f5e-b287-f588250829c5)\n\n---\nYou can also create component that contains other components\n```kotlin\nval bigBoiComponent = Components.new(mutableListOf(\n    TextComponent(text = \"Im looking to \"),\n    TextComponent(text = \"buy \", color = TextColor.YELLOW, bold = true),\n    TextComponent(text = \"your \"),\n    TextComponent(text = \"finest potions \", color = \"#9436ff\", italics = true)\n    TextComponent(text = \"so I can jump high when I press \"),\n    KeybindComponent(keybind = \"key.jump\", color = TextColor.YELLOW, underlined = true)\n))\n```\n![obrazek](https://github.com/DockyardMC/Scroll/assets/48604271/88e2fd91-ce19-492a-a033-52b68529316f)\n\n---\n### String to Components\nYou can also write your components using string format\n```kotlin\nval component = \"\u003cyellow\u003eHE'S \u003cred\u003e\u003cbold\u003eALLERGIC\u003cyellow\u003e TO BEANS!\".toComponent()\n```\n![obrazek](https://github.com/DockyardMC/Scroll/assets/48604271/f7d969c3-c9ab-426e-ad10-00027015a485)\n\nThe following tags are valid:\n\n- Colors:\n  - `\u003ccolor\u003e` for predefined color (ex. red, orange, lime, aqua)\n  - `\u003c#hex\u003e` for custom hex color (must include the # at the start)\n- Format\n  - `\u003cbold\u003e`\n  - `\u003citalic\u003e`\n  - `\u003cobfuscated\u003e`\n  - `\u003cunderline\u003e`\n  - `\u003cstrikethrough\u003e`\n- Events\n  - `\u003chover:'text''\u003e` for hover-able text. Formatting applies to inner text as well\n  - `\u003cclick:action:'text'\u003e` for clickable text. Actions are following\n    - `open_url` - following text needs to start with \"https://\"\n    - `run_command` - following text needs to start with \"/\"\n    - `suggest_command` - following text needs to start with \"/\"\n    - `copy_to_clipboard`\n- Other\n  - `\u003cfont:'file_name'\u003e` to change font\n  - `\u003crainbow\u003e` to make the text after rainbow. (Resets when another color is applied or when \u003creset\u003e is reached)\n  - `\u003ctransition:#hex1:#hex2:step\u003e` - Color Interpolation, step is float between 0 and 1\n  - `\u003creset\u003e` to reset formatting\n\nIn some cases (format and reset) you can use shortened versions\n- `\u003cb\u003e` is short of `\u003cbold\u003e`\n- `\u003ci\u003e` is short of `\u003citalic\u003e`\n- `\u003co\u003e` is short of `\u003cobfuscated\u003e`\n- `\u003cu\u003e` is short of `\u003cunderline\u003e`\n- `\u003cs\u003e` is short of `\u003cstrikethrough\u003e`\n- `\u003cr\u003e` is short of `\u003creset\u003e`\n\nYou also end tags by prefixing the tag with `/`\n- `\u003cbold\u003ethis is bold :D\u003c/bold\u003e this is not :(`\n\n⚠️ _Currently, there is no support for custom tags_\n\n---\n\n## Sanitization \u0026 Escapes\n\nYou can escape tag by putting `\\\\` at the begging of it\n\n`\u003clime\u003ePlease login using /login \\\\\u003cpassword\u003e` will result to `\"Please login using /login \u003cpassword\u003e\"`\n\nYou can sanitize string using `String.scrollSanitized()` This is recommended for any player input\n\n`\"Player123: omg \u003cred\u003ered color and \u003cbold\u003ebold woah\".scrollSanitized()` would result to `\"Player123: omg \\\\\u003cred\u003ered color and \\\\\u003cbold\u003ebold woah\"` \n\n---\n\n## Serialization\nYou can convert string **to Component** using `\"string\".toComponent()` method or using `StringToComponentSerializer().serialize(\"string\")`\n\n---\n\nYou can convert component **to NBT** using `Component.toNbt()` or using `ComponentToNbtSerializer.serialize(component)`. This will give you instance of [Hephaistos](https://github.com/Minestom/Hephaistos) NBT Compound\n\n---\n\nYou can convert component to Json using `Component.toJson()` or using `ComponentToJsonSerializer.serialize(component)`\n\n---\n\nYou can convert Json to component using `JsonToComponentSerializer.serialize(json)`\n\n---\n\n⚠️ _**There is currently no integration with either vanilla minecraft server components or adventure/minimessage**_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockyardmc%2Fscroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdockyardmc%2Fscroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockyardmc%2Fscroll/lists"}