{"id":13775238,"url":"https://github.com/mfnalex/CustomBlockData","last_synced_at":"2025-05-11T07:32:14.169Z","repository":{"id":41186033,"uuid":"379954235","full_name":"mfnalex/CustomBlockData","owner":"mfnalex","description":"Provides a PersistentDataContainer for every Block location","archived":false,"fork":false,"pushed_at":"2025-04-05T15:47:54.000Z","size":130,"stargazers_count":135,"open_issues_count":6,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T16:32:51.429Z","etag":null,"topics":["bukkit","pdc","persistentdatacontainer","spigot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mfnalex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"custom":["https://paypal.me/mfnalex"]}},"created_at":"2021-06-24T14:32:39.000Z","updated_at":"2025-04-05T15:47:58.000Z","dependencies_parsed_at":"2023-09-08T06:28:25.496Z","dependency_job_id":"9084dd5e-14c1-4561-8ffd-eeaa183402e0","html_url":"https://github.com/mfnalex/CustomBlockData","commit_stats":null,"previous_names":["mfnalex/customblockdata"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfnalex%2FCustomBlockData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfnalex%2FCustomBlockData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfnalex%2FCustomBlockData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfnalex%2FCustomBlockData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mfnalex","download_url":"https://codeload.github.com/mfnalex/CustomBlockData/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253533887,"owners_count":21923515,"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":["bukkit","pdc","persistentdatacontainer","spigot"],"created_at":"2024-08-03T17:01:35.690Z","updated_at":"2025-05-11T07:32:14.137Z","avatar_url":"https://github.com/mfnalex.png","language":"Java","funding_links":["https://paypal.me/mfnalex"],"categories":["NBT \u0026 PDC"],"sub_categories":[],"readme":"# CustomBlockData\n\u003c!--- Buttons start --\u003e\n\u003c!--suppress HtmlDeprecatedAttribute --\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/\"\u003e\n    \u003cimg src=\"https://static.jeff-media.com/img/button_spigotmc_thread.png?3\" alt=\"SpigotMC Thread\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://hub.jeff-media.com/javadocs/com/jeff-media/custom-block-data/2.2.2/\"\u003e\n    \u003cimg src=\"https://static.jeff-media.com/img/button_javadocs.png?3\" alt=\"Javadocs\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.jeff-media.com/\"\u003e\n    \u003cimg src=\"https://static.jeff-media.com/img/button_discord.png?3\" alt=\"Discord\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://paypal.me/mfnalex\"\u003e\n    \u003cimg src=\"https://static.jeff-media.com/img/button_donate.png?3\" alt=\"Donate\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003c!--- Buttons end --\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://maven-badges.herokuapp.com/maven-central/com.jeff-media/custom-block-data\"\u003e\n  \u003cimg src=\"https://maven-badges.herokuapp.com/maven-central/com.jeff-media/custom-block-data/badge.png\" alt=\"Maven\" /\u003e\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/github/last-commit/jeff-media-gbr/customblockdata\" /\u003e\n\u003c/p\u003e\n\n\nCustomBlockData is a library for the Bukkit API that allows you to store ANY information inside blocks.\nIt does so by providing the `CustomBlockData` class which implements the `PersistentDataContainer` interface.\n\nIt does not need any files or databases by saving the information inside the chunk's PersistentDataContainer, and the information is persistent even after server restarts.\n\nCustomBlockData is compatible with all Bukkit versions from 1.16.3 onwards, including all forks. Older versions are not supported because *Chunk* only implements *PersistentDataHolder* since 1.16.3.\n\n## Advantages\n\n- It does not need any files or databases\n- When the chunk where the block is inside gets deleted, there will be no leftover information\n- You can store anything that can be stored inside a normal `PersistantDataContainer` (which means, basically, **anything**)\n- It can automatically keep track of block changes and automatically delete block data when a block gets broken, move data when a block gets moved, etc\n  - You can make specific blocks protected from this, or listen to the cancellable `CustomBlockDataEvent`s \n  - (This is disabled by default for backwards compatibility - just call `CustomBlockData#registerListener(Plugin)` to enable it) \n\n## Maven Dependency\nThe dependency is available on Maven Central:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.jeff-media\u003c/groupId\u003e\n    \u003cartifactId\u003ecustom-block-data\u003c/artifactId\u003e\n    \u003cversion\u003e2.2.4\u003c/version\u003e\n    \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n**Shading and relocating**\n\nYou must shade (and you should relocate) the `customblockdata` package.\n\n```xml\n\u003cbuild\u003e\n  \u003cplugins\u003e\n    \u003cplugin\u003e\n      \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n      \u003cartifactId\u003emaven-shade-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e3.5.0\u003c/version\u003e\n      \u003cconfiguration\u003e\n        \u003crelocations\u003e\n          \u003crelocation\u003e\n            \u003cpattern\u003ecom.jeff_media.customblockdata\u003c/pattern\u003e\n            \u003cshadedPattern\u003eYOUR.PACKAGE.NAME.customblockdata\u003c/shadedPattern\u003e\n          \u003c/relocation\u003e\n        \u003c/relocations\u003e\n      \u003c/configuration\u003e\n      \u003cexecutions\u003e\n        \u003cexecution\u003e\n          \u003cphase\u003epackage\u003c/phase\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003eshade\u003c/goal\u003e\n          \u003c/goals\u003e\n        \u003c/execution\u003e\n      \u003c/executions\u003e\n    \u003c/plugin\u003e\n  \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\n## Gradle\n\n**Repository**\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n```\n\n**Dependencies**\n```groovy\ndependencies {\n    implementation 'com.jeff-media:custom-block-data:2.2.4'\n}\n```\n\n**Shading \u0026 Relocating**\n\nYou must shade (and you should relocate) the `customblockdata` package. You will need the Shadow plugin found [here](https://plugins.gradle.org/plugin/com.gradleup.shadow). Add the following to your shadowJar section!\n\n```groovy\nshadowJar {\n    relocate 'com.jeff_media.customblockdata', 'your.package.customblockdata'\n}\n```\n\nOptionally, make the build task depend on shadowJar:\n\n```groovy\nbuild.dependsOn += shadowJar\n```\n\n## Usage\n\nTo get a block's PersistentDataContainer, all you have to do is create an instance of `CustomBlockData` providing the block and\nthe instance of your main class:\n\n```java\nPersistentDataContainer customBlockData = new CustomBlockData(block, plugin);\n```\n\nIf you want CustomBlockData to autimatically handle moving/removing block data for changed blocks (e.g. move data when a block gets moved with a piston, or to remove data when a player breaks a block, etc) you must call CustomBlockData.registerListener(Plugin) once in your onEnable().\n\nFor more information about how to use it, just look at the [API docs for the PersistentDataContainer](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/persistence/PersistentDataContainer.html) or look at [this tutorial](https://www.spigotmc.org/threads/a-guide-to-1-14-persistentdataholder-api.371200/).\n\n## Javadocs\n\nJavadocs can be found here: https://hub.jeff-media.com/javadocs/com/jeff-media/custom-block-data/2.2.2/\n\n[//]: # (## Example plugin)\n\n[//]: # ()\n[//]: # (Click [here]\u0026#40;https://github.com/JEFF-Media-GbR/CustomBlockData-Example\u0026#41; for an example plugin.)\n\n[//]: # (It lets you left-click on a block to store your currently held ItemStack inside. Once the block is broken,)\n\n[//]: # (it will drop the stored item.)\n\n## Discord\n\nIf you need help, feel free to join my Discord server and head to #programming-help:\n\n\u003ca href=\"https://discord.jeff-media.de\"\u003e\u003cimg src=\"https://api.jeff-media.de/img/discord1.png\"\u003e\u003c/a\u003e\n\n## Donate\n\nIf you are using this project in your paid plugins, or if you just want to buy me a coffee, I would be happy over a small donation :)\n\n\u003ca href=\"https://paypal.me/mfnalex\"\u003e\u003cimg src=\"https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif\" border=\"0\" name=\"submit\" title=\"PayPal - The safer, easier way to pay online!\" alt=\"Donate with PayPal\" /\u003e\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfnalex%2FCustomBlockData","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfnalex%2FCustomBlockData","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfnalex%2FCustomBlockData/lists"}