5

Datapacks vs Add-Ons

Garfieldwxg55's Avatar Garfieldwxg558/4/20 11:41 pm
5 emeralds 3.1k 17
6/7/2021 7:01 pm
One_Nose's Avatar One_Nose
Hello there,
I am a Java player, which means I have access to custom Modding APIs such as Forge and Fabric. These are able to most drastically change the game, and can create such memorable experiences such as the Aether and Twilight Forest mods. Sadly, since these APIs are player run, this means that mods need to be updated from version to version, which can create inconvenient delays. Many mods even are still on 1.12! I have heard of something resembling a offical modding API on the Bedrock version, known as Add-ons. However, add-ons remind me more of datapacks for the Java edition, both changing the game in small ways using the datapacks/add-on itself, and often an accompanying resource pack. How do these two “offical mods” compare, assuming that the Java user is using Optifine, allowing custom mob textures and models through the use of a resource pack? Do add-ons win out? If so, by how much? Or do datapacks provide a comparable experience for Java?
Any feedback is appreciated!
Posted by Garfieldwxg55's Avatar
Garfieldwxg55
Level 2 : Apprentice Miner
1

Create an account or sign in to comment.

17

6
09/21/2020 9:05 am
Level 67 : High Grandmaster Botanist
Hashs
Hashs's Avatar
I'm a datapack creator; datapacks have much larger potential to add fully new content than add-ons. They're also good for small tweaks, of course, but huge content datapacks that add hundreds of items are not unheard of.
2
09/21/2020 8:37 am
Level 9 : Apprentice Goblin
MASTRIO
MASTRIO's Avatar
You can't really compare them because their for different versions of the game,
but I prefer datapacks
2
08/06/2020 11:44 am
Level 51 : Grandmaster Dragonborn
vinnyg0621
vinnyg0621's Avatar
"on" is'nt capitalized in "add-on"
8
08/06/2020 8:01 amhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
IMPORTANT NOTE: None of the code or technical syntax is tested/legit. They're just for illustrative purposes.

As you said, add-ons are BE, while data packs are JE.
As far as I know, custom models and textures are in external resource/texture packs for both of them, so let's leave them out of the question and focus on purely mechanics:

Add-ons are purely definition style (like HTML/CSS/CSV/JSON/XML). All data is defined in JSON and a new entity for example will only be a composition of traits. It's like the vanilla behaviour is exploded into a bunch of pieces and you can combine any of those elements into new compositions. There is no logic involved like you would expect with Mods, just never-before-seen combining of existing elements.

Datapack behaviour is defined through functions, which are files listing commands. It's comparable to functional programming like JS (okay, not really, what I'm trying to say is that it's not JUST a definition like JSON, HTML or XML). It's actual code with some (limited) logic. Of course there are still definition files, for recipes, advancements, loot tables, etc. But the actual behaviour is mostly implemented using commands. This makes it a little more difficult to make an entity "behave", but you have way more flexibility. Functions are not event-driven, besides the minecraft:tick tag that causes functions to run 20 times a second. The actual logic and behaviour comes from carefully filtering out entities in commands. Also functions can call other functions.

As a comparison, making a pig explode in an add-on would likely just require you to add something like "entity.explode" into a JSON array or object and that's it. Whereas with functions it looks like a command:
execute as @e[​type=pig] at @s if entity @a[​distance=..4] run function bertiecrafter:pig_explode/explode
And with explode.mcfunction containing:
summon tnt ~ ~ ~ {Fuse:0s}
kill @s

As you can see, the "execute" command is fired 20 times a second for each pig, only if there is an entity that matches the selector "@a[​distance=..4]" (which translates to "all players within 4 blocks").

Bonus, mod vs data pack: A mod would use a simple for loop (java code) instead of running a command 20 times per second as long as an arbitrary timer score is not 0. A mod would also be able to store entities in variables, making it super efficient to target the entity for a second time later on. A datapack would have to keep checking 20 times a second if all conditions pass and then take all entities and apply the same filter again to get to the same entity. Also the mod API is bigger than what can be achieved using minecraft commands. This doesn't mean that data packs can't create awesome things (browse PMC), it's just that sometimes you'd have to get creative to find solutions.

So final comparison:


Add-On
(AKA "Bedrock Mods" on PMC)
Data packMod
PlatformBedrock EditionJava EditionJava Edition
Creation styleDefinition using JSON
modules:["entity.creeper.explode"]
Limited functional programming
function folder/do_something
Full object oriented programming
entity.jump();
player.selectSlot(1);
ActivationOn-load, perhaps there are ways to define filters for behaviourMainly every tick (1/20th of a second), filtered by selectors.Event-driven. Filtered by if/else blocks, earlier defined variables and scopes.
ProsEasy to get into for non-programmers.Officially supported.
Quick updates.
Once you know what you're doing, not all that limited.
Efficiënt if you code it well.
Almost anything is possible.
ConsTerrible documentation
Very limited in capabilities

- Requires creative thinking and some experiementing to get the hang of it.
- Can be difficult for non-programmers and programmers who never worked with animation loops or any other kind of timer-based activation.
Guaranteed to break every update.
Requires basic Java programming knowledge which is a steep learning curve for non-programmers.
Also requires separate IDE.
2
08/06/2020 10:03 am
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
I don't see the relation between HTML and JSON.
3
08/06/2020 10:31 am
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
They're just more examples of definition based syntax, compared to JS/C#/Java which are programming languages. JSON and HTML themselves have nothing in common.
4
08/06/2020 10:20 pm
Level 2 : Apprentice Miner
Garfieldwxg55
Garfieldwxg55's Avatar
Hmm, interesting, ima gonna pretend I know what all that meant
5
08/05/2020 2:47 am
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
First at all, mods are not official. As you said they require third-party APIs like Forge or Fabric. I think there are also mod providers for bedrock edition, but they are a lot less powerful, because C++ is a lot less compatible for such things than Java. Data packs and addons are official, and they are really a bit similar. Add-ons allow you to change things that data packs cannot like mobs AI, but they totally don't win. Because in data packs you can make functions tick, and with that you can literally tell the game what to do. Not just "explode when entity in range" but add whole mechanics. Also in Java there was the amazing 1.13 that made commands a LOT more powerful and better. Add-ons: I can change that pig! Data packs: I CAN CHANGE THE WORLD.
3
06/07/2021 2:00 am
Level 8 : Apprentice Miner
Drakio-X
Drakio-X's Avatar
Datapacks are based in minecraft commands to be coded, how add-ons are coded?
3
06/07/2021 4:29 am
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
Look at BertieCrafter's message
3
06/07/2021 12:28 pm
Level 8 : Apprentice Miner
Drakio-X
Drakio-X's Avatar
mmm ok, I didnt understand so good.
4
06/07/2021 7:01 pm
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
In add-ons, you simply have many options and you can combine them together to create something. It means you can take basic properties and combine them together together to make something new that consists on smaller features. In data packs, you have flexibility to do basically whatever you want (at least in compare to add-ons). In add-ons, to make a pig explode you need to say "pig: explode". In data packs, you say "cause (all pigs) to (explode) in xyz (where they are) if (there is a (player) in xyz (in distance of (5) blocks))". It's longer, but there are so many parameters you can modify it becomes actual coding, rather than simple "pig - abilities: (explode, jump high, whatever)".
3
08/05/2020 9:36 pm
Level 2 : Apprentice Miner
Garfieldwxg55
Garfieldwxg55's Avatar
hmm, good point, maybe someday they'll allow us to change mob AI as well. I mean they just added custom dimensions to data packs, so who knows!
3
08/06/2020 6:06 am
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
There are many chances you're right. Mojang are currently trying to add many features from Bedrock to Java. I expect to see it before 2.0.
2
08/06/2020 10:19 pm
Level 2 : Apprentice Miner
Garfieldwxg55
Garfieldwxg55's Avatar
Java 2.0? Will that ever happen? Or do you mean 1.20?
3
08/06/2020 11:38 pm
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
Minecraft 2.0. If you think logically it should get out somewhen, but the real question is whethere Mojang (studios) thinks logically. I mean, who stays 1.X for 16 large updates? The last version should have been 16.0, not 1.16.
3
08/07/2020 2:16 am
Level 2 : Apprentice Miner
Garfieldwxg55
Garfieldwxg55's Avatar
yeah, maybe, Mojang might just keep going 1.X for the foreseeable future, since its what people recognise. maybe someday they'll release 2.0, which will probably generate a lot of buzz.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome