- 8
- 0
Господа, мне необходимо зарегистрировать свою команду, на новой версии разобраться во всем этом весьма проблематично, может быть кто знает как ее зарегать? Вот сам класс команды:
Заранее благодарен.
Java:
public class TestCommand {
public static void register(CommandDispatcher<CommandSourceStack> p_137808_) {
p_137808_.register(Commands.literal("stest").requires((p_138414_) -> {
return p_138414_.hasPermission(2);
}).then(Commands.argument("message", MessageArgument.message()).executes((p_248171_) -> {
MessageArgument.resolveChatMessage(p_248171_, "message", (p_248170_) -> {
CommandSourceStack commandsourcestack = p_248171_.getSource();
PlayerList playerlist = commandsourcestack.getServer().getPlayerList();
playerlist.broadcastChatMessage(p_248170_, commandsourcestack, ChatType.bind(ChatType.SAY_COMMAND, commandsourcestack));
});
return 1;
})));
}
}