CraftTweaker

CraftTweaker

151M Downloads

Load scripts from datapacks

dhouck opened this issue · 2 comments

commented

Describe the feature you'd like

Basically, what it says in the title. A lot has changed since #298 was rejected, and at this point it makes a lot more sense to load scripts from datapacks.

Describe alternatives you've considered

The current situation mostly works, but I donʼt think thereʼs a good alternative for the feature request which solves the same issues.

Additional context

I thought of this because Iʼm mostly writing a data pack, using the standard knowledge book recipe trick (since Iʼm targeting 1.20.1 not 1.20.6). But Iʼm mostly deploying the data pack on a modded server, where it would make sense to have a real recipe for the item I want.

(This makes sense for all Minecraft versions, although I in particular would most benefit if it came to 1.20.1).

Minecraft version

Other

Modloader

All

commented

standard knowledge book recipe trick
Could I get a link to what you are talking about, that isn't something I have heard before.

What problem would this actually be solving?

If implemented, it would come with several caveats that I feel would trip users up, such as potentially not being able to use the #loader tags loader, or any other loaders for that matter.

Scripts would still be ran only actually be ran when they are ran right now (for the normal loader), so really this would just be adding another source for scripts to be discovered?

commented

Could I get a link to what you are talking about, that isn't something I have heard before.

This is pretty much irrelevant when CT is installed; itʼs a standard trick for datapacks without mods.

Tangent about vanilla data packs In vanilla datapacks, you cannot add items, so you use other items with custom names and model data and such. But until 1.20.5, you couldnʼt use vanilla datapacks to add recipes for items with NBT, so you had to do a weird workaround: make a recipe for an unused item (traditionally a knowledge book), make an advancement for that recipe, and in that advancement run some commands to take away the unused item and give the custom-NBT item.

I canʼt find a good writeup about it, but itʼs fairly standard and covered in this video

What problem would this actually be solving?

Primarily:

  • Being in a per-world location instead of a per-instance location can be useful for various purposes (eg. distributing world downloads including custom scripts, working with other per-world differences)
  • Many other things are datapack-driven so this would allow consistency with other mods and other places that recipes are defined
  • (My use case) making a datapack which works in vanilla but with added functionality with CraftTweaker.

Scripts would still be ran only actually be ran when they are ran right now (for the normal loader), so really this would just be adding another source for scripts to be discovered?

Yes, exactly, but having another source for discovering scripts is itself useful.