Creating Addon Origin Guide - FlamingTaco113/origins-datapack GitHub Wiki
In versions v1.1.8+, Addon Origins are now available to add into the game
This page will act as a guide and resource on how to create and properly implement addon origins into the game
Below is an example of a Vampire addon Origin that I created using this method, feel free to download for a reference or to just try it out!
origins-datapack-vampire-addon-v1.1.8.zip
GETTING STARTED
Linked below is a template addon pack which you will need to download.
CLICK HERE TO DOWNLOAD TEMPLATE ADDON PACK
While not required, it is highly recommended that you download Microsoft's Visual Studio Code in order to manage your files.
DOWNLOADED TEMPLATE
Once downloaded, you will need to unzip the file to begin editing it. It should look like this:
addon_template
origins-datapack-v1.1.8
addon_lists.txt
We will come back to the addon_lists.txt
later.
Next, open the origins-datapack-v1.1.8
(or whatever the current version is) folder, and when opened, you will see this file structure:
origins-addon-pack-v1.1.8/
โโโ pack.mcmeta
โโโ pack.png
โโโ data/
โโโ origins_addon_originname/
โโโ advancement/
โ โโโ origins/
โ โโโ originname.json
โโโ function/
โโโ reset_origin.mcfunction
โโโ choose_origin/
โ โโโ check_picked.mcfunction
โ โโโ enable_picks.mcfunction
โ โโโ set_origin.mcfunction
โโโ origins/
โ โโโ addon_origin_code/
โ โโโ base.mcfunction
โโโ player/
โ โโโ as_player.mcfunction
โ โโโ player_technical.mcfunction
โโโ technical/
โโโ list.mcfunction
โโโ load.mcfunction
โโโ tick.mcfunction
IMPORTANT
While working, replace every instance author
with your username (in lowercase, with no numbers or special characters), originname
with the namespace of your
origin (in lowercase, with no numbers or special characters) , while replacing <ADDON ORIGIN DISPLAY NAME>
with the display name of your origin, for example, if you had an origin called Flying Creeper:
author --> flamingtaco
originname --> flying_creeper
<ADDON ORIGIN DISPLAY NAME> --> Flying Creeper
This not only applies to lines of code, but also folders and files such as originname.json
found in the advancements folder and even the origins_addon_originname
folder.
Using our Flying Creeper example from earlier:
originname.json --> flying_creeper.json
origins_addon_originname --> origins_addon_flying_creeper
NOTE: WE WILL BE USING THE CUSTOM ORIGIN NAME FLYING CREEPER AS OUR EXAMPLE FOR THIS TUTORIAL
Now lets explain what each of these files do, and what you need to do to get your custom origin to work
pack.mcmeta
Navigate to
origins-addon-pack-v1.1.8/
โโโ pack.mcmeta
โโโ pack.png
Luckily this is right at the beginning of the data pack, so it should not be too hard to find!
The only thing we will go into here is the pack.mcmeta
file which should look like this when opened
{
"pack": {
"pack_format": 71,
"supported_formats": [71, 71],
"description": "ยง6[ORIGINS ADDON]\nยงe<ADDON ORIGIN NAME> by author"
}
}
Replace the datapack version with the current pack_format for the Minecraft version you are working for, which can be found here
Replace the with the name of your addon pack, and replace author with your username.
ADVANCEMENT
Navigate to
origins-addon-pack-v1.1.8/
โโโ data/
โโโ origins_addon_originname/
โโโ advancement/
โโโ origins/
โโโ originname.json
we will begin by writing our root advancement for our custom origin. This is the advancement granted to specific origins upon choosing their Origin on the Origins pick screen.
Opening, the JSON file, you will be met with this:
{
"display": {
"title": {
"text": "<ADDON ORIGIN DISPLAY NAME>"
},
"description": {
"text": "Add a description for your addon origin here!"
},
"icon": {
"id": "minecraft:barrier"
},
"frame": "task",
"show_toast": true,
"announce_to_chat": true,
"hidden": false
},
"criteria": {
"c1": {
"trigger": "minecraft:impossible"
}
},
"parent": "origins:origins/root"
}
Here, we see our first instance of , which you will replace.
"text": "<ADDON ORIGIN DISPLAY NAME>" --> "text": "Flying Creeper"
Changing the icon is also simple, just by making it any Minecraft item in the game, for this example:
"id": "minecraft:barrier" --> "id": "minecraft:creeper_head"
The rest is pretty self explanatory, for example, replace the description with a description of your Origin, or if you want to be like the original data pack, a mysterious comparison!
This is what our file looks like once complete!
{
"display": {
"title": {
"text": "Flying Creeper"
},
"description": {
"text": "KaBoom!"
},
"icon": {
"id": "minecraft:creeper_head"
},
"frame": "task",
"show_toast": true,
"announce_to_chat": true,
"hidden": false
},
"criteria": {
"c1": {
"trigger": "minecraft:impossible"
}
},
"parent": "origins:origins/root"
}
NOTE: For more complex origins, you may want to use custom advancements to trigger certain functions. These go directly into the advancements folder
origins-addon-pack-v1.1.8/
โโโ data/
โโโ origins_addon_originname/
โโโ advancement/
FUNCTIONS
This section will go over the functions folder Luckily, you do not require much knowledge about Minecraft's language MCFUNCTION, and most of this will just be renaming things!
choose_origin
Navigate to
origins-addon-pack-v1.1.8/
โโโ data/
โโโ origins_addon_originname/
โโโ function/
โโโ choose_origin/
โโโ check_picked.mcfunction
โโโ enable_picks.mcfunction
โโโ set_origin.mcfunction
check_picked.mcfunction
Opening the file
execute if score @s zzauthor.originname_p matches 1.. run function origins_addon_originname:choose_origin/set_origin
Seeing our first instance of author
, we need to replace both author
and originname
throughout the entire file. Hopefully you do not get tired of this, as it will take up much of this guide.
execute if score @s zzflamingtaco.flying_creeper_p matches 1.. run function origins_addon_flying_creeper:choose_origin/set_origin
And that is it! Just replace your author
and originname
enable_picks.mcfunction
Opening the file
scoreboard players enable @s zzauthor.originname_p
And more replacing
scoreboard players enable @s zzflamingtaco.flying_creeper_p
set_origin.mcfunction
Opening the file
tag @s add author.originname
scoreboard players set @s picked 1
scoreboard players reset @s pick_origin
function origins:choose_origin/disable_picks
scoreboard players set @s zzauthor.originname_p 0
tellraw @s {"text":"--------------------------------------------------","color":"gold"}
tellraw @s {"text":"You selected <Origin Display Name>","color":"white"}
tellraw @s {"text":"Contact the server admin if you wish to change your origin","color":"gold"}
tellraw @s {"text":"--------------------------------------------------","color":"gold"}
advancement grant @s only origins:origins/root
advancement grant @s only origins_addon_originname:origins/originname
title @s title {"text":"<Origin Display Name>","color":"white"}
This file's purpose is to set the players Origin to your custom origin when they select it on the origin selection screen.
As well, you can change the color of the text of your origin listed Origin to be by changing white
with your preferred color. You can pick from any of the colors here.
And like everything else, more replacing!
tag @s add flamingtaco.flying_creeper
scoreboard players set @s picked 1
scoreboard players reset @s pick_origin
function origins:choose_origin/disable_picks
scoreboard players set @s flamingtaco.flying_creeper_p 0
tellraw @s {"text":"--------------------------------------------------","color":"gold"}
tellraw @s {"text":"You selected Flying Creeper","color":"green"}
tellraw @s {"text":"Contact the server admin if you wish to change your origin","color":"gold"}
tellraw @s {"text":"--------------------------------------------------","color":"gold"}
advancement grant @s only origins:origins/root
advancement grant @s only origins_addon_flying_creeper:origins/flying_creeper
title @s title {"text":"Flying Creeper","color":"green"}
player
Navigate to
origins-addon-pack-v1.1.8/
โโโ data/
โโโ origins_addon_originname/
โโโ function/
โโโ player/
โโโ as_player.mcfunction
โโโ player_technical.mcfunction
as_player.mcfunction
Opening the file
execute as @a run function origins_addon_originname:player/player_technical
to
execute as @a run function origins_addon_flying_creeper:player/player_technical
player_technical.mcfunction
Opening the file
execute if score @s picked matches 0 run function origins_addon_originname:choose_origin/enable_picks
execute if score @s picked matches 0 run function origins_addon_originname:choose_origin/check_picked
execute as @a[tag=author.originname] run function origins_addon_originname:origins/addon_origin_code/base
to
execute if score @s picked matches 0 run function origins_addon_flying_creeper:choose_origin/enable_picks
execute if score @s picked matches 0 run function origins_addon_flying_creeper:choose_origin/check_picked
execute as @a[tag=flamingtaco.flying_creeper] run function origins_addon_flying_creeper:origins/addon_origin_code/base
technical
Navigate to
origins-addon-pack-v1.1.8/
โโโ data/
โโโ origins_addon_originname/
โโโ function/
โโโ technical/
โโโ list.mcfunction
โโโ load.mcfunction
โโโ tick.mcfunction
list.mcfunction
This function is responsible for making sure your Origin appears when the /trigger pick_origin
command is used.
Opening the file
tellraw @s {"click_event":{"action":"run_command","command":"/trigger zzauthor.originname_p"},"color":"dark_gray","hover_event":{"action":"show_text","value":[{"text":"[ADD SHORT DESCRIPTION OF ORIGIN ABILITIES] [AND SEPERATE THEM IN BRACKETS]"}]},"italic":false,"text":"<ADDON ORIGIN DISPLAY NAME>"}
Now while most of this is just replacing again, you will see the [ADD SHORT DESCRIPTION OF ORIGIN ABILITIES] [AND SEPERATE THEM IN BRACKETS]
which is pretty self explanatory, and just make sure to keep it between the brackets.
As well, you can change the color of the text of your origin listed Origin to be by changing white
with your preferred color. You can pick from any of the colors here.
tellraw @s {"click_event":{"action":"run_command","command":"/trigger zzauthor.originname_p"},"color":"green","hover_event":{"action":"show_text","value":[{"text":"[Health reduced to 8 Hearts] [Explode] [Fly]"}]},"italic":false,"text":"Flying Creeper"}
load.mcfunction
This is as your load function and will only run if the base Origins Datapack is installed
This can be used to add scoreboards that you might need relating to your custom origin. These should be formatted as
author.originname.<name of scoreboard>
For example
author.originname.<name of scoreboard> --> flamingtaco.flying_creeper.explosion_timer
However, if you are not making anything that complicated, then you do not need to do anything besides more replacing. Opening the file
scoreboard objectives add zzauthor.originname_p trigger
to
scoreboard objectives add zzflamingtaco.flying_creeper_p trigger
tick.mcfunction
Just like the tick file, all of your ticking functions will go in here
Opening the file
function origins_addon_originname:player/as_player
to
function origins_addon_flying_creeper:player/as_player
origins\addon_origin_code
Navigate to
origins-addon-pack-v1.1.8/
โโโ pack.mcmeta
โโโ pack.png
โโโ data/
โโโ origins_addon_originname/
โโโ function/
โโโ origins/
โโโ addon_origin_code/
โโโ base.mcfunction
Now it is important to keep all the MCFUNCTION files that you create in the addon_origin_code
folder, and that they are only called or activated by base.mcfunction
base.mcfunction
This is where majority of the code of your custom origin will be! There is no real guide as to how to approach this, as there is almost unlimited possibilities as to what you can do here. However, if you want to create a very simple origin, then it is recommended that you use attribute modifiers, as it allows you to modify player speed, player gravity, player health, player size, etc.
Luckily the base.mcfunction
file includes an example as to what you can do!
Opening the file
# THIS IS WHERE YOU ADD ALL TICKING CODE RELATING TO YOUR ORIGIN
# FEEL FREE TO MAKE OTHER MCFUNCTION FILES AS LONG AS THEY STAY
# IN THE addon_origin_code FOLDER
# BELOW SHOWS AN EXAMPLE OF WHAT A CUSTOM ORIGIN COULD DO
# IMPORTANT: MAKE SURE TO ADD RESET CODE TO YOUR reset_origin.mcfunction
# ESPECIALLY FOR RESETING CHANGED ATTRIBUTES
attribute @s max_health base set 16 # This will set the amount of hearts the player has to 8 (number / 2)
attribute @s movement_speed base set 0.15 # Increases the players movement speed (base is around ~0.1)
This is left up to the creativity of you!
resetorigin.mcfunction
Navigate to
origins-addon-pack-v1.1.8/
โโโ data/
โโโ origins_addon_originname/
โโโ function/
โโโ reset_origin.mcfunction
and opening reset_origin.mcfuncton
you will be met with this:
tag @s remove author.originname
scoreboard players set @s zzauthor.originname_p 0
IMPORTANT
It is very important that you reset all the attributes that you changed with your origin here. Looking at the example base.mcfunction
, we can see that we changed the player's health and movement speed. It is INCREDIBLY IMPORTANT that we reset these values when the player's Origin is reset.
Modifying our reset.mcfunction
to match the example base.mcfunction
, (as well as replacing author
and originname
) we get
tag @s remove flamingtaco.flying_creeper
attribute @s minecraft:max_health base reset
attribute @s minecraft:movement_speed base reset
scoreboard players set @s zzflamingtaco.flying_creeper_p 0
This concludes the addon folder portion of this guide./ Next, we will be moving on to a very important step to ensure that the origins datapack recognizes your addon.
ADDON LIST FILES
The Origins Datapack (downloaded here) requires that you add certain lines of code to ensure that your addon is recognized by the data pack. This step requires people to copy and paste lines of code into certain files found within the data pack.
First, navigate to addons
in the Origins Datapack
origins-datapack-v1.1.8/
โโโ origins/
โโโ function/
โโโ addons/
โโโ addon_origins_list_list.mcfunction
โโโ disable_picks_list.mcfunction
โโโ load_list.mcfunction
โโโ reset_list.mcfunction
โโโ tick_list.mcfunction
Open the txt list from earlier, as this is where the people downloading your addon will go to set up your addon. Inside should look something like this
################################################################################
# THIS ADDON IS FOR VERSION:v1.1.8 #
# NAVIGATE TO THE ORIGINS DATAPACK FILES IN YOUR WORLD, INTO THE ADDONS FOLDER #
# data\origins\function\addons #
################################################################################
# COPY AND PASTE THE BELOW LINE INTO addons_origins_list_list.mcfunction
function origins_addon_originname:technical/list
# COPY AND PASTE THE BELOW LINE INTO disable_picks_list.mcfunction
trigger zzauthor.originname_p add 0
# COPY AND PASTE THE BELOW LINE INTO load_list.mcfunction
function origins_addon_originname:technical/load
# COPY AND PASTE THE BELOW LINE INTO reset_list.mcfunction
function origins_addon_originname:reset_origin
# COPY AND PASTE THE BELOW LINE INTO tick_list.mcfunction
function origins_addon_originname:technical/tick
First, replace the version at the top with whatever the current version of the Origins Datapack is, as this will let players who downloaded your addon know if it is compatible with the same version they are using.
Next, we need to add the lines of code that need to be copy and pasted into the addon files in the Origins Datapack datapack
Lucky for us, this is just more replacing author
and originname
Using our Flying Creeper example
################################################################################
# THIS ADDON IS FOR VERSION:v1.1.8 #
# NAVIGATE TO THE ORIGINS DATAPACK FILES IN YOUR WORLD, INTO THE ADDONS FOLDER #
# data\origins\function\addons #
################################################################################
# COPY AND PASTE THE BELOW LINE INTO addons_origins_list_list.mcfunction
function origins_addon_flying_creeper:technical/list
# COPY AND PASTE THE BELOW LINE INTO disable_picks_list.mcfunction
trigger zzflamingtaco113.flying_creeper_p add 0
# COPY AND PASTE THE BELOW LINE INTO load_list.mcfunction
function origins_addon_flying_creeper:technical/load
# COPY AND PASTE THE BELOW LINE INTO reset_list.mcfunction
function origins_addon_flying_creeper:reset_origin
# COPY AND PASTE THE BELOW LINE INTO tick_list.mcfunction
function origins_addon_flying_creeper:technical/tick
Save the text file and you are done!
Testing your addon is as simple as copying and pasting the lines from the addon_lists.txt
where it tells you to in the Origins Datapack!
When you are ready to upload your creation, make sure that you zip everything up properly.
ZIP GUIDE
Go into your origins-addon-pack-v1.1.8
, where you will see:
origins-addon-pack-v1.1.8/
โโโ data
โโโ pack.mcmeta
โโโ pack.png
Select data
, pack.mcmeta
, and pack.png
, and right click them. You will see an option to 'send to' and then Compressed (zipped) folder, which you will select. Then rename your newly created zip file in the format of origins-datapack-addon-pack-originnname-v(version)
.
Then, repeat the same process, zipping the addon_lists.txt together with the newly created zip file, using the name format
of origins-datapack-originname-addon-v(version)
.
This will be what you upload when you go to share your project!