You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe your suggestion
Would be nice to dynamically suggest strings per user. For instance, each user has a set of homes, and I would like to display their homes as they're typing the argument.
Please supply examples of the desired inputs and outputs Example:
Input: /home homename
Output: /home <home, farm, friend, newbase>
Example:
classCommandHome {
privatefunrun(sender:CommandSender, args:Array<Any>) {
if (sender !isPlayer) return;
// Check if home exists and teleport player there.
}
privatefundynamicStringArgument(sender:CommandSender): Array<String> {
if (sender !isPlayer) return arrayOf();
returnPluginMain.homes[sender.uniqueId] ?: arrayOf();
}
funregisterCommand() {
val normal =LinkedHashMap<String, Argument>();
normal["Home"] =DynamicSuggestedStringArgument(::dynamicStringArgument);
CommandAPI.getInstance().register("home", CommandPermission.fromString("commands.home"), normal, ::run);
}
}
The text was updated successfully, but these errors were encountered:
Please describe your suggestion
Would be nice to dynamically suggest strings per user. For instance, each user has a set of homes, and I would like to display their homes as they're typing the argument.
Please supply examples of the desired inputs and outputs
Example:
Input:
/home homename
Output:
/home <home, farm, friend, newbase>
Example:
The text was updated successfully, but these errors were encountered: