{"id":53566,"date":"2026-06-03T03:01:49","date_gmt":"2026-06-03T00:01:49","guid":{"rendered":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/"},"modified":"2026-06-03T03:01:49","modified_gmt":"2026-06-03T00:01:49","slug":"d-better-schedule","status":"publish","type":"mod","link":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/","title":{"rendered":"D Better Schedule"},"content":{"rendered":"<p>[\u4e2d\u6587](\/readme\/zh_cn.md)<\/p>\n<p># Introduction<\/p>\n<p>D&#8217;s Better Schedule is a library that provides a scheduler that keeps the context.<br \/>\nIt will record the executor, location, rotation, and in some cases, dimension(see below) of the current context.<br \/>\nIt also focuses on the behavior when the executor entity is offline, dead, or unloaded at the time of execution.<\/p>\n<p>## How to Use<\/p>\n<p>**To use the scheduler, first put the required data in storage `dah.sch:new new`.** Fields:<\/p>\n<p>`run`: `#[command] string` The command to run as a string. No slash. ***REQUIRED***<\/p>\n<p>`time`: `int` The number of ticks to wait before running the command. ***REQUIRED***<\/p>\n<p>`offline`: `string`<br \/>\nWhat to do if the target entity is not found at the time of execution (offline, dead, or unloaded). Defaults to `discard`:<br \/>\n * `discard`: Do nothing and remove the task.<br \/>\n * `delay`: **PLAYER ONLY** The timer ticks when the player is offline, but only executes until the player go back online<br \/>\n * `pause`: **PLAYER ONLY** Timer freezes when the player is offline.<br \/>\n * `by_server`: The command will be executed by the server instead.<\/p>\n<p>`max_retry`: `int`  If `offline` is set to `discard` or `by_server`, then if entity is not found at execution time, the task will be re-attempted on the next tick, up to `max_retry` number of times. If all retries failed then it proceeds to be discarded or executed by server accroding to `offline`. Defaults to `0`.<\/p>\n<p>`flags`: `[string]` Defines extra behaviors for the task. May includes:<\/p>\n<p> * `no_executer`: The executor will not be included in the context; the command will be run by server.<br \/>\n * `location_less`: The Location and Rotation will not be included in the context; command will be run at world spawn<br \/>\n * `debug`: Output debug information to chat.<br \/>\n * `try_dimension`: It will try to find the current dimension. The library will read it from entity data if the executor is a player, or it trys if it is `overworld`, `the_nether` or `the_end`. Otherwise it assumes `overworld`. You may add other custom dimensions into the function tag `#dah.sch:known_dimensions`, running `execute at @s if predicate {condition:&#8221;location_check&#8221;,predicate:{dimension:&#8221;foo:bar&#8221;}} run data modify storage dah.sch:task this.in set value &#8220;foo:bar&#8221;` to extend the trial and error list.<\/p>\n<p>`in`: `#[id=&#8221;dimension&#8221;] string` Specifies a dimension to run the command in. This will be overwritten by the `try_dimension` flag.<\/p>\n<p>**Then execute `function dah.sch:new` in the desired context to schdule the command.**<\/p>\n<p>Example:<br \/>\n&#8220;`mcfunction<br \/>\n# teleport the executor back to the current loction after 1s.<br \/>\ndata modify storage dah.sch:new new set value {run:&#8221;tp ~ ~ ~&#8221;,time:20}<br \/>\nfunction dah.sch:new<\/p>\n<p># setblock stone at current location after 1s, try to find the current dimension and spit out debug info.<br \/>\ndata modify storage dah.sch:new new set value {run:&#8221;setblock ~ ~ ~ stone&#8221;,time:20,flags:[&#8220;debug&#8221;,&#8221;try_dimension&#8221;]}<br \/>\nfunction dah.sch:new<\/p>\n<p># Remove this player&#8217;s attribute modifier after 10s. If the player goes offline in 10s then remove it after they log back in.<br \/>\ndata modify storage dah.sch:new new set value {run:&#8221;attribute @s attack_damage modifier remove foo:bar&#8221;,time:200,offline:&#8221;delay&#8221;}<br \/>\nfunction dah.sch:new<br \/>\n&#8220;`<\/p>\n<p>A simple macro version of the schduler is also provided as `function dah.sch:set`. It can only take in the `time` and `run` parameter:<br \/>\n&#8220;`mcfunction<br \/>\nfunction dah.sch:set {run:&#8217;say 1&#8242;, time: 20}<br \/>\n&#8220;`<\/p>\n<p>## Dependency File<\/p>\n<p>A `DBS-Dependency.zip` is included in the release. Put this file anywhere on your computer, then by creating a `spyglass.json` file at the root of your workspace, the Spyglass extension will provides you the completion and error checking of all the functions, storages, and tags you need to write to use this library.<\/p>\n<p>Example content of the `spyglass.json` file. See Spyglass Documentation for more.<br \/>\n&#8220;`json<br \/>\n{<br \/>\n\t&#8220;env&#8221;: {<br \/>\n\t\t&#8220;dependencies&#8221;: [<br \/>\n\t\t\t&#8220;file:\/\/\/C:\/path\/to\/DBS-Dependency.zip&#8221;,<br \/>\n\t\t\t&#8220;@vanilla-mcdoc&#8221;,<br \/>\n\t\t\t&#8220;@vanilla-resourcepack&#8221;,<br \/>\n\t\t\t&#8220;@vanilla-mcdoc&#8221;<br \/>\n\t\t],<br \/>\n\t\t&#8220;gameVersion&#8221;: &#8220;1.21.5&#8221;<br \/>\n\t}<br \/>\n}<br \/>\n&#8220;`<br \/>\nRemeber to Reload Vscode. If something about this somehow goes wrong, make Vs Code run the `Spyglass: Reset Project Cahce` command.<\/p>\n<p>## Compatibility<\/p>\n<p>This library, by itself, overrides no vanilla namespaces, does not modify\/create\/remove any world elements (blocks, entities, etc.), and all ids have the `dah.sch` prefix or namespace. Yes, this makes it follows the Smithed and essential MC Datapacks Discord Server Conventions. There should be zero worries about its compatibility.<\/p>\n<p>## Uninstall<\/p>\n<p>Because of how this library is implemented, it is not possible to unload the datapack data while it is enabled.<\/p>\n<p>Thus, first remove the datapack, reload, then you may execute the commands listed in the `unload.mcfunction` file provided in the root folder to delete the remaining data. Follow the instructions in that file.<\/p>\n<p>## Links<\/p>\n<p>A gu library is included to convert UUIDs<\/p>\n<p>Repository: https:\/\/github.com\/Dahesor\/D-Better-Schedule<\/p>\n<p>Modrinth: https:\/\/modrinth.com\/project\/d-better-schedule<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A data pack library that provides a scheduler that keeps the context.<\/p>\n","protected":false},"featured_media":53567,"template":"","meta":{"_minecraft_slug":"d-better-schedule","_minecraft_project_id":"2WdgXp6p","_minecraft_author":"Dahesor","_minecraft_license":"MIT","_minecraft_downloads":46,"_minecraft_follows":1,"_minecraft_client_side":"optional","_minecraft_server_side":"required","_minecraft_storage_type":"zip","_minecraft_archive_name":"d-better-schedule.zip","_minecraft_size_bytes":51865,"_minecraft_version_count":3,"_minecraft_updated_at":"2026-05-15T23:27:42.251386Z","_minecraft_date_created":"2025-05-08T00:37:58.763200Z","_minecraft_date_modified":"2026-02-04T02:52:47.148451Z","_minecraft_project_url":"https:\/\/modrinth.com\/mod\/d-better-schedule","_minecraft_icon_attachment_id":53567,"_minecraft_imported_at":"2026-06-03T00:01:50+00:00","_minecraft_import_hash":"06b48fefadf122a2aa245a584200c4bc","_minecraft_versions":"","_minecraft_links":"","_minecraft_gallery":"","_minecraft_api_metadata":""},"mod_category":[84,873],"mod_loader":[86],"minecraft_version":[62,37,40,41,808,809,810,811,812,73,71,72,74,38,78,79,80,81,82,63,64,65,66,67,68,69,70,75,76,77,816,817,818,819,820,821],"class_list":["post-53566","mod","type-mod","status-publish","has-post-thumbnail","hentry","mod_category-datapack","mod_category-library","mod_loader-datapack","minecraft_version-1-21","minecraft_version-1-21-1","minecraft_version-1-21-10","minecraft_version-1-21-11","minecraft_version-1-21-11-pre1","minecraft_version-1-21-11-pre2","minecraft_version-1-21-11-pre3","minecraft_version-1-21-11-pre4","minecraft_version-1-21-11-pre5","minecraft_version-1-21-2","minecraft_version-1-21-2-pre1","minecraft_version-1-21-2-pre2","minecraft_version-1-21-3","minecraft_version-1-21-4","minecraft_version-1-21-5","minecraft_version-1-21-6","minecraft_version-1-21-7","minecraft_version-1-21-8","minecraft_version-1-21-9","minecraft_version-24w33a","minecraft_version-24w34a","minecraft_version-24w35a","minecraft_version-24w36a","minecraft_version-24w37a","minecraft_version-24w38a","minecraft_version-24w39a","minecraft_version-24w40a","minecraft_version-24w44a","minecraft_version-24w45a","minecraft_version-24w46a","minecraft_version-26-1-snapshot-1","minecraft_version-26-1-snapshot-2","minecraft_version-26-1-snapshot-3","minecraft_version-26-1-snapshot-4","minecraft_version-26-1-snapshot-5","minecraft_version-26-1-snapshot-6"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>D Better Schedule - Minecraft<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"D Better Schedule - Minecraft\" \/>\n<meta property=\"og:description\" content=\"A data pack library that provides a scheduler that keeps the context.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/\" \/>\n<meta property=\"og:site_name\" content=\"Minecraft\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/d-better-schedule\\\/\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/d-better-schedule\\\/\",\"name\":\"D Better Schedule - Minecraft\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/d-better-schedule\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/d-better-schedule\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/d-better-schedule-icon-33d407b4faf580a8291910baeeb5f996179db7de_96.webp\",\"datePublished\":\"2026-06-03T00:01:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/d-better-schedule\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/d-better-schedule\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/d-better-schedule\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/d-better-schedule-icon-33d407b4faf580a8291910baeeb5f996179db7de_96.webp\",\"contentUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/d-better-schedule-icon-33d407b4faf580a8291910baeeb5f996179db7de_96.webp\",\"width\":96,\"height\":96},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/d-better-schedule\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mods\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"D Better Schedule\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\",\"name\":\"Minecraft\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"D Better Schedule - Minecraft","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/","og_locale":"en_US","og_type":"article","og_title":"D Better Schedule - Minecraft","og_description":"A data pack library that provides a scheduler that keeps the context.","og_url":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/","og_site_name":"Minecraft","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/","url":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/","name":"D Better Schedule - Minecraft","isPartOf":{"@id":"https:\/\/vpesports.com\/minecraft\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/#primaryimage"},"image":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/#primaryimage"},"thumbnailUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/d-better-schedule-icon-33d407b4faf580a8291910baeeb5f996179db7de_96.webp","datePublished":"2026-06-03T00:01:49+00:00","breadcrumb":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/#primaryimage","url":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/d-better-schedule-icon-33d407b4faf580a8291910baeeb5f996179db7de_96.webp","contentUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/d-better-schedule-icon-33d407b4faf580a8291910baeeb5f996179db7de_96.webp","width":96,"height":96},{"@type":"BreadcrumbList","@id":"https:\/\/vpesports.com\/minecraft\/mods\/d-better-schedule\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vpesports.com\/minecraft\/"},{"@type":"ListItem","position":2,"name":"Mods","item":"https:\/\/vpesports.com\/minecraft\/mods\/"},{"@type":"ListItem","position":3,"name":"D Better Schedule"}]},{"@type":"WebSite","@id":"https:\/\/vpesports.com\/minecraft\/#website","url":"https:\/\/vpesports.com\/minecraft\/","name":"Minecraft","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vpesports.com\/minecraft\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod\/53566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod"}],"about":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/types\/mod"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media\/53567"}],"wp:attachment":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media?parent=53566"}],"wp:term":[{"taxonomy":"mod_category","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_category?post=53566"},{"taxonomy":"mod_loader","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_loader?post=53566"},{"taxonomy":"minecraft_version","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/minecraft_version?post=53566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}