CraftTweaker

CraftTweaker

151M Downloads

[Suggestion] [1.12] File access and custom commands

ParzivalWolfram opened this issue ยท 1 comments

commented

Describe the feature you'd like

I am using CraftTweaker to make multiple modpacks, and I would like to see the following features added to CT:

  • File read/write. Importing standard Java libraries doesn't seem to work in CT, so accessing files arbitrarily doesn't seem to be possible as of now. This would be useful for (re)configuring scripts and mods, interacting with sockets or devices, custom asset management, etc.
  • Custom commands. This is a pretty basic feature, as it would allow for easier configuration of scripts, triggering of various events for server admins or players, and debugging tools.

As of now, just having the ability to configure things via file access and debug things with custom commands would speed up my workflow tenfold.

Describe alternatives you've considered

There aren't alternatives to file access for the given example uses, and while you can hook into commands that already exist, this is mostly useless aside from restricting commands to certain contexts or users.

Additional context

No response

Minecraft version

1.12

Modloader

All

commented

File read/write. Importing standard Java libraries doesn't seem to work in CT, so accessing files arbitrarily doesn't seem to be possible as of now. This would be useful for (re)configuring scripts and mods, interacting with sockets or devices, custom asset management, etc.

On all versions besides 1.12, scripts are synced from the client, I do not feel comfortable allowing servers to modify arbitrary files, send http requests or anything else on the client, that is just asking for a bad time.

Similarly, I do not feel comfortable allowing modpack authors to do the same, people don't look at scripts before they run modpacks, and I do not want my mod to be used as an injection point for malware.

Custom commands. This is a pretty basic feature, as it would allow for easier configuration of scripts, triggering of various events for server admins or players, and debugging tools.

This exists in 1.16, and is going to be ported to 1.18+, but not 1.12.

This issue, #1010, does show off a way that you could use the command event to hijack the /ct command to add your own, you can see those scripts here:
https://gist.github.com/friendlyhj/8e5e5125d17f6f9870c2e747d3fb8bb7