-
Notifications
You must be signed in to change notification settings - Fork 0
First Steps
Shiny Bunny edited this page Mar 6, 2021
·
3 revisions
So how does a DPScript work? Let's take a look at a simple example and explain what everything means and does.
load {
print "Datapack Loaded!"
}
tick {
print "This will spam your chat"
}
Here we have a very basic .dps file, with only 2 blocks: load and tick. If you are a little familiar with datapacks, these are the names of the only 2 vanilla function tags.
load basically runs the code inside whenever the world is first loaded, or when you run the command /reload.
This is where you'd want to setup things such as scoreboards for your datapack. In a bit we'll see this blocks in usually unnecessary thanks to other statements like objective, global, const etc.
tick however, runs the code inside every single game tick (20 times per second). So