Sponge
Sponge copied to clipboard
The player does not receive information about whether he can execute commands that require the performer to be a player.
Affected Product(s)
SpongeNeo
Version
1.21.1-21.1.35-12.0.3-RC2358
Operating System
Debian GNU/Linux 12 (bookworm) x86_64
Java Version
21.0.7
Plugins/Mods
Plugins (12): LogFilter, WorldEdit, LocaleAPI, Wasted, LuckPerms, H2Driver, MySQLDriver, CommandPack, RegionGuard, GuiShopManager, IslandWorlds, ClearLag.
Mods (12): Minecraft, Just Enough Items, Lithium, SpongeAPI, Sponge, NeoForge, SpongeNeo, ModernFix, Architectury, Accelerated Decay, Ferrite Core, AI-Improvements.
Describe the bug
The bug is not reproducible on SpongeVanilla.
You can check using this code. In the constructor of the command, use the method executionRequirements(cause -> ...).
boolean canUse(CommandCause cause) {
return cause.first(ServerPlayer.class).filter(player -> hasPermission(player)).isPresent();
// | ^ Optional is always empty here |
}
// This method will never be called.
boolean hasPermission(ServerPlayer player) {
return player.hasPermission("permission");
}
That's what we get as a result. The player can execute a command if he has permission, but the client will always highlight it in red, since he does not know it, which means that tab-completion of the command and its arguments will not work.
Link to logs
No response