The rocketriders
Datapack
The rocketriders
datapack is the main brain of the game! (Besides the Selection armor stand, of course.) You can find it here on the Rocket Riders codebase.
A quick glance at the datapack will reveal that it is a massive, sprawling mess. (Well, so was the development of the game… art imitates life, or something like that.)
This page will attempt (keyword: attempt) to give a high level overview of the purposes and contents of each folder of the datapack, starting from the most basic and going up to the most advanced.
The functions and files themselves are all named after their respective purposes and commented to the best of our limited abilities as developers, so feel free to read into those more on your own time and see what you can gather!
minecraft
Folder
This might not be the simplest to explain, but it makes the most sense to start out with.
The minecraft
folder is used to define a #minecraft:tick
function tag with the function everytick:everytick
, and a #minecraft:load
function tag with the function custom:upon_load
. Minecraft is able to recognize these function tags and run the contained functions as specified.
The everytick:everytick
function is run every tick, as the name quite heavily implies, and is the source of all code execution (apart from advancements with function rewards, anyway) in the entire datapack. See everytick
Folder for more information.
The custom:upon_load
function, on the other hand, runs upon the world or datapacks reloading. For now, this simply resets the positions of the credits armor stands in the Lobby, but it has been a quite useful development tool for initializing scoreboard objectives and such.
On a slightly-less-relevant note, the minecraft
folder also contains a recipe override for repair_item
, which acts to disable the ability to repair items. This is a quick hackfix to prevent players from combining their Shooting Sabers or something and getting bows without enchantments.
custom
Folder
This folder contains the upon_load
function mentioned above, as well as any custom predicates and item/block tags used liberally by the game for various purposes (e.g. detecting players in the void, clearing player inventories, replacing any blocks that could have come from a missile during arena clears).
tutorial
Folder
This folder contains all the functions, advancements, and location predicates relating to the functionality of tutorial achievements.
lobby
Folder
This folder contains all the functions (plus one little loot table) for the credits armor stands, Missile Display Area, Parkour Area, Navigation Book, and pretty much any other interactive elements of the main Lobby.
gamemodes
Folder
This folder contains several functions that are crucial to the operation and integration of gamemode datapacks (yes, those exist) with other parts of the game.
modifiers
Folder
This folder contains all the functions necessary for modifiers to work, including what actually runs ingame when a modifier is active, selecting modifiers in the Modification Room, disabling all modifiers, and seeing information about each modifier.
achievements
Folder
This folder contains all the advancements and related functions used to reward custom achievements to players. The advancements themselves are split into several subfolders:
rr_challenges
, for the individual icons and descriptions of each achievementrr_easy
, for the root and end-row advancements for the Easy Achievements tabrr_medium
, for the root and end-row advancements for the Medium Achievements tabrr_hard
, for the root and end-row advancements for the Hard Achievements tabrr_utility
, for any advanced checks that can only be performed by advancement criteria (sometimes not even for achievements, but other things like Nova Rockets launching players)
The functions, on the other hand, are all grouped together. There is a function for each achievement that requires constant checks and a gain
function that makes each player in the game run all of those separate functions every tick.
There are also functions to dictate the conditions under which achievements may be rewarded at the end of the game, those being aftergame
, aftergameblue
and aftergameyellow
.
Some other functions exist there for the purpose of resetting all-time or per-round achievement progress (these may be run by operators; see Operator Functions). Also, any functions rewarded by utility advancements from the rr_utility
subfolder are included here.
items
Folder
This folder contains all the functions and loot tables used for giving items (see Item RNG) and spawning missiles (see Missile Spawning) in the base game.
There are also functions here for preventing item duplication, making modifiers like Surprise Egg, Wind Down, and Minute Mix work, and tracking where missiles have been spawned for the purposes of arena clearing.
game
Folder
This folder contains all the functions used to control game states and events like the countdown before the game starts, what happens during the game, and what happens when the game is ending, as well as giving players starter gear, controlling join pads, killing players in the void, and the like.
There are also functions (and an advancement) here used to determine whom to reward kill credit to when a player has been killed indirectly by a utility item such as a Nova Rocket or Vortex.
arenaclear
Folder
This folder contains all the functions used to clear the arena (see arena clearing for an in-depth look at how this works!), set down new bases with base decorations, and make the Modification Room functional as a whole.
From a top down view, think of the game
folder as accounting for about three quarters of the actual game loop (starting the game, playing the game, and ending the game) and the arenaclear
folder accounting for the last quarter (preparing a new game).
everytick
Folder
This folder generally contains all the functions that must run every tick (as the name implies), including the aforementioned everytick:everytick
function at the root of all code execution.
This is too broad to properly narrow down, but the most concrete examples are that all the functions for utilities are located in this folder, as well as anything for handling new players/relogs, preventing fall damage, preventing item dropping, and preventing players from entering the Nether through portals.
The everytick:general_settings_and_hotfixes
function is also used for many miscellaneous purporses driving certain functionalities of the Lobby, giving necessary effects/tags/scores to players, and ensuring some utilities work as intended.
Although this could easily be said for any of the last few sections, without this folder, the rest of the game just could not operate.