[SPIGOT-5785] Universal Command - React to every command with a specific argument Created: 17/Jun/20  Updated: 18/Jun/20  Resolved: 17/Jun/20

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Magnus Brandt Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: java, plugin

Version: This server is running CraftBukkit version git-Spigot-800b93f-8160e29 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

Hi!

Wouldn't it be cool to have, or is there something like an universal command:

You'd register it like ... this for example "this.setUniversalCommand(new UniversalCommandClass());"

Could be used if you want an argument on any of your plugins commands to trigger lets say the message "Hello".

Example

> /command specificArg

Hello

> /othercommand specificArg

Hello

This can be done manually.. I know.. but its just nice to have things dynamically isn't it?

 

Have a good day!



 Comments   
Comment by Magnus Brandt [ 18/Jun/20 ]

No I don't mean the onCommand method. For onCommand you have to assign a command to it for it to work. But I'm asking for a method, that, if ANY command is called, executes. With such a thing, if you would want to have partially the same functions on all commands, you wouldn't need to put this function in every command class. A little change but I personally would like it. Thanks

Comment by md_5 [ 17/Jun/20 ]

The onCommand method in Plugin does this by default?

Generated at Tue Apr 22 03:30:29 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.