Ok. i've got a command registered:
public void onInitialize() {
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
LiteralCommandNode<ServerCommandSource> PlayerChatRangeMethodNode = CommandManager
.literal("PlayerChatRangeMethod")
.requires(source -> source.hasPermissionLevel(4))
.then(argument(MethodArgumentName, IdentifierArgumentType.identifier()))
.executes(this::PlayerRangeMethodCommand)
.build();
dispatcher.getRoot().addChild(PlayerChatRangeMethodNode);
});
}
private int PlayerRangeMethodCommand(CommandContext<ServerCommandSource> context) {
Identifier methodName = IdentifierArgumentType.getIdentifier(context, MethodArgumentName);
context.getSource().sendFeedback(() -> Text.literal("called /PlayerRangeMethod with argument " + methodName), false);
return 1;
}
At the moment, for testing, it doesn't care what identifier is passed but when i try to pass an identifier, say minecraft:stone, i get this error:
Unknown or incomplete command, see below for error
...raft:stone<--[HERE]
I assume I am getting something wrong about how to pass identifiers
