Skip to content

Creating custom DLC

Zakru edited this page Sep 1, 2018 · 1 revision

Creating custom DLC

Custom DLC can be created to improve or diversify the gameplay of Minecraft Battle Royale.

Initializing the DLC datapack

Every DLC needs its own datapack (putting stuff into the battleroyale datapack is unsafe and considered modding) and should have a name of battleroyale_[dlc_name] where [dlc_name] is replaced with the DLC's name with preferably only lower case letters a-z, numbers and underscores, but any name is fine.

For people who are new to datapacks: (If you cannot understand this tutorial, this stuff is probably not for you.) A datapack (I recommend reading the Minecraft Wiki article) is a folder whose name is the datapack's name. A datapack's root directory has a file called pack.mcmeta which has JSON data as follows:

{
    "pack_format": 0,
    "description": "A description of this datapack"
}

Also inside the datapack folder is another folder, data. This contains all the data in your pack, under their own respective namespace folders (e.g. minecraft as in the block ID minecraft:stone and battleroyale as in the function battleroyale:start). If you didn't use only a-z, numbers and underscores in your datapack name, now is the time for that. Your namespace should be something like battleroyale_structures. For the rest of the information, please read the article mentioned above before asking any questions. Datapack introduction ends. If you skipped the introduction, your main namespace should be battleroyale_ and a name consisting of letters from a-z, numbers and underscores, preferably your datapack name.

What to put in the datapack

Whatever you want! Excluding functions, you are free to add whatever you want in your DLC. But when it's time to do the functionality, there are some things you should remember to do it correctly.

For things that should happen every tick in-game, the functions should be tagged with #battleroyale:dlc_tick for them to only be run when they should. Functions that should be run only once when the game is about to start should be tagged with #battleroyale:dlc_prepare. #minecraft:tick and #minecraft:load should never be used unless you know exactly what you are doing.

If your DLC needs more than one tick to prepare its stuff, don't worry. Use the following command to indicate that there is a DLC that needs to prepare for a bit longer:

scoreboard players add prepare_waiting value 1

This will make the actual beginning wait until prepare_waiting is 0. Every tick it is more than 0, #battleroyale:dlc_prepare_tick is called. Once your preparation is complete, call

scoreboard players remove prepare_waiting value 1

to mark that your DLC's preparation is done. Remember, though, that you may only call it once, but dlc_prepare_tick will keep running every tick. If you remove more than one from prepare_waiting, other DLCs may not be able to finish their preparations and will be unusable.

Home page

Content creation guidelines:

Clone this wiki locally