Created
April 9, 2024 13:51
-
-
Save Densamisten/85e293ef642d6e2cedd1dd01e9081e6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void register(CommandDispatcher<ServerCommandSource> dispatcher, | |
CommandRegistryAccess ignoredCommandRegistryAccess, | |
CommandManager.RegistrationEnvironment ignoredRegistrationEnvironment) | |
{ | |
dispatcher.register(LiteralArgumentBuilder | |
.<ServerCommandSource>literal("ls") | |
.then(CommandManager.argument("anyArgumentName", IntegerArgumentType.integer(-90, 90)) | |
.executes(LsCommand::MethodToExecute))); | |
} | |
public static int MethodToExecute(CommandContext<ServerCommandSource> context) { | |
Objects.requireNonNull(MinecraftClient.getInstance().player) | |
.setPitch(IntegerArgumentType.getInteger(context, "anyArgumentName")); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment