Question Best way to ensure my plugin commands take priority? (FAWE + WG Issue)

T0xicTyler

New member
Sep 20, 2023
1
0
1
Hi guys, I have a seemingly simplistic question that I can't seem to work out with the documentation of Spigot and Paper at hand.

My plugin registers its own /heal and /remove commands which are being overridden by WorldGuard and FastAsyncWorldEdit respectively. I dove into the documentation for these two plugins and found no ability to disable these commands within their respective plugins.

I need to either A) Fully disable unnecessary commonly named command implementations from a third party plugin or B) Give my plugin's commands precedence over commands with the same primary command label. I looked into other solutions for this problem and I only found people telling admins to use Skript or another plugin.

The next place I looked was within the commands.yml file where I found a semi-solution with the aliases section. Forcing heal to point to myplugin:heal works except now I have a long-winded command label which shows up in help text. I could hard code to exclude this plugin prefix from my help text system, but I figure there must be a more elegant solution where I can disable the third party plugin's command.
Perhaps I should detect the problematic plugins in my plugin's startup code and disable known problematic commands in a manual programmatic fashion if they are present.

The commands.yml alternative I tried was to point fastasyncworldedit:remove and worldguard:heal to - [], which caused a bizarre result where the former responds with Unknown command and the latter is seemingly unaffected by the change.

YAML:
aliases:
  # This works but causes some gross command labels
  heal:
  - myplugin:heal
  remove:
  - myplugin:remove
  # This causes weird results. Seems to not have intended effect. Am I doing this wrong?
  fastasyncworldedit:remove:
  - []
  worldguard:heal:
  - []

Anyone have a quick fix that I'm missing to give my commands precedence or alternatively a recommendation for how to disable a problematic plugin's overriding command? Thanks for anyone who is giving this a shot.
 

Machine Maker

Paper Developer
Staff member
Dec 17, 2021
132
6
19
18
California
I think that's the impropper way to define an empty list in YAML. that looks like a list of size 1 with the contents []. You probably just want to put the [] after the key directly. The "unknown" command is probably it trying to run the command /[] which would be unknown.