mojira.dev
MC-157796

All datapacks are reloaded when using /datapack enable xxx

All datapacks are reloaded when using /datapack enable xxx or /datapack disable xxx.

For example, as the attached file (two datapacks, named 'a' and 'b'), they both have a function named init (in different namespace), which just say a in the first init.mcfunction and say b in another. And they both have a 'minecraft:load' tag.

At first, use /reload. It gives

[Server] b
[Server] a

which is normal.

However, now use /datapack disable "file/a". It gives

[Server] b

which is weird, since I did not do anything about b.

Now, use /datapack enable "file/a". It gives

[Server] b
[Server] a

which is also unreasonable, since I still did not do anything about b.

 

My guess is that Minecraft reloads all datapacks when using /datapack enable xxx and /datapack disable xxx command.

Attachments

Comments 4

This behavior makes sense because of how datapacks can reference files that might be modified by other datapacks.

For example: Datapack A adds a tag that references the "minecraft:impermeable" tag and datapack B modifies the "minecraft:impermeable" tag. If datapack B is enabled/disabled, it makes sense to reload datapack A as well in order to make sure that the tag it added is properly updated.

Another example would be a datapack that functions as a "base" that other packs can expand upon. Such a pack might add an empty function tag that other datapacks can add their own functions to, then the base pack can still retain control over when that function tag is executed.

Minecraft should only reload each related file, without reloading all files.

That's simply not how things work, the entire registries must be realoaded, loading a new pack can add, change and remove entries (eg functions) and to do this, it needs all packs' information.

This is also how resource packs work since they've been implemented (in fact, it even happenswhen changing the selected language).

This is a change request, not a bug.

Closing as Works as Intended per @unknown's comment.

袁轶君

(Unassigned)

Confirmed

Commands, Data Packs

1.14.4, 1.15.1, 1.15.2, 20w12a

Retrieved