Code Monkey home page Code Monkey logo

commandaliases's Introduction

Command Aliases

Java 8 Project License Environment: Client Mod loader: Fabric Version CurseForge

Alternate short commands for complex commands (with tab completion)

Purpose

This mod allows you to rebind multiple commands into a single command, this also implies commands that may require vanilla operator permissions.

Additionally, provide format to start building new commands from scratch.

Commands

How to make a command?

You can find more information about them at the wiki.

Running into issues?

Here are some current issues with Command Aliases

Building from source

Prerequisites

  • Java 8 or above

Compiling

Navigate to the directory you've cloned this repository and launch a build with Gradle using gradlew build (Windows) or ./gradlew build (macOS/Linux). If you are not using the Gradle wrapper, simply replace gradlew with gradle or the path to it.

The initial setup may take a few minutes. After Gradle has finished building everything, you can find the resulting artifacts in build/libs.

License

Command Aliases is license under MIT, a free and open-source license. For more information, please see the license file.

commandaliases's People

Contributors

amnotbananaama avatar flashyreese avatar john-paul-r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

commandaliases's Issues

NullPointerException upon loading command alias

Mod version: 0.6.0
Server version: 1.18.2
Other mods: Fabric API, BlueMap, Fabric Tailor, FerriteCore, Geyser, Lithium, Phosphor
Command file:

[{
    "commandMode": "COMMAND_ALIAS",
    "command": "think",
    "execution": [{
        "command": "me is thinking",
        "type": "CLIENT"
    }]
}]

Error: java.lang.NullPointerException: Cannot invoke "me.flashyreese.mods.commandaliases.command.builder.alias.format.AliasCommand.getCommand()" because "command" is null

Please Help :/

So I want an alias for /sudo %PlayerName% %Text% that outputs /tellraw @a {"text":"<%PlayerName%> %Text%"}

PlaceholderAPI Implementation

Originally brought up in #46.

Targeted branch: https://github.com/FlashyReese/CommandAliases/tree/placeholders-api-impl

  • Replace in-house function processor with Placeholder API to reduce maintenance and bug-fixing efforts. Keep the deprecated function processor for a few releases to allow users to adjust to the change.
  • Transition all functions to use Placeholder API
    • Implement dynamic passing of functions to Placeholder API for servers
    • Implement dynamic passing of functions to Placeholder API for clients
      • Wait for Placeholder API to support FabricClientCommandSource as a context
  • Update documentation on the wiki to reflect the changes made

{arg::player#player} throws error

Error: Command Aliases/ERROR No method found for "{arg::player#player}"

Did syntax change? I tried having a look at the wiki, but I don't see any changes.

This is on 0.4.2. Issue wasn't present in 0.4.1 (which I've reverted to for now).

Command redirect did not work

There's no error, but the below format does not do anything. I also found that reversing the placement of "say" and "s" also did nothing, so it doesn't seem to just be me putting stuff in the wrong place. Was the format updated since the latest wiki page was made?

{
    "commandMode": "COMMAND_REDIRECT",
    "redirectCommand": {
        "command": "say",
        "redirectTo": "s"
    }
}

v0.3.0 doesn't seem to register anything

Or did the syntax change between subversions?

Environment:

  • 1.6.3
  • Fabric 0.10.8
  • Fabric API 0.25.0
  • Command Aliases 0.3.0

Reproduce:
commandaliases.json:

[
    {
        "command": "gm 0",
        "execution": [{"command": "gamemode survival", "type": "CLIENT"}]
    }
]

Do /commandaliases reload
Do /gm 0 and receive error:

Unknown or incomplete command, see below for error
/gm 0<--[HERE]

NoClassDefFoundError: org/yaml/snakeyaml/error/YAMLException

[09:44:33] [main/ERROR]: Minecraft has crashed!
net.fabricmc.loader.impl.FormattedException: java.lang.NoClassDefFoundError: org/yaml/snakeyaml/error/YAMLException
        at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:463) ~[fabric-loader-0.14.11.jar:?]
        at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.14.11.jar:?]
        at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) ~[fabric-loader-0.14.11.jar:?]
        at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) ~[fabric-loader-0.14.11.jar:?]
        at net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69) ~[fabric-server-mc.1.19.3-loader.0.14.11-launcher.0.11.1.jar:0.11.1]
Caused by: java.lang.NoClassDefFoundError: org/yaml/snakeyaml/error/YAMLException
        at com.fasterxml.jackson.dataformat.yaml.YAMLFactory._createParser(YAMLFactory.java:503) ~[com_fasterxml_jackson_dataformatyaml-2.14.0-c97ca96e0944d734.jar:?]
        at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:392) ~[com_fasterxml_jackson_dataformatyaml-2.14.0-c97ca96e0944d734.jar:?]
        at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:15) ~[com_fasterxml_jackson_dataformatyaml-2.14.0-c97ca96e0944d734.jar:?]
        at com.fasterxml.jackson.databind.ObjectReader.createParser(ObjectReader.java:1077) ~[com_fasterxml_jackson_core_jacksbind-2.14.0-e9915faff784b097.jar:?]
        at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1653) ~[com_fasterxml_jackson_core_jacksbind-2.14.0-e9915faff784b097.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.objectMapDataFormat(AbstractCommandAliasesProvider.java:498) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.loadAndRenderDirectoryTreeLines(AbstractCommandAliasesProvider.java:522) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.loadAndRenderDirectoryTreeLines(AbstractCommandAliasesProvider.java:534) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.loadAndRenderDirectoryTree(AbstractCommandAliasesProvider.java:472) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.loadCommandAliasesFromDirectory(AbstractCommandAliasesProvider.java:443) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.loadCommandAliases(AbstractCommandAliasesProvider.java:397) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.CommandAliasesLoader.lambda$registerCommandAliases$0(CommandAliasesLoader.java:58) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback.lambda$static$0(CommandRegistrationCallback.java:43) ~[fabric-command-api-v2-2.1.16+99f9db8085-10f08566a3c8c4dc.jar:?]
        at net.minecraft.class_2170.handler$zed000$fabric_addCommands(class_2170.java:1548) ~[server-intermediary.jar:?]
        at net.minecraft.class_2170.<init>(class_2170.java:259) ~[server-intermediary.jar:?]
        at net.minecraft.class_5350.<init>(class_5350.java:47) ~[server-intermediary.jar:?]
        at net.minecraft.class_5350.method_29466(class_5350.java:85) ~[server-intermediary.jar:?]
        at net.minecraft.class_7237.method_42098(class_7237.java:50) ~[server-intermediary.jar:?]
        at net.minecraft.server.Main.method_43612(Main.java:152) ~[server-intermediary.jar:?]
        at net.minecraft.class_156.method_43498(class_156.java:942) ~[server-intermediary.jar:?]
        at net.minecraft.class_156.method_43499(class_156.java:936) ~[server-intermediary.jar:?]
        at net.minecraft.server.Main.main(Main.java:150) ~[server-intermediary.jar:?]
        at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461) ~[fabric-loader-0.14.11.jar:?]
        ... 4 more
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.error.YAMLException
        at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:226) ~[fabric-loader-0.14.11.jar:?]
        at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:145) ~[fabric-loader-0.14.11.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at com.fasterxml.jackson.dataformat.yaml.YAMLFactory._createParser(YAMLFactory.java:503) ~[com_fasterxml_jackson_dataformatyaml-2.14.0-c97ca96e0944d734.jar:?]
        at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:392) ~[com_fasterxml_jackson_dataformatyaml-2.14.0-c97ca96e0944d734.jar:?]
        at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:15) ~[com_fasterxml_jackson_dataformatyaml-2.14.0-c97ca96e0944d734.jar:?]
        at com.fasterxml.jackson.databind.ObjectReader.createParser(ObjectReader.java:1077) ~[com_fasterxml_jackson_core_jacksbind-2.14.0-e9915faff784b097.jar:?]
        at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1653) ~[com_fasterxml_jackson_core_jacksbind-2.14.0-e9915faff784b097.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.objectMapDataFormat(AbstractCommandAliasesProvider.java:498) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.loadAndRenderDirectoryTreeLines(AbstractCommandAliasesProvider.java:522) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.loadAndRenderDirectoryTreeLines(AbstractCommandAliasesProvider.java:534) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.loadAndRenderDirectoryTree(AbstractCommandAliasesProvider.java:472) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.loadCommandAliasesFromDirectory(AbstractCommandAliasesProvider.java:443) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.AbstractCommandAliasesProvider.loadCommandAliases(AbstractCommandAliasesProvider.java:397) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at me.flashyreese.mods.commandaliases.command.loader.CommandAliasesLoader.lambda$registerCommandAliases$0(CommandAliasesLoader.java:58) ~[commandaliases-1.0.0+mc1.19.3-build.59.jar:?]
        at net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback.lambda$static$0(CommandRegistrationCallback.java:43) ~[fabric-command-api-v2-2.1.16+99f9db8085-10f08566a3c8c4dc.jar:?]
        at net.minecraft.class_2170.handler$zed000$fabric_addCommands(class_2170.java:1548) ~[server-intermediary.jar:?]
        at net.minecraft.class_2170.<init>(class_2170.java:259) ~[server-intermediary.jar:?]
        at net.minecraft.class_5350.<init>(class_5350.java:47) ~[server-intermediary.jar:?]
        at net.minecraft.class_5350.method_29466(class_5350.java:85) ~[server-intermediary.jar:?]
        at net.minecraft.class_7237.method_42098(class_7237.java:50) ~[server-intermediary.jar:?]
        at net.minecraft.server.Main.method_43612(Main.java:152) ~[server-intermediary.jar:?]
        at net.minecraft.class_156.method_43498(class_156.java:942) ~[server-intermediary.jar:?]
        at net.minecraft.class_156.method_43499(class_156.java:936) ~[server-intermediary.jar:?]
        at net.minecraft.server.Main.main(Main.java:150) ~[server-intermediary.jar:?]
        at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461) ~[fabric-loader-0.14.11.jar:?]
        ... 4 more

"gamemode survival" not working

[Server thread/ERROR]: [SERVER] COMMAND_REDIRECT_NOARG - Could not find existing command "gamemode survival"

Do you know why "gamemode survival" doesn't work but something like "weather clear" works?

Alias is taken directly from the quick start guide:

{ "schemaVersion": 1, "commandMode": "COMMAND_REDIRECT_NOARG", "command": "survival", "redirectTo": "gamemode survival" }

Minecraft version is 1.19.3. Am I just missing something?

Unsupported schema version error

I've been unable to load any custom commands at all onto a test server - every time I do I get an "unsupported schema version" error.

My custom command file:

{
    "commandMode": "COMMAND_CUSTOM",
    "customCommand": {
        "parent": "smite",
        "permission": 2,
        "children": [
            {
                "child": "user",
                "type": "argument",
                "argumentType": "minecraft:greedy_string",
                "message": "{{user}} was smote",
                "actions": [
                    {
                        "command": "execute at {{user}} run summon minecraft:lightning_bolt ~ ~ ~",
                        "commandType": "CLIENT"
                    }
                ]
            }
        ]
    }
}

Console error message when loading custom commands:

[13:43:07] [Server thread/INFO]: 
commandaliases
└── custom_commands.json - Unsupported schema version

Doesnt work

so i try a simple command

[
	{
		"command": "gmc",
		"execution": [
			{
				"command": "gamemode creative",
				"type": "CLIENT"
			}
		]
	}
]

but it doesn't work? i already try /commandaliases reload and save and quit and then enter the world again
This is my mod list btw :
image

Unable to get custom command working

Hello!

I have created a file called tpsbar.yaml in the commandaliases directory with the following contents:

commandMode: COMMAND_CUSTOM
customCommand:
  parent: tpsbar
  actions:
    - command: tabtps toggle bossbar
      commandType: SERVER

When I load the server and type /tpsbar, it doesn't give autocompletion and the command says it doesn't exist. I can't figure out what I am doing wrong. Any help would be appreciated ^_^

Better Command Action Scheduling System

The issue at hand:

private int scheduleAction(Queue<CustomCommandAction> customCommandActionQueue, long triggerTime, CommandDispatcher<S> dispatcher, CommandContext<S> context, List<String> currentInputList) {
AtomicInteger state = new AtomicInteger();
if (customCommandActionQueue.isEmpty()) return Command.SINGLE_SUCCESS;
CustomCommandAction action = customCommandActionQueue.poll();
String eventName = "generic";
if (action.getId() != null && !action.getId().isEmpty())
eventName = this.formatString(context, currentInputList, action.getId());
if (action.getStartTime() != null && !action.getStartTime().isEmpty()) {
String time = this.formatString(context, currentInputList, action.getStartTime());
triggerTime = System.currentTimeMillis() + Long.parseLong(time);
}
this.abstractCommandAliasesProvider.getScheduler().addEvent(new Scheduler.Event(triggerTime, eventName, () -> {
if (action.getCommand() != null && action.getCommandType() != null) {
long startFormat = System.nanoTime();
String actionCommand = this.formatString(context, currentInputList, action.getCommand());
long endFormat = System.nanoTime();
try {
state.set(this.dispatcherExecute(action, dispatcher, context, actionCommand));
} catch (CommandSyntaxException e) {
if (CommandAliasesMod.options().debugSettings.debugMode) {
CommandAliasesMod.logger().error("""
\n\t======================================================
\tFailed to process command
\tOriginal Action Command: {}
\tOriginal Action Command Type: {}
\tPost Processed Action Command: {}
\t======================================================""", action.getCommand(), action.getCommandType(), actionCommand);
String output = e.getLocalizedMessage();
this.sendFeedback(context, output);
}
e.printStackTrace();
}
long endExecution = System.nanoTime();
if (CommandAliasesMod.options().debugSettings.showProcessingTime) {
CommandAliasesMod.logger().info("""
\n\t======================================================
\tOriginal Action Command: {}
\tOriginal Action Command Type: {}
\tPost Processed Action Command: {}
\tFormatting time: {}ms
\tExecuting time: {}ms
\t======================================================""", action.getCommand(), action.getCommandType(), actionCommand, (endFormat - startFormat) / 1000000.0, (endExecution - endFormat) / 1000000.0);
}
if (state.get() != Command.SINGLE_SUCCESS) {
if (action.getMessageIfUnsuccessful() != null) {
String message = this.formatString(context, currentInputList, action.getMessageIfUnsuccessful());
this.sendFeedback(context, message);
}
if (action.getActionsIfUnsuccessful() != null && !action.getActionsIfUnsuccessful().isEmpty()) {
Queue<CustomCommandAction> unsuccessfulActionsQueue = new LinkedList<>(action.getActionsIfUnsuccessful());
state.set(this.scheduleAction(unsuccessfulActionsQueue, System.currentTimeMillis(), dispatcher, context, currentInputList));
}
if (action.isRequireSuccess()) {
customCommandActionQueue.clear();
}
} else {
if (action.getMessageIfSuccessful() != null) {
String message = this.formatString(context, currentInputList, action.getMessageIfSuccessful());
this.sendFeedback(context, message);
}
if (action.getActionsIfSuccessful() != null && !action.getActionsIfSuccessful().isEmpty()) {
Queue<CustomCommandAction> successfulActionsQueue = new LinkedList<>(action.getActionsIfSuccessful());
state.set(this.scheduleAction(successfulActionsQueue, System.currentTimeMillis(), dispatcher, context, currentInputList));
}
}
}
if (action.getMessage() != null) {
String message = this.formatString(context, currentInputList, action.getMessage());
this.sendFeedback(context, message);
}
state.set(this.scheduleAction(customCommandActionQueue, System.currentTimeMillis(), dispatcher, context, currentInputList));
}));
return state.get();
}

The current implementation of the custom command builder method is less efficient than the previous version. The previous version utilized a new thread to call variables, but this caused issues with certain mods like Immersive Portals. The current version uses a scheduler for commands, but this approach has a drawback in that it does not wait for custom commands to finish before scheduling the next one. This can lead to issues with sub-actions not completing before the next action is scheduled.

This is a problem because we use an atomic integer to return the state of our custom commands when we call them within command actions. When the scheduler is used, it can interfere with the state of our data if we are working with the database, leading to unexpected results.

We are seeking suggestions for alternative methods of implementation that do not involve summoning new threads. Feedback on this issue is greatly appreciated.

image
(An outdated image sketch that inadequately demonstrates the current issue)

Mod loads aliases too early

The mod loads the aliases before all mod commands are registered, resulting on it failing to apply the alias during /reload or server startup
image

1.19.3 support

Is there an estimate on when CommandAliases will support 1.19.3?

Backup Mods

Is it possible to relocate the command aliases data folder out of the world folder, or have an option to change where it is located?
Drag and drop backup mods do not work, due to the LOCK.file inside the command aliases directory. Moving this elsewhere would fix this.

Please help

Can somebody help me why this isn't working??

{
    "commandMode": "COMMAND_CUSTOM",
    "customCommand": {
      "parent": "test",
      "type": "literal",
      "permission": 0,
      "children": [
        {
          "child": "name",
          "type": "argument",
          "argumentType": "minecraft:word",
          "suggestionProvider": {
            "suggestionMode": "DATABASE_STARTS_WITH",
            "suggestion": "farms.suggestions"
          },
          "permisssion": 0,
          "actions": [
            {
              "message": "execute in $get_database_value(farm.{{name}}.dimension) run player {{name}} spawn at $get_database_value(farm.{{name}}.position)",
              "requireSuccess": true
            }
          ]
        }
      ]
    }
  },
  {
    "commandMode": "COMMAND_ALIAS",
    "aliasCommand": {
      "command": "asd {arg::minecraft:word#name} {arg::minecraft:dimension#dimension} {arg::minecraft:vec3#position} {arg::minecraft:message#message}",
      "execution": [
        {
          "command": "commandaliases database put farm.suggestions.{{name}} {{name}}",
          "commandType": "SERVER",
          "requireSuccess": true
        },
        {
          "command": "commandaliases database put farm.{{name}}.dimension  {{dimension}}",
          "commandType": "SERVER",
          "requireSuccess": true
        },
        {
          "command": "commandaliases database put farm.{{name}}.position  {{position}}",
          "commandType": "SERVER",
          "requireSuccess": true
        },
        {
          "command": "commandaliases database put farm.{{name}}.message  {{message}}",
          "commandType": "SERVER",
          "requireSuccess": true
        }
      ]
    }
  }

Failure to register aliases for mod-added commands on startup.

(I believe) Due to this command registration change, it is now possible for CommandAliases to load aliases before other mods have registered their commands, which will cause the registration process to fail for any CommandAliases nodes that reference one of these not-yet-registered commands.

Repro:

{
  "commandMode": "COMMAND_REDIRECT",
  "redirectCommand": {
    "command": "h",
    "redirectTo": "essentialcommands home tp"
  }
}
  • Observe the following logged error (and that /h does not exist:
[SERVER] COMMAND_REDIRECT - Could not find existing command "essentialcommands home tp".
  • additionally, note that after executing /commandaliases reload, /h is registered and works as intended.

I'm unable to use my "old" aliases

Here is my "current" config/commandaliases.json :

[
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"tonnerre",
         "redirectTo":"weather thunder"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"pluie",
         "redirectTo":"weather rain"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"clair",
         "redirectTo":"weather clear"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"jour",
         "redirectTo":"time set day"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"nuit",
         "redirectTo":"time set night"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"survie",
         "redirectTo":"gamemode survival"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"creatif",
         "redirectTo":"gamemode creative"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"aventure",
         "redirectTo":"gamemode adventure"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"spectateur",
         "redirectTo":"gamemode spectator"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"paisible",
         "redirectTo":"difficulty peaceful"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"facile",
         "redirectTo":"difficulty easy"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"normal",
         "redirectTo":"difficulty normal"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"difficile",
         "redirectTo":"difficulty hard"
      }
   }
]

I don't figure how to use in in config/commandaliases new format.

May you help ?

@jsonString includes the quotation marks used to mark the string/message

See title.

I'm writing a COMMAND_ALIAS for my tellraws. The goal is to have it formatted like so:
Name of Sender: Message

It works, but the "Name of Sender" includes the quotation marks when I use @JsonString, so it outputs like this:
"Name of Sender": Message

My command is as follows:

    {
        "commandMode": "COMMAND_ALIAS",
        "command": "tr {arg::minecraft:game_profile#Target} {arg::brigadier:string#FromName} {arg::minecraft:color#NameColor} {arg::minecraft:greedy_string#Message}",
        "execution": [
            {
                "command": "tellraw {Target} [\"\",{\"text\":\"{FromName@jsonString}\",\"color\":\"{NameColor}\"},\": {Message@jsonString}\"]",
                "type": "CLIENT"
            }
        ]
    },

So I do it like:
/tr @A "Satan" red Welcome to hell!

and it outputs:
"Satan": Welcome to hell!

But I want it as:
Satan: Welcome to hell!

[Question] Test or go on

commandaliases.txt
Hello,
First thanks for this mod, it's a greate job ;)

As you can see in joined file , I created sub commands to my daughter to enchant her stuff.
But if an enchant is already on it stop and do not go on.
I sthere a way to test if it's already have the enchant or to gon on ?

Thanks for your help

/tellraw won't work with CommandAliases

My plan was to have a tellraw run as a SERVER command so that all players can use it with a simple command.
But the JSON file stops that as the command in question(tellraw @a [{"text":"Click here for ","color":"yellow"},{"text":"BlueMap","bold":true,"color":"dark_blue","clickEvent":{"action":"open_url","value":"https://rotf.lol/farmtasticraftsbluemap/"}},{"text":" Click here for","bold":true,"color":"yellow"},{"text":" ","bold":true,"color":"dark_blue"},{"text":"Dynmap","bold":true,"color":"aqua","clickEvent":{"action":"open_url","value":"https://rotf.lol/farmtasticraftsdynmap/"}}]) also uses JSON text components. Would there be a workaround for this?

Feature Request: Fabric PlaceholderAPI

Hello, Requesting This because would drastically increase the potential of the CommandAliases and other mods

An example usage:

Checking LuckPerms permission:
commandaliases compare equals \"true\" \"%luckperms_check_permission%\"
More in: https://luckperms.net/wiki/Placeholders and https://placeholders.pb4.eu/user/mod-placeholders/

Default placeholders from PlaceholderAPI(Fabric):
https://placeholders.pb4.eu/user/default-placeholders/

Some Fabric mods using PlaceholderAPI:
https://placeholders.pb4.eu/user/mod-placeholders/

Implementing PlaceholderAPI page:
https://placeholders.pb4.eu/dev/getting-started/

Thanks for your time and efforts to maintain this amazin mod
Cheers.

[Question/Request] SuggestionProvider

Is there a way to create an alias for datapack disable "full/path/DataPack"?

I've tried string which doesn't autocomplete paths, and I've tried resource_location which doesn't accept a quoted argument (I don't know what arguments it accepts).

If not, could this be added?

Cannot assign "trigger" command

Hello, I made a trigger command with my datapack
/trigger bid set <int>

and wanted to make a bid command that would forward the int to the trigger command.
I tried doing this:

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT",
    "command": "bid",
    "redirectTo": "trigger bid set"
}

But sadly I got an error:

11:50:56] [Server thread/ERROR]: [SERVER] COMMAND_REDIRECT - Could not find existing command "trigger bid": /Users/xxx/Library/Application Support/PrismLauncher/instances/Simply Optimized 1.18.2/.minecraft/config/commandaliases/bid.json```

Please update to 1.18

Hi there

Love this mod, use it on my family server. Please will you recompile it for 1.18?

Thanks!

MySQL error after enabling mysql database

[Server thread/ERROR]: BLOB/TEXT column 'key' used in key specification without a key length
[Server thread/INFO]: [STDERR]: java.sql.SQLSyntaxErrorException: BLOB/TEXT column 'key' used in key specification without a key length
[Server thread/INFO]: [STDERR]: at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
[Server thread/INFO]: [STDERR]: at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
[Server thread/INFO]: [STDERR]: at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1335)
[Server thread/INFO]: [STDERR]: at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2085)
[Server thread/INFO]: [STDERR]: at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1246)
[Server thread/INFO]: [STDERR]: at me.flashyreese.mods.commandaliases.storage.database.mysql.MySQLImpl.open(MySQLImpl.java:36)
[Server thread/INFO]: [STDERR]: at me.flashyreese.mods.commandaliases.command.loader.CommandAliasesLoader.lambda$registerCommandAliases$1(CommandAliasesLoader.java:73)
[Server thread/INFO]: [STDERR]: at net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents.lambda$static$2(ServerLifecycleEvents.java:49)
[Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.handler$zcn000$afterSetupServer(MinecraftServer.java:2824)
[Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:655)
[Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:264)
[Server thread/INFO]: [STDERR]: at java.base/java.lang.Thread.run(Thread.java:833)

Bugs and Question

Bugs, try clear all you inventory, and run /clear

{
		"commandMode": "COMMAND_REASSIGN_AND_ALIAS",
		"command": "clear",
		"reassignTo": "minecraft:clear",
		"execution": [
			{
				"command": "minecraft:clear",
				"type": "CLIENT"
			},
			{
				"command": "replaceitem entity @s hotbar.0 minecraft:wooden_sword",
				"type": "CLIENT"
			}
		]
	}

Then, the second command doesn't run if the previous command doesn't success. But if the command success it will run the second command.
Question

  1. Can you turn off the send command feedback just for commandAliases?
    image
  2. Is this client side, if no, is the "type": "CLIENT" is client. Because I see no reason why the "type": "CLIENT" is not client. Because we can run /clear and /replaceitem entity @s hotbar.0 minecraft:wooden_sword if we are op

Unable to create suggestion provider using JSON_LIST option / documentation does not exist

I am attempting to create a JSON list suggestion provider:

...
{
  "child": "stop",
  "type": "argument",
  "argumentType": "minecraft:word",
  "suggestionProvider": {
    "suggestionMode": "JSON_LIST",
    "suggestion": "['stop']"
  },
...
}
...

I have tried various potential string list formats (such as "[\"stop\"]") but none of them seem to be creating the desired autocomplete option. How is this supposed to be done? And can the wiki be updated to include this information?

trigger command not aliasing correctly

Trying to use this to turn /trigger status-live from a datpack into /status live. It doesn't throw an error but the command just does nothing. My suspicion is that the trigger command is not working as it can't find the player that used it. I'll leave the datapack and tyhe config files I'm using left below. The config includes other status commands I'm trying to get working, but focusing on live is my goal.
status-plugin-1-1.zip
{ "schemaVersion": 1, "commandMode": "COMMAND_CUSTOM", "command": "status", "permission": 0, "message": "hello parent command", "children": [ { "child": "live", "type": "argument", "argumentType": "minecraft:word", "suggestionProvider": { "suggestionMode": "DATABASE_STARTS_WITH", "suggestion": "$executor_name().home.suggestions" }, "permission": 0, "actions": [ { "command": "trigger Status-Live" } ] }, { "child": "recording", "type": "argument", "argumentType": "minecraft:word", "permission": 0, "actions": [ { "command": "trigger Status-Recording" } ] }, { "child": "reset", "type": "argument", "argumentType": "minecraft:word", "permission": 0, "actions": [ { "command": "trigger Status-Reset" } ] } ] }

CommandMode COMMAND_REDIRECT_NOARG will not work with numbers

If I put any number in the redirectTo field, the command will not show up ingame.

Example:
{
"commandMode": "COMMAND_REDIRECT_NOARG",
"redirectCommand": {
"command": "day",
"redirectTo": "time set day"
}
}
will work.

{
"commandMode": "COMMAND_REDIRECT_NOARG",
"redirectCommand": {
"command": "day",
"redirectTo": "time set 0"
}
}
will NOT work.

Error?

{
"commandMode": "COMMAND_CUSTOM",
"customCommand": {
"parent": "testconvert",
"type": "literal",
"actions": [
{
"command": "execute if entity @p[nbt={Inventory:[{id:"minecraft:emerald",Count:2b}]}] run clear $executor_name() minecraft:diamond 1",
"commandType": "SERVER"
}
],
"message": "Exchanged 2 Emeralds for 1 Diamond!"
}
}
Fails to reload, error within the "command" line unterminated object between the 'n' and 'v' in 'Inventory'

Tellraw JSON keeps failing

I am trying to write a custom /help command, and keep coming to an issue when using the /tellraw command. I keep getting the following error:
com.mojang.brigadier.exceptions.CommandSyntaxException: Expected whitespace to end one argument, but found trailing data at position 79: ...":" HELP",<--[HERE]

My JSON has all the quotes escaped properly, and I have searched through past issues as well as anything general I could find with a google search, but I'm not sure where it is going wrong.

This is the JSON I am trying to use:

["",{"text":"=-=-=-=","color":"#D87C14"},{"text":" HELP","bold":true,"color":"gold"},{"text":" =-=-=-=","color":"#D87C14"},{"text":"\n"},{"text":"Select a command to\nget more help","color":"blue"},{"text":"\n"},{"text":"=-=-=-=-=-=-=-=-=-=","color":"#D87C14"},{"text":"\n"},{"text":"/home","color":"yellow"},{"text":" - Set up and teleport to saved locations","color":"gray"},{"text":"\n"},{"text":"/new","color":"yellow"},{"text":" - See the newest information about the server","color":"gray"},{"text":"\n"},{"text":"/warp","color":"yellow"},{"text":" - Warp to popular locations across the world","color":"gray"},{"text":"\n"},{"text":"/spawn","color":"yellow"},{"text":" - Teleport back to world spawn","color":"gray"},{"text":"\n"},{"text":"=-=-=-=-=-=-=-=-=-=","color":"#D87C14"},{"text":"\n"},{"text":"Choose an option below to see\ncommands for that group","color":"blue"},{"text":"\n"},{"text":"=-=-=-=-=-=-=-=-=-=","color":"#D87C14"},{"text":"\n"},{"text":"[Member] [Trusted] [Admin]","color":"aqua"}]

Escaped version:

[\"\",{\"text\":\"=-=-=-=\",\"color\":\"#D87C14\"},{\"text\":\" HELP\",\"bold\":true,\"color\":\"gold\"},{\"text\":\" =-=-=-=\",\"color\":\"#D87C14\"},{\"text\":\"\n\"},{\"text\":\"Select a command to\nget more help\",\"color\":\"blue\"},{\"text\":\"\n\"},{\"text\":\"=-=-=-=-=-=-=-=-=-=\",\"color\":\"#D87C14\"},{\"text\":\"\n\"},{\"text\":\"/home\",\"color\":\"yellow\"},{\"text\":\" - Set up and teleport to saved locations\",\"color\":\"gray\"},{\"text\":\"\n\"},{\"text\":\"/new\",\"color\":\"yellow\"},{\"text\":\" - See the newest information about the server\",\"color\":\"gray\"},{\"text\":\"\n\"},{\"text\":\"/warp\",\"color\":\"yellow\"},{\"text\":\" - Warp to popular locations across the world\",\"color\":\"gray\"},{\"text\":\"\n\"},{\"text\":\"/spawn\",\"color\":\"yellow\"},{\"text\":\" - Teleport back to world spawn\",\"color\":\"gray\"},{\"text\":\"\n\"},{\"text\":\"=-=-=-=-=-=-=-=-=-=\",\"color\":\"#D87C14\"},{\"text\":\"\n\"},{\"text\":\"Choose an option below to see\ncommands for that group\",\"color\":\"blue\"},{\"text\":\"\n\"},{\"text\":\"=-=-=-=-=-=-=-=-=-=\",\"color\":\"#D87C14\"},{\"text\":\"\n\"},{\"text\":\"[Member] [Trusted] [Admin]\",\"color\":\"aqua\"}]

I have tried removing spaces in the text string near where the error is happening, but I still continue to get the same error. I am not sure where I am going wrong here.

Full file:

{
  "schemaVersion": 1,
  "commandMode": "COMMAND_CUSTOM",
  "command": "help",
  "permission": 0,
  "actions": [
    {
      "command": "tellraw $executor_name() [{\"text\":\"=-=-=-=\",\"color\":\"#D87C14\"},{\"text\":\"HELP\",\"bold\":true,\"color\":\"gold\"},{\"text\":\"=-=-=-=\",\"color\":\"#D87C14\"},{\"text\":\"\n\"},{\"text\":\"Select a command to\nget more help\",\"color\":\"blue\"},{\"text\":\"\n\"},{\"text\":\"=-=-=-=-=-=-=-=-=-=\",\"color\":\"#D87C14\"},{\"text\":\"\n\"},{\"text\":\"/home\",\"color\":\"yellow\"},{\"text\":\" - Set up and teleport to saved locations\",\"color\":\"gray\"},{\"text\":\"\n\"},{\"text\":\"/new\",\"color\":\"yellow\"},{\"text\":\" - See the newest information about the server\",\"color\":\"gray\"},{\"text\":\"\n\"},{\"text\":\"/warp\",\"color\":\"yellow\"},{\"text\":\" - Warp to popular locations across the world\",\"color\":\"gray\"},{\"text\":\"\n\"},{\"text\":\"/spawn\",\"color\":\"yellow\"},{\"text\":\" - Teleport back to world spawn\",\"color\":\"gray\"},{\"text\":\"\n\"},{\"text\":\"=-=-=-=-=-=-=-=-=-=\",\"color\":\"#D87C14\"},{\"text\":\"\n\"},{\"text\":\"Choose an option below to see\ncommands for that group\",\"color\":\"blue\"},{\"text\":\"\n\"},{\"text\":\"=-=-=-=-=-=-=-=-=-=\",\"color\":\"#D87C14\"},{\"text\":\"\n\"},{\"text\":\"[Member] [Trusted] [Admin]\",\"color\":\"aqua\"}]",
      "commandType":"SERVER"
    }
  ]
}

Server crashes after i reload the mod

this is my crash report:

[11:18:22] [Server thread/INFO]: [CoreBytes: Reloading all Command Aliases!]
[11:18:22] [Server thread/ERROR]: Encountered an unexpected exception
java.lang.NoClassDefFoundError: net/minecraft/class_5473
at me.flashyreese.mods.commandaliases.classtool.impl.argument.ArgumentTypeManager.registerArgumentTypes(ArgumentTypeManager.java:194) ~[commandaliases-0.4.0.jar:?]
at me.flashyreese.mods.commandaliases.classtool.impl.argument.ArgumentTypeManager.(ArgumentTypeManager.java:45) ~[commandaliases-0.4.0.jar:?]
at me.flashyreese.mods.commandaliases.command.builders.CommandAliasesBuilder.(CommandAliasesBuilder.java:59) ~[commandaliases-0.4.0.jar:?]
at me.flashyreese.mods.commandaliases.CommandAliasesLoader.registerCommands(CommandAliasesLoader.java:76) ~[commandaliases-0.4.0.jar:?]
at me.flashyreese.mods.commandaliases.CommandAliasesLoader.lambda$registerCommandAliasesCommands$4(CommandAliasesLoader.java:125) ~[commandaliases-0.4.0.jar:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262) ~[intermediary-server.jar:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:176) ~[intermediary-server.jar:?]
at net.minecraft.class_2170.method_9249(class_2170.java:260) ~[intermediary-server.jar:?]
at net.minecraft.class_3244.method_14370(class_3244.java:1134) ~[intermediary-server.jar:?]
at net.minecraft.class_3244.method_12048(class_3244.java:1121) ~[intermediary-server.jar:?]
at net.minecraft.class_2797.method_12115(class_2797.java:36) ~[intermediary-server.jar:?]
at net.minecraft.class_2797.method_11054(class_2797.java:9) ~[intermediary-server.jar:?]
at net.minecraft.class_2600.method_11072(class_2600.java:21) ~[intermediary-server.jar:?]
at net.minecraft.class_3738.run(class_3738.java:18) ~[intermediary-server.jar:?]
at net.minecraft.class_1255.method_18859(class_1255.java:144) ~[intermediary-server.jar:?]
at net.minecraft.class_4093.method_18859(class_4093.java:23) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_24306(MinecraftServer.java:763) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_18859(MinecraftServer.java:154) ~[intermediary-server.jar:?]
at net.minecraft.class_1255.method_16075(class_1255.java:118) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:745) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_16075(MinecraftServer.java:739) ~[intermediary-server.jar:?]
at net.minecraft.class_1255.method_18857(class_1255.java:127) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:724) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.handler$zjf000$modifiedRunLoop(MinecraftServer.java:2805) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:653) ~[intermediary-server.jar:?]
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:256) ~[intermediary-server.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]
Caused by: java.lang.ClassNotFoundException: net.minecraft.class_5473
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_275]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_275]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) ~[?:1.8.0_275]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_275]
at net.fabricmc.loader.launch.server.InjectingURLClassLoader.loadClass(InjectingURLClassLoader.java:56) ~[fabric-server-launch.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_275]
at net.fabricmc.loader.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:168) ~[fabric-server-launch.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_275]
... 27 more
[11:18:22] [Server thread/ERROR]: This crash report has been saved to: /home/mc-server/run/./crash-reports/crash-2021-01-30_11.18.22-server.txt
[11:18:22] [Server thread/INFO]: Stopping server
[11:18:22] [Server thread/INFO]: Saving players

and this is my config file:

{
"commandMode": "COMMAND_ALIAS",
"command": "helpop {arg::greedy_string#message}",
"execution": [
{
"command": "execute if entity @A[team=Staff] run tellraw @A[team=Staff] ["",{"text":"[","color":"gold"},{"text":"HelpOP","color":"dark_red"},{"text":"] ","color":"gold"},{"text":"{this::SELF}","color":"red"},{"text":": ","color":"white"},{"text":"{message}","color":"red"}]",
"type": "SERVER",
"ignoreOptionalRemoval": true
},
{
"command": "execute unless entity @A[team=Staff] run tellraw {this::SELF} ["",{"text":"[","color":"gold"},{"text":"HelpOP","color":"dark_red"},{"text":"] ","color":"gold"},{"text":"There are currently no staff online!","color":"red"}]",
"type": "SERVER",
"sleep": "1000"
},
{
"command": "execute unless entity @A[team=Staff] run tellraw {this::SELF} ["",{"text":"[","color":"gold"},{"text":"HelpOP","color":"dark_red"},{"text":"] ","color":"gold"},{"text":"You can get help in our discord:","color":"red"},{"text":"\n"},{"text":"URL GOES HERE","color":"gold","clickEvent":{"action":"open_url","value":"URL GOES HERE"}}]",
"type": "SERVER"
}
]
}

(Just copied that from the wiki)

Error while executing command

this is the code:
[
{
"commandMode": "COMMAND_ALIAS",
"command": "cords",
"execution": [
{
"command": "execute at {this::SELF} run trigger ch_toggle",
"type": "CLIENT"
}
]
}
]
after reloading in-game when typing /cords as a OP it works but when doing the same as a non OP player this error comes
image

Keep getting Unsupported Schema Version message

I am setting this up for the first time, and am running into this issue. Whenever I try to load my custom command, I keep getting the error message "Unsupported Schema Version":

commandaliases
└── spawn.json - Unsupported schema version

I cannot figure out what is going wrong. My spawn.json is listed below:

{
  "commandMode": "COMMAND_CUSTOM",
  "customCommand": {
    "parent": "spawn",
    "type": "literal",
    "permission": 0,
    "actions": [
      {
        "command": "execute in minecraft:overworld run tp $executor_name() 357.18 66.00 57.65 186.90 10.50",
        "commandType": "SERVER",
        "message": "Teleporting to spawn..."
      }
    ]
  }
}

I don't seem to be missing any brackets or commas or quotations, so I'm not sure where the issue is, or if it's my issue or not.


Note: While writing this, I tried something else to fix it, but got a new error.

I added brackets [] to the start and end of the file like this:

[
  {
    "commandMode": "COMMAND_CUSTOM",
    "customCommand": {
      ...
    }
  }
]

This brought a new error:

Failed to load file at "/home/ubuntu/Minecraft_Server/./config/commandaliases/spawn.json" throws com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `me.flashyreese.mods.commandaliases.command.CommandAlias` from Array value (token `JsonToken.START_ARRAY`)
 at [Source: (File); line: 1, column: 1]
[12:37:22 INFO]: 
commandaliases
└── spawn.json - Failed to load

I'd assume this is because brackets [] are not the right solution, but I figured I would mention that I tried anyway.

Add formatting support in "message" for other symbols, not just §

Hi, my main issue is with how most color format generators online (the ones where you type in some text and then change the font formatting using their editor) only output JSON or normal text with & symbols for formatting.

I think I'm yet to find an online generator that outputs the § symbol for the clipboard, so when working on dozens of custom commands where I need to set up colored messages, it's a bit annoying to have that extra step, because we already need to set up the formatting inside the generator to our liking, to begin with.

Compatibility issues with Immersive Portals

Using Immersive Portals (tested with 2.0.2) Multiple server commands fail to execute in a custom command. This example code works without IP but fails with it:

{
	"commandMode": "COMMAND_CUSTOM",
	"customCommand": {
		"parent": "tools",
		"message": "Here are some free wooden tools, $executor_name()!",
		"actions": [
			{
				"command": "give $executor_name() minecraft:wooden_sword",
				"commandType": "SERVER",
				"message": "Here is a wooden sword",
				"sleep": "2000"
			},
			{
				"command": "give $executor_name() minecraft:wooden_pickaxe",
				"commandType": "SERVER",
				"sleep": "1000",
				"message": "Here is a wooden pickaxe"
			},
			{
				"command": "give $executor_name() minecraft:wooden_axe",
				"commandType": "SERVER",
				"sleep": "1000",
				"message": "Here is a wooden axe"
			},
			{
				"command": "give $executor_name() minecraft:wooden_shovel",
				"commandType": "SERVER",
				"message": "Here is a wooden shovel, $executor_name()!"
			}
		]
	}
}

With Immersive Portals the custom command only gives a wooden sword. If the client reconnects they will see the sword ghosting in the air, and when the server is restarted a duplicate sword will fall to the ground.

[Request] Optional Parameteres

I know you say "All arguments are required, you can't create optional argument yet, " implying you have plans for optional parameters;
I'm just letting you know you have at least one user that would find this feature useful : ]

Command not working

I followed the wiki trying to create a custom command that switch between spectator and creative but its not working when i add the unsuccesful part
`schemaVersion = 1
commandMode = "COMMAND_CUSTOM"
command = "gmode"

[[actions]]
id = "generic"
command = "gamemode spectator $executor_name()"
commandType = "SERVER"
requireSuccess = false
messageIfUnsuccessful = "Test"

[[actionsIfUnsuccessful]]
command = "gamemode creative $executor_name()"
commandType = "SERVER"
requireSuccess = false
messageIfUnsuccessful = "Test"This is the .toml file i got but i just get a error that it not load:[12:29:55] [Server thread/ERROR]: Failed to load file at "/home/container/./config/commandaliases/g-mode.toml" throws com.fasterxml.jackson.dataformat.toml.TomlStreamReadException: Newline not permitted here
at [Source: (File); line: 12, column: 22]`

Aliases loading order

In what order are the aliases loaded? Is there any way to make sure one alias loads before another?

Cannot execute custom command in datapack function

I have three custom commands (each without arguments) that load in without issue:

[00:09:08] [Server thread/INFO]: 
commandaliases
├── removebonus.json - Successfully loaded
├── changeorigin.json - Successfully loaded
└── addbonus.json - Successfully loaded
[00:09:08] [Server thread/INFO]: Registered/Reloaded all your commands :P, you can now single command nuke!

I call one of these in a datapack mcfunction:

tag @s add tracked
addbonus

Upon loading up my server or reloading the datapacks, I get errors along the lines of this:

[00:09:08] [Server thread/ERROR]: Failed to load function scmcraft-commands:on_fortyeight_hours
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Whilst parsing command on line 2: Unknown or incomplete command, see below for error at position 0: <--[HERE]
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
        at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
Caused by: java.lang.IllegalArgumentException: Whilst parsing command on line 2: Unknown or incomplete command, see below for error at position 0: <--[HERE]
        at net.minecraft.class_2158.method_9195(class_2158.java:63) ~[server-intermediary.jar:?]
        at net.minecraft.class_5349.method_29451(class_5349.java:85) ~[server-intermediary.jar:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        ... 6 more

Running the addbonus command in-game works perfectly fine, so my hypothesis is that, when the server loads in the commands, it doesn't load them in where mcfunctions can see them. Is there any way to fix that?

Could not find existing command: Needs manual load after every reboot

During server boot it seems this mod gets loaded before the one its commands point-to. It requires me to type the load/reload command after every reboot to get it working. I realise this might be out of scope of your mod but any guidance would be greatly appreciated. It says this in the console on boot:
https://i.imgur.com/aKTfLB0.png

[
{
"commandMode": "COMMAND_REDIRECT_NOARG",
"command": "co",
"redirectTo": "dl inspect"
}
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.