Posted May 31May 31 I have a command structured like this: /rank list /rank upgrades /rank nextLevel I want to allow the server to send the command /rank list because it doesn't interact with players, meanwhile upgrades and nextLevel are targetting a player. In my current condition I'm checking if the command context's source's player is not null, but do exist a way to map those argouments for players only so they don't even show up in autocompletations? PS (forgot to add the code) @SubscribeEvent public void onRegisterCommands(RegisterCommandsEvent event) { // builds command tree structure. LiteralArgumentBuilder<CommandSourceStack> root = Commands.literal("rank"); root.then(Commands.literal("list") .executes(this::onListRanks)); root.then(Commands.literal("upgrades") .executes(this::onDisplayPlayerUpgrades)); root.then(Commands.literal("nextLevel") .executes(this::onIncreaseCurrentPlayerLevel)); event.getDispatcher().register(root); } Edited May 31May 31 by Magg add code
June 20Jun 20 You can use the .requires() function the server also has a permission level of 4, which is the highest permission level.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.