Skip to content

Fix OP and non-KO'd players having all commands blocked by default#43

Merged
MatisseAD merged 2 commits intomasterfrom
copilot/fix-op-commands-permission-issue
Feb 25, 2026
Merged

Fix OP and non-KO'd players having all commands blocked by default#43
MatisseAD merged 2 commits intomasterfrom
copilot/fix-op-commands-permission-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 24, 2026

The onCommandPreprocess guard condition used && with enable_commands_allowed, which defaults to false. This made the entire early-return condition always false, causing every command from every player — including OPs and players not in KO state — to be blocked by the allowed-commands filter.

Changes

  • PlayerKOListener.java: Fixed boolean logic so the early return fires correctly when the player is not KO'd, is OP, or the command restriction feature is disabled

Before:

if ( (!koManager.isKO(player) || player.isOp()) && getConfig().getBoolean("knockout.enable_commands_allowed") ) return;

After:

boolean commandRestrictionsEnabled = getConfig().getBoolean("knockout.enable_commands_allowed");
if (!koManager.isKO(player) || player.isOp() || !commandRestrictionsEnabled) return;

With the default enable_commands_allowed: false, the old condition short-circuited to false unconditionally, so no player could bypass the allowed-commands check. The fix ensures command restrictions only apply to non-OP players who are actively KO'd and have the feature explicitly enabled.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repo.papermc.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/ReanimateMC/ReanimateMC org.codehaus.plexus.classworlds.launcher.Launcher compile -q (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/ReanimateMC/ReanimateMC org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>OP commands get blocked: no_permission_ko</issue_title>
<issue_description>Hello, I like the idea of this plugin a lot, so I want to make it work, but sadly I´m having issues when installing this plugin on my paper server network - once I remove it it works fine.

The issue is that once joining on the server and trying to make commands as OP, but I just get no_permission_ko in return - no matter if I´m knocked out or not.
I manually set first_run: false and restarted but I´m not sure what to try next...
I´m running Paper on 1.21.1

Thank you so much for your help!!
Best regards Patrick</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: MatisseAD <84678307+MatisseAD@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix OP commands blocking with no_permission_ko error Fix OP and non-KO'd players having all commands blocked by default Feb 24, 2026
Copilot AI requested a review from MatisseAD February 24, 2026 22:53
@MatisseAD MatisseAD marked this pull request as ready for review February 25, 2026 06:33
@MatisseAD MatisseAD merged commit d7c46f1 into master Feb 25, 2026
1 check passed
@MatisseAD MatisseAD deleted the copilot/fix-op-commands-permission-issue branch February 25, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OP commands get blocked: no_permission_ko

2 participants