cloud icon indicating copy to clipboard operation
cloud copied to clipboard

To players who lack the permission to execute them, commands appear to not exist.

Open wordandahalf opened this issue 3 years ago • 2 comments
trafficstars

Using cloud-core, cloud-paper, and cloud-annotations, all 1.7.1. If a player lacks the permission to execute a command, they will be unable to autocomplete it, and, if they manually enter the command, will be told by the client that the command does not exist. The desired functionality would be that the command is autocomplete-able, but throws a NoPermissionException when the player attempts to run it, which can be handled by an exception handler. The documentation leads me to believe that this is the functionality, but I am not experiencing it.

wordandahalf avatar Sep 01 '22 00:09 wordandahalf

will be told by the client that the command does not exist

I don't think the client has the final say on what commands exist. The client may thing a command doesn't exist, but when you send a command, it's still sent to the server. Then the server can do what it wants.

Machine-Maker avatar Sep 01 '22 00:09 Machine-Maker

will be told by the client that the command does not exist

I don't think the client has the final say on what commands exist. The client may thing a command doesn't exist, but when you send a command, it's still sent to the server. Then the server can do what it wants.

Right, but I find the current behavior confusing in light of what the documentation states. The server does indeed recognize that the client sent the command, but no NoPermissionException is thrown, and hence, no message can be relayed to the client. I'm unsure of where to proceed other than the brute force method of just sifting through cloud's code, which I would prefer not to do since that would be a large time sink.

wordandahalf avatar Sep 01 '22 01:09 wordandahalf

Just to add to the conversation, I prefer cloud-paper's current functionality for this as it matches vanilla Minecraft's behavior for commands. I'm pretty sure that the NoPermissionException is thrown if the player doesn't have access to a subcommand, though?

TehBrian avatar Dec 31 '22 16:12 TehBrian

Just to add to the conversation, I prefer cloud-paper's current functionality for this as it matches vanilla Minecraft's behavior for commands. I'm pretty sure that the NoPermissionException is thrown if the player doesn't have access to a subcommand, though?

I don’t believe so; correct me if I’m wrong.

wordandahalf avatar Jan 01 '23 06:01 wordandahalf

The NoPermissionException is only thrown when the executer does not have permission to the subcommand. Wish it would also be thrown if the executor does not have permisison to the root command.

ChimpGamer avatar Feb 17 '23 14:02 ChimpGamer

This is intended behavior when using Brigadier mappings

jpenilla avatar Jan 15 '24 05:01 jpenilla