Community listing page, reviews here may not be monitored by the author.
D Better Schedule
No reviews yet
A data pack library that provides a scheduler that keeps the context.
Community voices
Reviews
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
D's Better Schedule is a library that provides a scheduler that keeps the context. It will record the executor, location, rotation, and dimension of the current context. It also focuses on the behavior when the executor entity is offline, dead, or unloaded at the time of execution.
How to Use
To use the scheduler, first put the required data in storage dah.sch:new new. Fields:
run: #[command] string The command to run as a string. No slash. REQUIRED
time: int The number of ticks to wait before running the command. REQUIRED
offline: string
What to do if the target entity is not found at the time of execution (offline, dead, or unloaded). Defaults to discard:
discard: Do nothing and remove the task.delay: PLAYER ONLY The timer ticks when the player is offline, but only executes until the player go back onlinepause: PLAYER ONLY Timer freezes when the player is offline.by_server: The command will be executed by the server instead.
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.
flags: [string] Defines extra behaviors for the task. May includes:
no_executer: The executor will not be included in the context; the command will be run by server.location_less: The Location and Rotation will not be included in the context; command will be run at world spawndebug: Output debug information to chat.
in: #[id="dimension"] string If provided, override the context dimension with the given one.
Then execute function dah.sch:new in the desired context to schdule the command.
Example:
# teleport the executor back to the current loction after 1s.
data modify storage dah.sch:new new set value {run:"tp ~ ~ ~",time:20}
function dah.sch:new
# setblock stone at current location after 1s, spit out debug info.
data modify storage dah.sch:new new set value {run:"setblock ~ ~ ~ stone",time:20,flags:["debug"]}
function dah.sch:new
# Remove this player's attribute modifier after 10s. If the player goes offline in 10s then remove it after they log back in.
data modify storage dah.sch:new new set value {run:"attribute @s attack_damage modifier remove foo:bar",time:200,offline:"delay"}
function dah.sch:new
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:
function dah.sch:set {run:'say 1', time: 20}
Adding Known Dimensions
If the context dimension is not one of the vanilla ones, the library will summon a piglin brute and read the dimension out of its NBT. This causes more performance.
You may add a known dimension to the system by adding a function to the function tag #dah.sch:known_dimensions, running something likeexecute if predicate {type:"location_check",predicate:{dimension:"foo:bar"}} run data modify storage dah.sch:task this.in set value "foo:bar".
Dependency File
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.
Example content of the spyglass.json file. See Spyglass Documentation for more.
{
"env": {
"dependencies": [
"file:///C:/path/to/DBS-Dependency.zip",
"@vanilla-mcdoc",
"@vanilla-resourcepack",
"@vanilla-mcdoc"
],
"gameVersion": "26.3"
}
}
Remeber to Reload Vscode. If something about this somehow goes wrong, make Vs Code run the Spyglass: Reset Project Cahce command.
Compatibility
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.
Uninstall
Because of how this library is implemented, it is not possible to unload the datapack data while it is enabled.
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.
Links
A gu library is included to convert UUIDs
Repository: https://github.com/Dahesor/D-Better-Schedule
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers