Skip to content

/sk Command Rework #8050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: dev/feature
Choose a base branch
from

Conversation

erenkarakal
Copy link
Member

@erenkarakal erenkarakal commented Jul 17, 2025

Problem

The current way the /sk command is written makes it nearly impossible to add new features, fix bugs, or even tell what's going on.
There are also lots of issues created for the /sk command that were untouched for a long time.

Solution

Deletes the old SkriptCommand and SkriptCommandTabCompleter classes and replaces them with a new SubCommand class.
To add a new SubCommand, you create a new class for your command and extend SubCommand:

public class MyCommand extends SubCommand {

	public MyCommand() {
		super("my", "command", "aliases");
	}

	@Override
	public void execute(@NotNull CommandSender sender, @NotNull String @NotNull [] args) {
		sender.sendMessage("You ran this command.");
	}

	@Override
	public List<String> getTabCompletions(@NotNull CommandSender sender, @NotNull String @NotNull [] args) {
		return List.of("tab completions");
	}

}

Then, add your subcommand inside the new SkriptCommand class

For commands that share a lot of code, such as /sk enable | disable | reload, a new ScriptCommand class was added as a utility class.
This approach makes it way easier to work on anything related to the /sk command.

TODO List

I created this PR early to get initial feedback on the new structure, and so that people can recommend changes on the old command code. If you have any suggestions for new commands, drop them here.


Completes: none
Related: none

Copy link
Member

@Efnilite Efnilite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like the new structure, good work 🙏

@Efnilite Efnilite added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants