{"id":15292840,"url":"https://github.com/esploratori-dev/bedrock","last_synced_at":"2026-01-08T14:39:10.263Z","repository":{"id":257789822,"uuid":"861006989","full_name":"Esploratori-Dev/bedrock","owner":"Esploratori-Dev","description":"This repository offers a library for sending messages and embeds from a Bedrock Dedicated Server (BDS) to Discord.","archived":false,"fork":false,"pushed_at":"2024-09-22T13:06:37.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-25T21:51:13.455Z","etag":null,"topics":["bedrock-addons","bedrock-dedicated-server","bedrockbridge","discord","minecraft-bedrock-edition"],"latest_commit_sha":null,"homepage":"https://discord.com/invite/G6dEEqRbz6","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Esploratori-Dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-09-21T18:42:34.000Z","updated_at":"2024-09-22T13:06:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"b99f8fdb-c710-40b1-9326-1195603994c9","html_url":"https://github.com/Esploratori-Dev/bedrock","commit_stats":null,"previous_names":["esploratori-dev/bedrock"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esploratori-Dev%2Fbedrock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esploratori-Dev%2Fbedrock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esploratori-Dev%2Fbedrock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esploratori-Dev%2Fbedrock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Esploratori-Dev","download_url":"https://codeload.github.com/Esploratori-Dev/bedrock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242902541,"owners_count":20204123,"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":["bedrock-addons","bedrock-dedicated-server","bedrockbridge","discord","minecraft-bedrock-edition"],"created_at":"2024-09-30T16:28:39.905Z","updated_at":"2026-01-08T14:39:10.234Z","avatar_url":"https://github.com/Esploratori-Dev.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# BridgeDirect\nThis repository offers a library for sending messages and embeds from a Bedrock Dedicated Server (BDS) to Discord. \n\n\u003e [!NOTE]  \n\u003e This class is intended to be used inside a Minecraft Bedrock scripting addon.\n\u003e Despite the class being able to run on any minecraft world, it will work only when run along with [BedrockBridge](https://github.com/InnateAlpaca/BedrockBridge),\n\u003e which is currently available for bds server (and not realms or local worlds).\n\n\u003e [!NOTE]  \n\u003e This library works for all BedrockBridge versions since v1.4.2, which runs on Minecraft Bedrock Edition v1.21.30. Previous versions are not supported.\n\n## What does the library do?\nWith this library you have access to a `BridgeDirect` instance. A simple class that handles sending messages to [BedrockBridge](https://github.com/InnateAlpaca/BedrockBridge) through scriptevents. BedrockBridge will handle the discord connection part.\n\n## How to use it?\nYou can either copy the code of the class to your project, or install the npm package and then [bundle your pack](https://jaylydev.github.io/posts/bundle-minecraft-scripts-esbuild/).\n\n```js\nimport { bridgeDirect } from \"@esploratori/bedrock\";\n\nbridgeDirect.events.directInitialize.subscribe(() =\u003e {\n\n    bridgeDirect.sendMessage(\"Welcome from bedrock!\")\n\n})\n\n```\n\nIf you copy the file, the first line of this code will probably look like this `import { bridgeDirect } from \"./index.js\"`.\n\n![direct_example](https://github.com/user-attachments/assets/d76bacbb-8c7a-4e21-ac28-9df864df438f)\n\nBe careful when using the library that the directInitialize event has been sent, otherwise trying to send messages will result in an error.\n\n1. A possible approach to this problem could be checking if the connection is ready before sending logs.\n```js\n// ...\nimport { world } from \"@minecraft/server\"\n\nworld.afterEvents.itemUse.subscribe(e=\u003e{\n    if (e.itemStack.nameTag===\"legendary-item\"){\n\n        if (bridgeDirect.ready){ // making sure that the bridge is active\n            bridgeDirect.sendMessage(e.source.name + \" used a legendary item\", \"Legendary News\")\n        }\n    }\n})\n```\n2. While another approach could be including your pack logic inside the bridgeInitialize event.\n```js\n// ...\nbridgeDirect.events.directInitialize.subscribe(()=\u003e{\n\n    world.afterEvents.itemUse.subscribe(e =\u003e {\n        if (e.itemStack.nameTag === \"legendary-item\") {\n            bridgeDirect.sendMessage(e.source.name + \" used a legendary item\", \"Legendary News\")\n        }\n    })\n    \n})\n```\n\nOf course which solution to use depends on the purpose of your pack.\nIf your pack wants to provide additional discord capabilities to a well pre-established in-game mechanic then it would make sense to use the first solution.\nIf you are developing a pack mostly focused on the discord connection then probably the second solution is preferable.\n\nIt is however advisable to handle the connection delay, or the possibility that BedrockBridge is not installed, by e.g. caching the messages untill the bridge is ready, or sending logs to the users if the connection hasn't been established for a long time (which means that there is something wrong). A typical setup delay would be 2-5 seconds.\n\n\u003e [!IMPORTANT]  \n\u003e BridgeDirect capabilities are not enabled by default on the *BedrockBridge* addon. They need to be enabled with a bridge-plugin.\n\u003e We created a dedicated release of the pack with such addition already enabled marked as `Direct`. Make sure to download the right version, or handle enabling direct-addition yourself.\n\n## Releasing your addon\nHere comes the sensitive part. This library is opensource. It can be used, copied, included in your addon and modified without restrictions.\nHowever it's not the same for BedrockBridge. You can add a link to [our download page](https://github.com/InnateAlpaca/BedrockBridge/releases) on your page.\n\n\n\u003e [!WARNING]  \n\u003e You cannot include BedrockBridge in your pack or add a direct download link to BedrockBridge.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesploratori-dev%2Fbedrock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesploratori-dev%2Fbedrock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesploratori-dev%2Fbedrock/lists"}